diff --git a/doc/write_data.txt b/doc/write_data.txt index d914fe4b6c..b22a42c49c 100644 --- a/doc/write_data.txt +++ b/doc/write_data.txt @@ -14,7 +14,8 @@ write_data file keyword value ... :pre file = name of data file to write out :ulb,l zero or more keyword/value pairs may be appended :l -keyword = {pair} :l +keyword = {pair} or {nocoeff} :l + {nocoeff} = do not write out force field info {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 @@ -77,6 +78,11 @@ data file is read. :line +The {nocoeff} keyword requests that no force field parameters should +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 {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 diff --git a/src/write_data.cpp b/src/write_data.cpp index 03faf0249d..2bf1ad84f8 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -73,6 +73,7 @@ void WriteData::command(int narg, char **arg) // noinit is a hidden arg, only used by -r command-line switch pairflag = II; + coeffflag = 1; int noinit = 0; int iarg = 1; @@ -86,6 +87,9 @@ void WriteData::command(int narg, char **arg) } else if (strcmp(arg[iarg],"noinit") == 0) { noinit = 1; iarg++; + } else if (strcmp(arg[iarg],"nocoeff") == 0) { + coeffflag = 0; + iarg++; } else error->all(FLERR,"Illegal write_data command"); } @@ -176,7 +180,7 @@ void WriteData::write(char *file) if (me == 0) { header(); type_arrays(); - force_fields(); + if (coeffflag) force_fields(); } // per atom info diff --git a/src/write_data.h b/src/write_data.h index 66f8d42bc2..8a4fdfac4c 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -34,6 +34,7 @@ class WriteData : protected Pointers { private: int me,nprocs; int pairflag; + int coeffflag; FILE *fp; bigint nbonds_local,nbonds; bigint nangles_local,nangles;