Removing junk copied during write_data

This commit is contained in:
jtclemm
2022-06-13 12:46:29 -06:00
parent 2638213a5c
commit 2084e18ad2
4 changed files with 14 additions and 4 deletions

View File

@ -178,7 +178,9 @@ Restart and other info
This bond style writes the reference state of each bond to This bond style writes the reference state of each bond to
:doc:`binary restart files <restart>`. Loading a restart file will :doc:`binary restart files <restart>`. Loading a restart file will
properly resume bonds. properly resume bonds. However, the reference state is NOT
written to data files. Therefore reading a data file will not
restore bonds which will recalculate their reference state.
The single() function of these pair styles returns 0.0 for the energy The single() function of these pair styles returns 0.0 for the energy
of a pairwise interaction, since energy is not conserved in these of a pairwise interaction, since energy is not conserved in these

View File

@ -141,7 +141,9 @@ Restart and other info
This bond style writes the reference state of each bond to This bond style writes the reference state of each bond to
:doc:`binary restart files <restart>`. Loading a restart :doc:`binary restart files <restart>`. Loading a restart
file will properly resume bonds. file will properly restore bonds. However, the reference state is NOT
written to data files. Therefore reading a data file will not
restore bonds which will recalculate their reference state.
The single() function of these pair styles returns 0.0 for the energy The single() function of these pair styles returns 0.0 for the energy
of a pairwise interaction, since energy is not conserved in these of a pairwise interaction, since energy is not conserved in these

View File

@ -82,10 +82,12 @@ int FixBondHistory::setmask()
void FixBondHistory::post_constructor() void FixBondHistory::post_constructor()
{ {
// Store saved bond quantities for each atom using fix property atom // Store saved bond quantities for each atom using fix property atom
// Don't copy history to data files because this fix is typically
// not yet instantiated - history is only preserved across restarts
id_fix = utils::strdup(id + std::string("_FIX_PROP_ATOM")); id_fix = utils::strdup(id + std::string("_FIX_PROP_ATOM"));
id_array = utils::strdup(std::string("d2_") + id); id_array = utils::strdup(std::string("d2_") + id);
modify->add_fix(fmt::format("{} {} property/atom {} {}", id_fix, group->names[igroup], id_array, modify->add_fix(fmt::format("{} {} property/atom {} {} writedata no", id_fix, group->names[igroup], id_array,
nbond * ndata)); nbond * ndata));
int tmp1, tmp2; int tmp1, tmp2;
index = atom->find_custom(&id_array[3], tmp1, tmp2); index = atom->find_custom(&id_array[3], tmp1, tmp2);

View File

@ -35,7 +35,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
if (narg < 4) error->all(FLERR, "Illegal fix property/atom command"); if (narg < 4) error->all(FLERR, "Illegal fix property/atom command");
restart_peratom = 1; restart_peratom = 1;
wd_section = 1; wd_section = 1; // can be overwitten using optional arguments
int iarg = 3; int iarg = 3;
nvalue = narg - iarg; nvalue = narg - iarg;
@ -153,6 +153,10 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix property/atom command"); if (iarg + 2 > narg) error->all(FLERR, "Illegal fix property/atom command");
border = utils::logical(FLERR, arg[iarg + 1], false, lmp); border = utils::logical(FLERR, arg[iarg + 1], false, lmp);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg], "writedata") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix property/atom command");
wd_section = utils::logical(FLERR,arg[iarg+1],false,lmp);
iarg += 2;
} else } else
error->all(FLERR, "Illegal fix property/atom command"); error->all(FLERR, "Illegal fix property/atom command");
} }