noextra option for write_data

This commit is contained in:
jrgissing
2018-03-03 14:28:35 -07:00
parent 89de70ff32
commit a323147819
3 changed files with 14 additions and 5 deletions

View File

@ -16,6 +16,7 @@ file = name of data file to write out :ulb,l
zero or more keyword/value pairs may be appended :l
keyword = {pair} or {nocoeff} :l
{nocoeff} = do not write out force field info
{noextra} = do not write out extra sections
{pair} value = {ii} or {ij}
{ii} = write one line of pair coefficient info per atom type
{ij} = write one line of pair coefficient info per IJ atom type pair :pre
@ -83,6 +84,10 @@ be written to the data file. This can be very helpful, if one wants
to make significant changes to the force field or if the parameters
are read in separately anyway, e.g. from an include file.
The {noextra} keyword requests that no extra sections should be
written to the data file. For example, this option excludes sections
for user-created per-atom properties, which are included by default.
The {pair} keyword lets you specify in what format the pair
coefficient information is written into the data file. If the value
is specified as {ii}, then one line per atom type is written, to
@ -120,4 +125,3 @@ setup, atom masses initialized, etc).
[Default:]
The option defaults are pair = ii.

View File

@ -74,6 +74,7 @@ void WriteData::command(int narg, char **arg)
pairflag = II;
coeffflag = 1;
extraflag = 1;
int noinit = 0;
int iarg = 1;
@ -90,6 +91,9 @@ void WriteData::command(int narg, char **arg)
} else if (strcmp(arg[iarg],"nocoeff") == 0) {
coeffflag = 0;
iarg++;
} else if (strcmp(arg[iarg],"noextra") == 0) {
extraflag = 0;
iarg++;
} else error->all(FLERR,"Illegal write_data command");
}
@ -206,10 +210,10 @@ void WriteData::write(char *file)
}
// extra sections managed by fixes
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->wd_section)
for (int m = 0; m < modify->fix[i]->wd_section; m++) fix(i,m);
if (extraflag)
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->wd_section)
for (int m = 0; m < modify->fix[i]->wd_section; m++) fix(i,m);
// close data file

View File

@ -35,6 +35,7 @@ class WriteData : protected Pointers {
int me,nprocs;
int pairflag;
int coeffflag;
int extraflag;
FILE *fp;
bigint nbonds_local,nbonds;
bigint nangles_local,nangles;