fix: color_xrange 范围限定 d_max + color_driver + color 范围改为 [0,1] + bug 修复

This commit is contained in:
2026-06-24 16:09:39 +08:00
parent b50c55d0a3
commit e415bf5ba5
87 changed files with 360440 additions and 76 deletions
+8 -9
View File
@@ -187,12 +187,11 @@ def run_case(config_path, runtime_base, input_dir="input", output_dir="output",
disp_path = os.path.join(output_dir_abs, "display.txt")
# ── 自动缓存检测 ───────────────────────────────────────
# force_calc=1: 强制重新计算,忽略缓存
# force_calc=0: 尊重 step_simulate 设置,不自动覆盖
# force_calc=1: 强制重新计算,忽略缓存(仅在 step_simulate=1 时生效)
# force_calc=0: 尊重 step_simulate 设置
force_calc = int(config.get("force_calc", 0))
if force_calc:
if force_calc and config.get("step_simulate", 1):
print(f"[run] force_calc=1,跳过缓存,强制重新计算")
config["step_simulate"] = 1
config["step_sample"] = 1
elif config.get("step_simulate", 1):
# step_simulate=1 且 force_calc=0 → 按用户要求执行计算
@@ -225,12 +224,12 @@ def run_case(config_path, runtime_base, input_dir="input", output_dir="output",
print(f"[run] 没有可用的缓存输出,但 step_simulate=0,将跳过模拟")
# 2. 运行物理模拟 → output/trajectory.txt
_engine_aliases = {"c++": "cpp", "f90": "fortran", "f": "fortran"}
engine = _engine_aliases.get(
str(config.get("engine", "python")).lower(),
str(config.get("engine", "python")).lower()
)
if config.get("step_simulate", 1):
_engine_aliases = {"c++": "cpp", "f90": "fortran", "f": "fortran"}
engine = _engine_aliases.get(
str(config.get("engine", "python")).lower(),
str(config.get("engine", "python")).lower()
)
total_steps = config["NT"]
record_steps = total_steps - (config.get("warmup_steps") or 0)
print(f"[run] 开始计算 总步数={total_steps} 记录步数={record_steps} DT={config['DT']}")