Skip to content

Commit 59182e9

Browse files
authored
Fix/last frame and default n print (#341)
Quick fix for dump frequency related issues of API-initiated workflow * raising default n_print of the API-initiated melt-quenching workflow to 100000 * adding a routine that handles case where the user-defined n_print is larger as the n_ionic_steps (computed from T range and heating or cooling rate) to automatically chose the smaller of both numbers for n_print. This takes care that the last structure is automatically dumped in such cases.
1 parent 6e7a78b commit 59182e9

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

amorphouspy/src/amorphouspy/workflows/meltquench.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ def _run_lammps_md( # pragma: no cover
7777
t_start = temperature
7878
t_end = temperature_end if temperature_end is not None else temperature
7979

80+
# Clamp dump frequency so the final step is always captured when the run is
81+
# shorter than the requested print interval (e.g. fast heating stages).
82+
effective_n_print = min(n_print, n_ionic_steps)
83+
8084
input_control: dict[str, Any] = {
81-
"dump_modify": f"1 every {n_print} first yes",
85+
"dump_modify": f"1 every {effective_n_print} first yes",
8286
"thermo_style": "custom step temp density pe etotal pxx pxy pxz pyy pyz pzz vol",
8387
"thermo_modify": "flush yes",
8488
}
@@ -101,7 +105,7 @@ def _run_lammps_md( # pragma: no cover
101105
"temperature": temp_setting,
102106
"n_ionic_steps": n_ionic_steps,
103107
"time_step": timestep,
104-
"n_print": n_print,
108+
"n_print": effective_n_print,
105109
"initial_temperature": initial_temperature,
106110
"seed": seed,
107111
"pressure": passed_pressure,

amorphouspy_api/src/amorphouspy_api/workflows/meltquench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def run_melt_quench(submission: "JobSubmission", config: "BaseModel", result: di
8686
mq = melt_quench_simulation(
8787
structure=structure,
8888
potential=potential,
89-
n_print=1000,
89+
n_print=100000,
9090
heating_rate=heating_rate,
9191
cooling_rate=cooling_rate,
9292
timestep=timestep,

0 commit comments

Comments
 (0)