docs: examples/Readme.html v2.1 更新引擎 DLL 架构说明
This commit is contained in:
+17
-4
@@ -169,7 +169,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<h1>Dynamics 示例案例 <small>v2.0</small></h1>
|
<h1>Dynamics 示例案例 <small>v2.1</small></h1>
|
||||||
<p class="subtitle">10 个从简单到复杂的物理模拟案例,展示分子动力学模拟框架的多种应用场景</p>
|
<p class="subtitle">10 个从简单到复杂的物理模拟案例,展示分子动力学模拟框架的多种应用场景</p>
|
||||||
|
|
||||||
<h2>📋 案例总览</h2>
|
<h2>📋 案例总览</h2>
|
||||||
@@ -412,7 +412,12 @@
|
|||||||
<h3>配置</h3>
|
<h3>配置</h3>
|
||||||
<p style="color:var(--text-dim); font-size:0.875rem;">
|
<p style="color:var(--text-dim); font-size:0.875rem;">
|
||||||
每个案例的 <code>input/input.txt</code> 可配置物理参数、力开关、算法、引擎、渲染方式等。
|
每个案例的 <code>input/input.txt</code> 可配置物理参数、力开关、算法、引擎、渲染方式等。
|
||||||
从 case06 起支持 <code>save_trajectory</code> 开关、摄像机初始位置、<code>display_amp</code> 视觉放大等高级功能。
|
</p>
|
||||||
|
|
||||||
|
<h3>引擎架构</h3>
|
||||||
|
<p style="color:var(--text-dim); font-size:0.875rem;">
|
||||||
|
外部引擎(C / C++ / Fortran)以 <strong>DLL 方式</strong> 运行,主程序通过 ctypes 在进程内直接调用,不启动子进程。DLL 预编译在 <code>engines/release/</code> 中,源码位于 <code>engines/src/{c,cpp,fortran}/</code>。重新编译:
|
||||||
|
<code>cd engines/src/c && make dll</code>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -421,10 +426,18 @@
|
|||||||
<pre style="font-size:0.825rem; color:var(--text-dim); line-height:1.5;">
|
<pre style="font-size:0.825rem; color:var(--text-dim); line-height:1.5;">
|
||||||
dynamics/
|
dynamics/
|
||||||
├── dynamics.py # 统一运行入口
|
├── dynamics.py # 统一运行入口
|
||||||
├── compute.py # Python 物理引擎
|
├── compute.py # 物理引擎 + 显示数据生成
|
||||||
├── draw.py # VisPy 3D 动画
|
├── draw.py # VisPy 3D 动画
|
||||||
├── plot_wave.py # 波形能量图
|
├── plot_wave.py # 波形能量图
|
||||||
├── engines/ # C / C++ / Fortran 引擎
|
├── .gitattributes # DLL/二进制文件保护
|
||||||
|
├── engines/
|
||||||
|
│ ├── engine_dll.py # DLL 加载器(ctypes)
|
||||||
|
│ ├── python/ # Python 引擎(dynamics_lib.py)
|
||||||
|
│ ├── release/ # 预编译 DLL(C / C++ / Fortran)
|
||||||
|
│ └── src/ # 引擎源码
|
||||||
|
│ ├── c/ # C 源码 + Makefile → dynamics_c.dll
|
||||||
|
│ ├── cpp/ # C++ 源码 + Makefile → dynamics_cpp.dll
|
||||||
|
│ └── fortran/ # Fortran 源码 + Makefile → dynamics_f90.dll
|
||||||
├── examples/ # 案例目录
|
├── examples/ # 案例目录
|
||||||
│ ├── case01/ ~ case10/
|
│ ├── case01/ ~ case10/
|
||||||
└── output/ # 默认输出目录
|
└── output/ # 默认输出目录
|
||||||
|
|||||||
Reference in New Issue
Block a user