Finalize 0.7.1 blast stabilization gates

This commit is contained in:
Codex
2026-07-04 00:49:18 +08:00
parent 1a9a2e6f3e
commit 4be3f4ee91
8 changed files with 454 additions and 39 deletions
+6
View File
@@ -330,6 +330,12 @@ set_target_properties(test_blast_smoke PROPERTIES Fortran_MODULE_DIRECTORY "${SP
add_test(NAME blast_smoke COMMAND test_blast_smoke)
set_tests_properties(blast_smoke PROPERTIES WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(test_blast_smoke_071 tests/module/test_blast_smoke_071.f90)
target_link_libraries(test_blast_smoke_071 PRIVATE sphlite_core)
set_target_properties(test_blast_smoke_071 PROPERTIES Fortran_MODULE_DIRECTORY "${SPHLITE_MODULE_DIR}")
add_test(NAME blast_smoke_071 COMMAND test_blast_smoke_071)
set_tests_properties(blast_smoke_071 PROPERTIES WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(test_input_solid_material tests/module/test_input_solid_material.f90)
target_link_libraries(test_input_solid_material PRIVATE sphlite_core)
set_target_properties(test_input_solid_material PROPERTIES Fortran_MODULE_DIRECTORY "${SPHLITE_MODULE_DIR}")
+4 -2
View File
@@ -63,7 +63,7 @@ SPHLite 的编译和测试要求应与 FEMLite 保持一致风格:
## 当前状态
0.7.1 当前以 0.7.0 局部爆炸 smoke 发布版本为起点,进入多 blast region、载荷叠加和诊断稳定化开发。0.5.0 以来已完成内容主要包括:
0.7.1 当前以 0.7.0 局部爆炸 smoke 发布版本为起点,已完成多 blast region、载荷叠加、诊断一致性、输出边界、restart 边界和 release gate 稳定化。0.5.0 以来已完成内容主要包括:
- CMake/CTest 工程骨架和 Fortran 95 核心库。
- C ABI、C++ 头文件薄包装和 Python `ctypes` 调试入口。
@@ -97,4 +97,6 @@ SPHLite 的编译和测试要求应与 FEMLite 保持一致风格:
- 0.7.0 新增小型 Water/Gas/Explosive/Solid/Shell 局部爆炸 smoke、结构外载荷缓存、载荷诊断和默认回归 gate;该版本只用于链路验收,不作为工程精度 benchmark。
- 0.7.0 局部爆炸诊断先提供 Fortran API 和 CSV 调试输出,不新增公开 C ABI/C++/Python 稳定接口,也不写入正式 `STATE_0_7` restart。
- 0.7.0 本地 gate 已通过:完整 CTest 127/127,局部爆炸专项 gate 14/14,source size 相关 gate 7/7,`git diff --check` 通过。
- 0.7.1 将继续限定在 SPHLite 内部局部爆炸链路稳定化,不进入 0.8 的 FEM-SPH 接触耦合或连续体耦合;新增能力必须以多 region 小模型、诊断和回归 gate 验收。
- 0.7.1 新增多 blast region 输入加固、启用/禁用控制、重复 region 错误检查、Solid/Shell 载荷叠加诊断、多 region 输出/restart 边界测试和 `blast_smoke_071`。
- 0.7.1 本地 gate 已通过:完整 CTest 139/139,0.7.0 blast 回归 gate 14/14,0.7.1 blast 专项 gate 12/12,Water/Gas/Explosive/Solid/Shell 分类 gate 6/6、16/16、27/27、31/31、13/13,source size 相关 gate 7/7,`git diff --check` 通过。
- 0.7.1 仍限定在 SPHLite 内部局部爆炸链路稳定化,不进入 0.8 的 FEM-SPH 接触耦合或连续体耦合;不交付真实工程级水下接触爆炸响应、完整舱段破坏 benchmark、Shell 完整动力学闭环或公开 Blast C ABI/C++/Python 稳定接口。
+38 -1
View File
@@ -1,6 +1,6 @@
# 06 测试与验证计划
文档状态:0.6.0 gate 记录
文档状态:0.7.1 gate 记录
## 1. 测试原则
@@ -362,6 +362,43 @@ git diff --check
0.7.0 不验收真实工程级水下接触爆炸响应,不验收真实 FEM-SPH 接触耦合或连续体耦合,不验收完整舱段破坏 benchmark,不验收复杂撕裂、穿孔、碎片云、焊缝失效库、大规模并行或 GPU 后端。0.7.0 的局部爆炸诊断先提供 Fortran API 和 CSV 调试输出,不新增公开 C ABI/C++/Python 稳定接口,也不写入正式 `STATE_0_7` restart。
## 7.9 0.7.1 Release Gate
0.7.1 在 0.7.0 局部爆炸 smoke 起点之上进行稳定化。该 gate 只验收多 blast region 输入、启用/禁用控制、源/目标统计、结构载荷叠加、显式推进顺序、输出字段、restart 边界和小模型 smoke,不验收真实工程级水下接触爆炸响应。
0.7.1 局部爆炸专项 gate 包含:
- `input_blast_multiregion`
- `input_blast_region_errors_071`
- `blast_multiregion_snapshot`
- `blast_multiregion_target_filter`
- `blast_load_superposition`
- `blast_load_diagnostics_071`
- `blast_solver_order_071`
- `blast_response_multiregion`
- `blast_noop_regression_071`
- `blast_output_071`
- `blast_restart_boundary_071`
- `blast_smoke_071`
0.7.1 本地 release gate:
```powershell
cmake --build build-codex-unix --parallel
ctest --test-dir build-codex-unix --output-on-failure
ctest --test-dir build-codex-unix -R "^(water_eos|water_density|water_viscosity|water_force|solver_water|pressure_wave_smoke)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(input_gas|input_gas_multimaterial|gas_eos_ideal|gas_eos_jwl|gas_eos_stiffened|gas_eos_dispatch|gas_state|gas_summary|gas_extended_summary|gas_source|gas_source_errors|solver_gas|gas_output|gas_restart|gas_restart_031|gas_restart_030_compat)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(input_explosive|input_explosive_errors|input_explosive_multi_ignition|input_explosive_multimaterial|explosive_detonation_time|explosive_reaction_progress|explosive_initial_mass_release|explosive_release_balance|explosive_release_source|explosive_source_targeting|explosive_to_gas_phase|explosive_phase_refresh|explosive_gas_coupling|explosive_water_gas_smoke|explosive_summary|explosive_restart_040|explosive_restart_041|explosive_restart_040_compat|explosive_restart_no_double_release|explosive_restart_031_compat|explosive_c_api|explosive_release_c_api|explosive_release_cpp_api|explosive_python|explosive_release_python|explosive_cli|explosive_release_cli)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(input_solid_material|input_solid_errors|solid_051_input_validation|solid_state_build|solid_elastic_material|solid_johnson_cook_flow|solid_johnson_cook_failure|solid_progressive_softening|solid_gradient_correction|solid_reference_neighbor|solid_correction_matrix|solid_velocity_gradient|solid_strain_increment|solid_internal_force_pair|solid_uniform_stress_balance|solid_softening_force|solid_energy_diagnostics|solid_dt_acceleration|solid_stable_dt|solid_explicit_smoke|solid_output|solid_state_api|solid_restart_050|solid_restart_051|solid_restart_050_compat|solid_restart_041_compat|solid_c_api|solid_python|solid_python_051|solid_cli|solid_cli_051)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(input_shell_section|input_shell_errors|shell_state_build|shell_section_integration|shell_director_input|shell_reference_geometry|shell_director_update|shell_rotation_kinematics|shell_local_frame|shell_membrane_strain|shell_bending_strain|shell_shear_strain|shell_ip_strain_increment)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(input_blast_region|input_blast_errors|blast_source_snapshot|blast_target_filter|blast_load_accumulator|blast_load_conservation|blast_solver_order|blast_solid_response|blast_shell_response|blast_noop_regression|blast_summary|blast_output|blast_restart_boundary|blast_smoke)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(input_blast_multiregion|input_blast_region_errors_071|blast_multiregion_snapshot|blast_multiregion_target_filter|blast_load_superposition|blast_load_diagnostics_071|blast_solver_order_071|blast_response_multiregion|blast_noop_regression_071|blast_output_071|blast_restart_boundary_071|blast_smoke_071)$" --output-on-failure
ctest --test-dir build-codex-unix -R "^(source_size|explosive_source_size|explosive_041_source_size|gas_source_size_cleanup|solid_source_size|solid_051_source_size|shell_061_source_size)$" --output-on-failure
git diff --check
```
2026-07-04 本地结果:完整 CTest 139/139 通过,Water/Gas/Explosive/Solid/Shell 分类 gate 6/6、16/16、27/27、31/31、13/13 通过,0.7.0 blast 回归 gate 14/14 通过,0.7.1 blast 专项 gate 12/12 通过,source size 相关 gate 7/7 通过,`git diff --check` 通过。
0.7.1 不验收真实工程级水下接触爆炸响应,不验收真实 FEM-SPH 接触耦合或连续体耦合,不验收完整舱段破坏 benchmark,不验收复杂撕裂、穿孔、碎片云、焊缝失效库、大规模并行或 GPU 后端。0.7.1 的 Blast 诊断仍限定为 Fortran 内部查询和 CSV 调试边界,不新增公开 C ABI/C++/Python 稳定接口,也不写入新的正式 restart state。
## 8. Source Size 门禁
从第一版开始设置 source size 门禁。建议沿用 FEMLite 风格:
+50 -2
View File
@@ -1,10 +1,10 @@
# 09 版本历史与验收记录
文档状态:0.6.1 发布记录
文档状态:0.7.1 本地验收记录
## 1. 当前状态
SPHLite 当前发布 0.6.1 `Shell` 运动学基线版本。本版本在 0.6.0 Shell 输入与状态基线之上,新增 Shell director、section orientation、参考面积/转动惯量、局部坐标系、角速度/角加速度状态、director 小转动更新、Mindlin-Reissner 小变形应变和厚度积分点应变增量映射。0.6.1 不交付完整 Shell 动力学闭环、Shell 材料点更新、Shell 内力/内力矩、真实水-气-结构工程爆炸响应、真实 FEM-SPH 联合运行或工程级船舱破坏 benchmark。
SPHLite 当前验收版本为 0.7.1 局部爆炸稳定化版本。本版本在 0.7.0 小型 Water/Gas/Explosive/Solid/Shell blast smoke 起点之上,新增多 blast region 输入加固、启用/禁用控制、结构载荷叠加诊断、输出/restart 边界测试和 `blast_smoke_071`。0.7.1 不交付真实工程级水下接触爆炸响应、真实 FEM-SPH 联合运行、连续体耦合、完整舱段破坏 benchmark、Shell 完整动力学闭环或公开 Blast C ABI/C++/Python 稳定接口。
## 2. 规划版本线
@@ -530,6 +530,54 @@ cmake --build build-codex-unix
- 0.7.0 已于 2026-07-03 完成本地发布记录提交,并准备标记 `v0.7.0`。
### 0.7.1 本地验收记录
记录日期:2026-07-04
本地构建目录:`build-codex-unix`
版本定位:
- 0.7.1 是局部爆炸链路稳定化版本。
- 0.7.1 在 0.7.0 blast smoke 起点之上,新增多 blast region 输入、禁用 region、重复 region 错误检查和源/目标统计加固。
- 0.7.1 补强 Solid/Shell 结构载荷叠加、诊断有限性、显式推进顺序和 no-active-target 回归。
- 0.7.1 新增 `blast_smoke_071`,覆盖 Solid、Shell、Solid/Shell 混合多 region、小型禁用载荷和无 active target 样例。
- 0.7.1 仍不新增公开 Blast C ABI/C++/Python 稳定接口,也不新增正式 Blast restart state。
验收结果:
- `cmake --build build-codex-unix --parallel` 通过。
- `ctest --test-dir build-codex-unix --output-on-failure` 通过:139/139。
- Water/Gas/Explosive/Solid/Shell 分类 gate 通过:6/6、16/16、27/27、31/31、13/13。
- 0.7.0 blast 回归 gate 通过:14/14。
- 0.7.1 blast 专项 gate 通过:12/12。
- source size 相关 gate 通过:7/7。
- `git diff --check` 通过。
- 代码、构建脚本、测试和工具目录中未新增 FEMLite 直接依赖。
不交付范围:
- 0.7.1 不交付真实工程级水下接触爆炸响应。
- 0.7.1 不交付真实 FEM-SPH 接触耦合或连续体耦合。
- 0.7.1 不交付完整舱段破坏 benchmark。
- 0.7.1 不交付复杂撕裂、穿孔、碎片云、焊缝失效库、大规模并行或 GPU 后端。
- 0.7.1 不宣称 Shell 完整动力学闭环;Shell blast 仍只覆盖受控平动响应和诊断边界。
已知限制:
- Blast 外载荷仍是 smoke 级调试投影,不是工程级近场爆炸载荷算法。
- restart 仍保持既有 `STATE_0_5_1` 状态边界,Blast 控制和诊断不作为正式 restart state 保存。
- C ABI、C++ wrapper、Python ctypes 和 CLI 暂不公开 Blast 调试查询函数。
发布建议:
- 建议将 0.7.1 作为局部爆炸稳定化版本记录。
- 0.7.1 之后,若继续沿 blast 主线推进,应优先进入 0.8.0 的耦合边界设计或真实压力载荷投影设计。
发布记录:
- 0.7.1 已于 2026-07-04 完成本地验收记录,等待发布标记。
后续每个版本应记录:
- 完成能力。
+29 -2
View File
@@ -1,10 +1,10 @@
# 11 Benchmark 与验收矩阵
文档状态:0.6.1 gate 记录
文档状态:0.7.1 gate 记录
## 1. 当前状态
0.6.1 在 0.6.0 Shell 输入与状态基线 gate 基础上新增 Shell director、参考几何、局部坐标系、转动状态、Mindlin-Reissner 小变形应变和厚度积分点应变增量 gate,并继续保留工程 benchmark 矩阵作为长期规划。本版本的 Shell 运动学能力只用于小规模链路检查和后续材料点/内力开发前置验收,不作为工程精度 benchmark。
0.7.1 在 0.7.0 局部爆炸 smoke gate 基础上新增多 blast region、结构载荷叠加、诊断稳定性、输出/restart 边界和 `blast_smoke_071` gate,并继续保留工程 benchmark 矩阵作为长期规划。本版本的 Blast 能力只用于小规模链路检查和后续真实压力载荷、耦合边界开发前置验收,不作为工程精度 benchmark。
## 2. 0.1.0 Release Gate
@@ -406,6 +406,33 @@
|---|---|---|
| 2026-07-03 | `build-codex-unix` | 完整 CTest 127/127 通过,0.7.0 局部爆炸专项 gate 14/14 通过,source size 相关 gate 7/7 通过,`git diff --check` 通过 |
## 2.14 0.7.1 Release Gate
0.7.1 默认 gate 在 0.7.0 局部爆炸 smoke 起点之上稳定多 region、载荷叠加、诊断有限性、输出和 restart 边界。该 gate 只覆盖小型 Water/Gas/Explosive/Solid/Shell 链路,不验收工程级水下接触爆炸 benchmark。
| 测试名 | 类型 | 验收点 |
|---|---|---|
| `input_blast_multiregion` | Fortran input | 多 blast region 解析、名称保持、启用状态、source/target phase 和 target set 独立性 |
| `input_blast_region_errors_071` | Fortran input | 重复 region、非法 enabled/active、缺失字段和禁用 region 边界错误路径 |
| `blast_multiregion_snapshot` | Fortran module | 多 region 源区质量、能量、压力、Gas 体积和 Explosive 进度诊断互不串扰 |
| `blast_multiregion_target_filter` | Fortran module | 多 region target set、phase、active/failed 和跳过计数互不串扰 |
| `blast_load_superposition` | Fortran module | Solid 结构外载荷跨 region 叠加、分量方向和总力诊断 |
| `blast_load_diagnostics_071` | Fortran module | 目标数、总力、冲量、能量输入、最大加速度和非有限计数诊断 |
| `blast_solver_order_071` | Fortran solver | Explosive、Gas 源项、Blast snapshot/load 和 Solid/Shell 响应调用顺序稳定 |
| `blast_response_multiregion` | Fortran solver | Solid/Shell 多 region 外载荷显式响应和禁用 region 隔离 |
| `blast_noop_regression_071` | Fortran solver | Water-only、Gas-only、Explosive-only 和 no-active-target 情况不产生结构载荷 |
| `blast_output_071` | Fortran output | summary CSV 和粒子 CSV 中 blast 诊断字段边界稳定 |
| `blast_restart_boundary_071` | Fortran restart | 0.7.1 不新增正式 Blast restart state,读写边界保持兼容 |
| `blast_smoke_071` | Fortran smoke | Solid、Shell、Solid/Shell 混合多 region、禁用载荷、无 active target 小模型状态有限且诊断受控 |
0.7.1 不验收真实工程级水下接触爆炸响应、真实 FEM-SPH 接触耦合或连续体耦合、完整舱段破坏 benchmark、复杂撕裂/穿孔/碎片云、焊缝失效库、大规模并行或 GPU 后端。0.7.1 的 Blast 诊断仍限定在 Fortran 内部查询和 CSV 调试边界,不公开 C ABI/C++/Python 稳定接口。
本地验收记录:
| 日期 | 构建目录 | 结果 |
|---|---|---|
| 2026-07-04 | `build-codex-unix` | 完整 CTest 139/139 通过,Water/Gas/Explosive/Solid/Shell 分类 gate 6/6、16/16、27/27、31/31、13/13 通过,0.7.0 blast 回归 gate 14/14 通过,0.7.1 blast 专项 gate 12/12 通过,source size 相关 gate 7/7 通过,`git diff --check` 通过 |
## 3. 基础数值矩阵
| 领域 | 测试或 benchmark | 验收点 |
@@ -0,0 +1,50 @@
*NODE
1, 0.00, 0.0, 0.0
2, 0.08, 0.0, 0.0
3, 0.30, 0.0, 0.0
4, 0.36, 0.0, 0.0
5, 0.52, 0.0, 0.0
6, 0.60, 0.0, 0.0
*ELEMENT, TYPE=SPH3D
1, 1
2, 2
3, 3
4, 4
5, 5
6, 6
*ELSET, ELSET=WATER_PARTICLES
1, 2
*ELSET, ELSET=CHARGE_PARTICLES
3
*ELSET, ELSET=PRODUCT_PARTICLES
4
*ELSET, ELSET=SHELL_TARGET
5, 6
*MATERIAL, NAME=WATER, TYPE=WATER
*DENSITY
1000.0
*SECTION, ELSET=WATER_PARTICLES, MATERIAL=WATER
*MATERIAL, NAME=TNT, TYPE=EXPLOSIVE
*DENSITY
1600.0
*SECTION, ELSET=CHARGE_PARTICLES, MATERIAL=TNT
*MATERIAL, NAME=PRODUCTS, TYPE=GAS
*DENSITY
1600.0
*SECTION, ELSET=PRODUCT_PARTICLES, MATERIAL=PRODUCTS
*MATERIAL, NAME=STEEL_SHELL, TYPE=SHELL
*DENSITY
7850.0
*ELASTIC
210.0E9, 0.30
*SHELL SECTION, ELSET=SHELL_TARGET, MATERIAL=STEEL_SHELL, THICKNESS=0.010, POINTS=3, SHEAR_CORRECTION=0.8333333333
*SPHLITE SHELL DIRECTOR, SET=SHELL_TARGET, NX=0.0, NY=0.0, NZ=1.0
*SPHLITE EOS, TYPE=TAIT, MATERIAL=WATER, RHO0=1000.0, C0=1480.0, GAMMA=7.0, P0=0.0
*SPHLITE VISCOSITY, TYPE=MONAGHAN, MATERIAL=WATER, ALPHA=0.1, BETA=0.0, ETA2=0.01
*SPHLITE EOS, TYPE=JWL, MATERIAL=PRODUCTS, RHO0=1600.0, A=3.712E11, B=3.231E9, R1=4.15, R2=0.95, OMEGA=0.3, E0=4.2E6
*SPHLITE EXPLOSIVE, MATERIAL=TNT, TYPE=PROGRAMMED_BURN, DETONATION_VELOCITY=6900.0, ENERGY=4.2E6, BURN_TIME=1.0E-7, PRODUCT_MATERIAL=PRODUCTS, CONVERSION=SOURCE
*SPHLITE IGNITION, MATERIAL=TNT, X=0.30, Y=0.0, Z=0.0, TIME=0.0
*SPHLITE BLAST REGION, NAME=SHELL_PRIMARY, X=0.30, Y=0.0, Z=0.0, RADIUS=0.50, SOURCE_PHASE=GAS, TARGET_PHASE=SHELL, TARGET_SET=SHELL_TARGET, SCALE=1.0, TIME_WINDOW=2.0E-7, MODE=RADIAL
*SPHLITE BLAST REGION, NAME=SHELL_SECONDARY, X=0.30, Y=0.0, Z=0.0, RADIUS=0.50, SOURCE_PHASE=GAS, TARGET_PHASE=SHELL, TARGET_SET=SHELL_TARGET, SCALE=0.50, TIME_WINDOW=2.0E-7, MODE=RADIAL
*SPHLITE PARTICLE CONTROL, H=0.12, MASS=0.02, VOLUME=1.25E-5
*SPHLITE TIME CONTROL, DT=1.0E-7, TIME=2.0E-7, STEPS=2, SAFETY=0.5
+245
View File
@@ -0,0 +1,245 @@
program test_blast_smoke_071
use sph_precision, only: rk
use sph_error, only: SPH_SUCCESS
use sph_api, only: sph_initialize, sph_finalize, sph_read_inp, &
sph_build_model, sph_advance_explicit
use sph_database, only: npart, x, v, a, rho, pressure, internal_energy, &
temperature, h
use sph_blast, only: blast_source_count, blast_gas_volume, &
blast_source_pressure_mean, blast_explosive_progress_mean
use sph_blast_load, only: blast_solid_total_force, blast_shell_total_force, &
blast_load_target_count, blast_load_total_force, blast_load_impulse, &
blast_load_energy_input, blast_load_max_acceleration, &
blast_load_nonfinite_count, sph_blast_load_set_enabled
implicit none
integer :: ierr
call check_solid_multiregion_smoke()
call check_shell_multiregion_smoke()
call check_mixed_multiregion_smoke()
call check_disabled_load_smoke()
call check_no_active_target_smoke()
contains
subroutine check_solid_multiregion_smoke()
real(rk) :: progress_before
call setup_model('tests/data/blast_solid_superposition_071.inp')
progress_before = blast_explosive_progress_mean(1)
call sph_advance_explicit(1.0e-7_rk, ierr)
call assert_ok(ierr, '0.7.1 Solid multiregion smoke step failed')
call assert_progress_controlled(1, progress_before)
call assert_positive_gas_source(1)
if (blast_solid_total_force(1,1) <= 0.0_rk) then
call fail('0.7.1 Solid primary load direction mismatch')
end if
if (blast_solid_total_force(1,2) <= 0.0_rk) then
call fail('0.7.1 Solid secondary load direction mismatch')
end if
if (maxval(abs(blast_shell_total_force(:,1:2))) > 0.0_rk) then
call fail('0.7.1 Solid smoke polluted Shell force')
end if
call assert_region_diagnostics_finite(1)
call assert_region_diagnostics_finite(2)
call assert_state_finite()
call finish_model('0.7.1 Solid multiregion smoke finalize failed')
end subroutine check_solid_multiregion_smoke
subroutine check_shell_multiregion_smoke()
real(rk) :: progress_before
call setup_model('tests/data/blast_shell_superposition_071.inp')
progress_before = blast_explosive_progress_mean(1)
call sph_advance_explicit(1.0e-7_rk, ierr)
call assert_ok(ierr, '0.7.1 Shell multiregion smoke step failed')
call assert_progress_controlled(1, progress_before)
call assert_positive_gas_source(1)
if (blast_shell_total_force(1,1) <= 0.0_rk) then
call fail('0.7.1 Shell primary load direction mismatch')
end if
if (blast_shell_total_force(1,2) <= 0.0_rk) then
call fail('0.7.1 Shell secondary load direction mismatch')
end if
if (maxval(abs(blast_solid_total_force(:,1:2))) > 0.0_rk) then
call fail('0.7.1 Shell smoke polluted Solid force')
end if
call assert_region_diagnostics_finite(1)
call assert_region_diagnostics_finite(2)
call assert_state_finite()
call finish_model('0.7.1 Shell multiregion smoke finalize failed')
end subroutine check_shell_multiregion_smoke
subroutine check_mixed_multiregion_smoke()
real(rk) :: progress_before
call setup_model('tests/data/blast_multiregion_071.inp')
progress_before = blast_explosive_progress_mean(1)
call sph_advance_explicit(1.0e-7_rk, ierr)
call assert_ok(ierr, '0.7.1 mixed multiregion smoke step failed')
call assert_progress_controlled(1, progress_before)
call assert_progress_controlled(2, progress_before)
call assert_positive_gas_source(1)
call assert_positive_gas_source(2)
if (blast_solid_total_force(1,1) <= 0.0_rk) then
call fail('0.7.1 mixed Solid load direction mismatch')
end if
if (blast_shell_total_force(1,2) <= 0.0_rk) then
call fail('0.7.1 mixed Shell x load missing')
end if
if (blast_shell_total_force(2,2) <= 0.0_rk) then
call fail('0.7.1 mixed Shell y load missing')
end if
if (blast_load_target_count(3) /= 0) call fail('disabled smoke target changed')
if (maxval(abs(blast_load_total_force(:,3))) > 0.0_rk) then
call fail('disabled smoke region produced load')
end if
call assert_region_diagnostics_finite(1)
call assert_region_diagnostics_finite(2)
call assert_state_finite()
call finish_model('0.7.1 mixed multiregion smoke finalize failed')
end subroutine check_mixed_multiregion_smoke
subroutine check_disabled_load_smoke()
call setup_model('tests/data/blast_multiregion_071.inp')
call sph_blast_load_set_enabled(.false.)
call sph_advance_explicit(1.0e-7_rk, ierr)
call assert_ok(ierr, '0.7.1 disabled load smoke step failed')
if (maxval(abs(blast_load_target_count)) /= 0) then
call fail('0.7.1 disabled load smoke target count changed')
end if
if (maxval(abs(blast_load_total_force)) > 0.0_rk) then
call fail('0.7.1 disabled load smoke produced force')
end if
call assert_state_finite()
call finish_model('0.7.1 disabled load smoke finalize failed')
end subroutine check_disabled_load_smoke
subroutine check_no_active_target_smoke()
call check_no_active_target_file('tests/data/blast_water_only_noop_071.inp')
call check_no_active_target_file('tests/data/blast_gas_only_noop_071.inp')
call check_no_active_target_file('tests/data/blast_explosive_only_noop_071.inp')
end subroutine check_no_active_target_smoke
subroutine check_no_active_target_file(filename)
character(len=*), intent(in) :: filename
call setup_model(filename)
call sph_advance_explicit(1.0e-8_rk, ierr)
call assert_ok(ierr, '0.7.1 no-active-target smoke step failed')
if (blast_source_count(1) <= 0) call fail('no-active-target source missing')
if (blast_load_target_count(1) /= 0) then
call fail('no-active-target smoke produced structural target')
end if
if (maxval(abs(blast_load_total_force(:,1))) > 0.0_rk) then
call fail('no-active-target smoke produced structural force')
end if
if (blast_load_nonfinite_count(1) /= 0) then
call fail('no-active-target smoke nonfinite load')
end if
call assert_state_finite()
call finish_model('0.7.1 no-active-target smoke finalize failed')
end subroutine check_no_active_target_file
subroutine setup_model(filename)
character(len=*), intent(in) :: filename
call sph_initialize(ierr)
call assert_ok(ierr, 'initialize failed for 0.7.1 Blast smoke')
call sph_read_inp(filename, ierr)
call assert_ok(ierr, 'read failed for 0.7.1 Blast smoke')
call sph_build_model(ierr)
call assert_ok(ierr, 'build failed for 0.7.1 Blast smoke')
end subroutine setup_model
subroutine finish_model(message)
character(len=*), intent(in) :: message
call sph_finalize(ierr)
call assert_ok(ierr, message)
end subroutine finish_model
subroutine assert_positive_gas_source(region)
integer, intent(in) :: region
if (blast_gas_volume(region) <= 0.0_rk) call fail('Blast Gas volume missing')
if (blast_source_pressure_mean(region) <= 0.0_rk) then
call fail('Blast source pressure missing')
end if
end subroutine assert_positive_gas_source
subroutine assert_progress_controlled(region, previous)
integer, intent(in) :: region
real(rk), intent(in) :: previous
if (blast_explosive_progress_mean(region) + 1.0e-12_rk < previous) then
call fail('Blast explosive progress regressed')
end if
if (blast_explosive_progress_mean(region) > 1.0_rk + 1.0e-12_rk) then
call fail('Blast explosive progress exceeded one')
end if
end subroutine assert_progress_controlled
subroutine assert_region_diagnostics_finite(region)
integer, intent(in) :: region
call assert_vector_finite(blast_load_impulse(:,region), &
'Blast smoke impulse not finite')
call assert_scalar_finite(blast_load_energy_input(region), &
'Blast smoke energy input not finite')
call assert_scalar_finite(blast_load_max_acceleration(region), &
'Blast smoke acceleration diagnostic not finite')
if (blast_load_nonfinite_count(region) /= 0) then
call fail('Blast smoke nonfinite load')
end if
end subroutine assert_region_diagnostics_finite
subroutine assert_state_finite()
integer :: i
do i = 1, npart
call assert_vector_finite(x(:,i), 'Blast smoke position not finite')
call assert_vector_finite(v(:,i), 'Blast smoke velocity not finite')
call assert_vector_finite(a(:,i), 'Blast smoke acceleration not finite')
call assert_scalar_finite(rho(i), 'Blast smoke density not finite')
call assert_scalar_finite(pressure(i), 'Blast smoke pressure not finite')
call assert_scalar_finite(internal_energy(i), 'Blast smoke energy not finite')
call assert_scalar_finite(temperature(i), 'Blast smoke temperature not finite')
call assert_scalar_finite(h(i), 'Blast smoke smoothing length not finite')
end do
end subroutine assert_state_finite
subroutine assert_vector_finite(values, message)
real(rk), intent(in) :: values(3)
character(len=*), intent(in) :: message
integer :: i
do i = 1, 3
call assert_scalar_finite(values(i), message)
end do
end subroutine assert_vector_finite
subroutine assert_scalar_finite(value, message)
real(rk), intent(in) :: value
character(len=*), intent(in) :: message
if (value /= value) call fail(message)
if (abs(value) > huge(value) * 0.5_rk) call fail(message)
end subroutine assert_scalar_finite
subroutine assert_ok(ierr_value, message)
integer, intent(in) :: ierr_value
character(len=*), intent(in) :: message
if (ierr_value /= SPH_SUCCESS) call fail(message)
end subroutine assert_ok
subroutine fail(message)
character(len=*), intent(in) :: message
write(*, '(A)') trim(message)
stop 1
end subroutine fail
end program test_blast_smoke_071
+32 -32
View File
@@ -173,35 +173,35 @@
## 阶段 G:smoke、门禁、文档和发布准备
- [ ] 设计 0.7.1 多 region 局部爆炸 smoke 样例。
- [ ] 新增 Solid 多 region blast smoke 输入样例。
- [ ] 新增 Shell 多 region blast smoke 输入样例。
- [ ] 新增 Solid/Shell 混合多 region blast smoke 输入样例。
- [ ] 新增禁用 blast load 的 smoke 回归样例。
- [ ] 新增空 target set 或无 active target 的 smoke 样例。
- [ ] 验证 smoke 中所有粒子状态保持有限。
- [ ] 验证 smoke 中 Explosive 反应进度单调或受控。
- [ ] 验证 smoke 中 Gas 体积和压力诊断方向受控。
- [ ] 验证 smoke 中 Solid/Shell 载荷方向受控。
- [ ] 验证 smoke 中冲量和能量诊断为有限值。
- [ ] 新增 `blast_smoke_071` 测试。
- [ ] 运行 Water 回归 gate。
- [ ] 运行 Gas 回归 gate。
- [ ] 运行 Explosive 回归 gate。
- [ ] 运行 Solid 回归 gate。
- [ ] 运行 Shell 回归 gate。
- [ ] 运行 0.7.0 blast 回归 gate。
- [ ] 运行 0.7.1 blast 专项 gate。
- [ ] 运行完整 CTest。
- [ ] 运行 source size 相关 gate。
- [ ] 运行 `git diff --check`。
- [ ] 检查代码、构建脚本、测试和工具目录未新增 FEMLite 直接依赖。
- [ ] 检查输出目录、CSV、VTK、restart 和临时结果未被提交。
- [ ] 更新 `docs/06_test_and_verification_plan.md` 的 0.7.1 release gate。
- [ ] 更新 `docs/09_release_history.md` 的 0.7.1 本地验收记录。
- [ ] 更新 `docs/11_benchmark_matrix.md` 的 0.7.1 gate 矩阵。
- [ ] 更新 README 的 0.7.1 当前状态和不交付范围。
- [ ] 确认文档不宣称真实 FEM-SPH 联合运行。
- [ ] 确认文档不宣称工程级船舱破坏 benchmark。
- [ ] 准备 0.7.1 发布提交说明。
- [ ] 准备阶段 G 本地提交说明。
- [x] 设计 0.7.1 多 region 局部爆炸 smoke 样例。
- [x] 新增 Solid 多 region blast smoke 输入样例。
- [x] 新增 Shell 多 region blast smoke 输入样例。
- [x] 新增 Solid/Shell 混合多 region blast smoke 输入样例。
- [x] 新增禁用 blast load 的 smoke 回归样例。
- [x] 新增空 target set 或无 active target 的 smoke 样例。
- [x] 验证 smoke 中所有粒子状态保持有限。
- [x] 验证 smoke 中 Explosive 反应进度单调或受控。
- [x] 验证 smoke 中 Gas 体积和压力诊断方向受控。
- [x] 验证 smoke 中 Solid/Shell 载荷方向受控。
- [x] 验证 smoke 中冲量和能量诊断为有限值。
- [x] 新增 `blast_smoke_071` 测试。
- [x] 运行 Water 回归 gate。
- [x] 运行 Gas 回归 gate。
- [x] 运行 Explosive 回归 gate。
- [x] 运行 Solid 回归 gate。
- [x] 运行 Shell 回归 gate。
- [x] 运行 0.7.0 blast 回归 gate。
- [x] 运行 0.7.1 blast 专项 gate。
- [x] 运行完整 CTest。
- [x] 运行 source size 相关 gate。
- [x] 运行 `git diff --check`。
- [x] 检查代码、构建脚本、测试和工具目录未新增 FEMLite 直接依赖。
- [x] 检查输出目录、CSV、VTK、restart 和临时结果未被提交。
- [x] 更新 `docs/06_test_and_verification_plan.md` 的 0.7.1 release gate。
- [x] 更新 `docs/09_release_history.md` 的 0.7.1 本地验收记录。
- [x] 更新 `docs/11_benchmark_matrix.md` 的 0.7.1 gate 矩阵。
- [x] 更新 README 的 0.7.1 当前状态和不交付范围。
- [x] 确认文档不宣称真实 FEM-SPH 联合运行。
- [x] 确认文档不宣称工程级船舱破坏 benchmark。
- [x] 准备 0.7.1 发布提交说明。
- [x] 准备阶段 G 本地提交说明。