Files
MDHelper/docs/examples_manual.md
T
2026-05-25 17:12:00 +08:00

113 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 案例导航
案例位于 `examples/`。
## SPH
```text
examples/sph/benchmarks/
```
推荐阅读顺序:
1. `hydrostatic_tank`:静水保持,检查边界和压力。
2. `dam_break_pressure`:三维溃坝,检查自由面和壁面。
3. `couette_flow`:周期边界和剪切流。
4. `poiseuille_flow`:通道流和解析速度剖面。
5. `oscillating_droplet`:表面张力液滴。
6. `elastic_bar_impact`:固体 SPH 冲击。
## FEM
```text
examples/fem/
```
推荐分组:
- patch test。
- 梁、壳、实体基础测试。
- 材料测试。
- 接触测试。
- 多孔介质测试。
- 求解器测试。
- 后处理测试。
## Geometry
```text
examples/geometry/
```
用于检查 CAD 建模、几何导出、网格划分和粒子划分。
## Benchmark 规则
新 benchmark 应尽量遵循:
- `pipeline.xml` 负责建模、离散和求解。
- `benchmark_*.cpp` 只读取结果并对比解析解。
- 报告写入 `outputs/*.csv`。
- README 说明运行命令和评价指标。
## 新建案例步骤
1. 创建目录:
```text
examples/<physics>/benchmarks/<case_name>/
```
2. 创建配置:
```text
pipeline.xml
config/cad.xml
config/meshing.xml 或 config/particle_meshing.xml
config/sph_solver.xml 或 config/fem_solver.xml
```
3. 运行:
```powershell
.\cmake-build-cuda13\Release\M3Frame.exe examples\<physics>\benchmarks\<case_name>\pipeline.xml
```
4. 创建可选 benchmark:
```text
benchmark_<case_name>.cpp
```
benchmark 只做:
- 读取 PVD/VTU/CSV。
- 计算误差。
- 写报告。
- 返回成功或失败码。
## README 建议模板
```markdown
# Case Name
## 目的
说明验证什么物理模型或数值算法。
## 运行
```powershell
.\cmake-build-cuda13\Release\M3Frame.exe examples\...\pipeline.xml
```
## 输出
- `outputs/.../*.pvd`
- `outputs/.../*_report.csv`
## 判据
说明误差阈值或定性观察点。
```