Skip to content

Commit a4eca19

Browse files
Updated the revise_lmp_input_dump function. (#1137)
Added the `model_devi_merge_traj` parameter to allow the merging of trajectories into one file using the lmp_input template. --------- Signed-off-by: Pan Xiang <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7a1ceb4 commit a4eca19

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

dpgen/generator/run.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -921,12 +921,19 @@ def revise_lmp_input_model(lmp_lines, task_model_list, trj_freq, deepmd_version=
921921
return lmp_lines
922922

923923

924-
def revise_lmp_input_dump(lmp_lines, trj_freq):
924+
def revise_lmp_input_dump(lmp_lines, trj_freq, model_devi_merge_traj=False):
925925
idx = find_only_one_key(lmp_lines, ["dump", "dpgen_dump"])
926-
lmp_lines[idx] = (
927-
"dump dpgen_dump all custom %d traj/*.lammpstrj id type x y z\n"
928-
% trj_freq
929-
)
926+
if model_devi_merge_traj:
927+
lmp_lines[idx] = (
928+
"dump dpgen_dump all custom %d all.lammpstrj id type x y z\n"
929+
% trj_freq
930+
)
931+
else:
932+
lmp_lines[idx] = (
933+
"dump dpgen_dump all custom %d traj/*.lammpstrj id type x y z\n"
934+
% trj_freq
935+
)
936+
930937
return lmp_lines
931938

932939

@@ -1317,7 +1324,9 @@ def _make_model_devi_revmat(iter_index, jdata, mdata, conf_systems):
13171324
deepmd_version=deepmd_version,
13181325
)
13191326

1320-
lmp_lines = revise_lmp_input_dump(lmp_lines, trj_freq)
1327+
lmp_lines = revise_lmp_input_dump(
1328+
lmp_lines, trj_freq, model_devi_merge_traj
1329+
)
13211330
lmp_lines = revise_by_keys(
13221331
lmp_lines,
13231332
total_rev_keys[:total_num_lmp],

0 commit comments

Comments
 (0)