Summary
If LAMMPS restarts, model_devi.out should be appended to instead of creating a new file.
Detailed Description
How to implement:
- set
restartinfo to 1 (default)
See: https://github.com/lammps/lammps/blob/9da49d9c6f521eed62ca0752297c9057d34d39db/src/pair.cpp#L61
- add
read_restart to pair, where open the file using std::ofstream::app mode
See:
https://github.com/lammps/lammps/blob/9da49d9c6f521eed62ca0752297c9057d34d39db/src/pair.cpp#L725-L729
http://www.cplusplus.com/reference/fstream/ofstream/open/
- add a condition to skip opening a new file and adding headers if restart
See:
|
if (numb_models > 1 && out_freq > 0){ |
|
fp.open (out_file); |
|
fp << scientific; |
|
fp << "#" |
|
<< setw(12-1) << "step" |
|
<< setw(18+1) << "max_devi_v" |
|
<< setw(18+1) << "min_devi_v" |
|
<< setw(18+1) << "avg_devi_v" |
|
<< setw(18+1) << "max_devi_f" |
|
<< setw(18+1) << "min_devi_f" |
|
<< setw(18+1) << "avg_devi_f" |
|
<< endl; |
|
} |
Potential problems: Since we don't save restart files every timestep, there may be some duplicated data before and after restart.
Summary
If LAMMPS restarts,
model_devi.outshould be appended to instead of creating a new file.Detailed Description
How to implement:
restartinfoto 1 (default)See: https://github.com/lammps/lammps/blob/9da49d9c6f521eed62ca0752297c9057d34d39db/src/pair.cpp#L61
read_restarttopair, where open the file usingstd::ofstream::appmodeSee:
https://github.com/lammps/lammps/blob/9da49d9c6f521eed62ca0752297c9057d34d39db/src/pair.cpp#L725-L729
http://www.cplusplus.com/reference/fstream/ofstream/open/
See:
deepmd-kit/source/lmp/pair_deepmd.cpp
Lines 838 to 850 in f70437f
Potential problems: Since we don't save restart files every timestep, there may be some duplicated data before and after restart.