Add Explosive interfaces and restart

This commit is contained in:
Codex
2026-07-03 12:32:14 +08:00
parent 5853ac2644
commit 187af844d1
17 changed files with 629 additions and 32 deletions
+28
View File
@@ -82,6 +82,16 @@ def main() -> int:
"gas_dtcrit",
"gas_source_mass",
"gas_source_energy",
"explosive_phase_particles",
"explosive_particles",
"explosive_reacted_particles",
"explosive_lambda_min",
"explosive_lambda_max",
"explosive_lambda_mean",
"explosive_released_mass",
"explosive_released_energy",
"explosive_detonation_time_min",
"explosive_detonation_time_max",
"status",
):
require_field(inspect.stdout, field)
@@ -110,6 +120,8 @@ def main() -> int:
raise AssertionError("CLI dtcrit mismatch")
if int(inspect_fields["gas_particles"]) != 0:
raise AssertionError("CLI water inspect gas particle count mismatch")
if int(inspect_fields["explosive_particles"]) != 0:
raise AssertionError("CLI water inspect explosive particle count mismatch")
if inspect_fields["status"] != "ok":
raise AssertionError("CLI status field mismatch")
@@ -130,6 +142,22 @@ def main() -> int:
raise AssertionError("CLI gas extended mass mismatch")
if float(gas_fields["gas_source_mass"]) != 0.0:
raise AssertionError("CLI gas source default mismatch")
if int(gas_fields["explosive_particles"]) != 0:
raise AssertionError("CLI gas inspect explosive particle count mismatch")
explosive_model = str(Path(args.input).parent / "explosive_conversion_phase_040.inp")
explosive_run = run_command([exe, explosive_model, "--run"])
explosive_fields = read_fields(explosive_run.stdout)
if int(explosive_fields["explosive_phase_particles"]) <= 0:
raise AssertionError("CLI explosive phase particle count mismatch")
if int(explosive_fields["explosive_particles"]) <= 0:
raise AssertionError("CLI explosive tracked particle count mismatch")
if int(explosive_fields["explosive_reacted_particles"]) <= 0:
raise AssertionError("CLI explosive reacted particle count mismatch")
if float(explosive_fields["explosive_lambda_max"]) <= 0.0:
raise AssertionError("CLI explosive lambda mismatch")
if float(explosive_fields["explosive_released_energy"]) <= 0.0:
raise AssertionError("CLI explosive released energy mismatch")
check = run_command([exe, model, "--check"])
if "mode: check" not in check.stdout: