From a3231478199a3e7ace98e642d2d27528bb03ba17 Mon Sep 17 00:00:00 2001 From: jrgissing Date: Sat, 3 Mar 2018 14:28:35 -0700 Subject: [PATCH 1/4] noextra option for write_data --- doc/src/write_data.txt | 6 +++++- src/write_data.cpp | 12 ++++++++---- src/write_data.h | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/src/write_data.txt b/doc/src/write_data.txt index 39e5a7f811..12074c4f07 100644 --- a/doc/src/write_data.txt +++ b/doc/src/write_data.txt @@ -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. - diff --git a/src/write_data.cpp b/src/write_data.cpp index 7c8838628e..6dc447a966 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -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 diff --git a/src/write_data.h b/src/write_data.h index 462c78c794..b1d2b747ef 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -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; From 959883ad03ace2572acda46190fd9e2335af77a0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 4 Mar 2018 09:49:50 -0500 Subject: [PATCH 2/4] rename noextra option to nofix since this corresponds to the `fix` option of `read_data`, calling this flag `nofix` seems more consistent and descriptive. --- doc/src/write_data.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/write_data.txt b/doc/src/write_data.txt index 12074c4f07..c76f20319c 100644 --- a/doc/src/write_data.txt +++ b/doc/src/write_data.txt @@ -16,7 +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 + {nofix} = do not write out extra sections read by fixes {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 @@ -84,9 +84,11 @@ 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 {nofix} keyword requests that no extra sections read by fixes +should be written to the data file (see the {fix} option of the +"read_data"_read_data.html command for details). For example, this +option excludes sections for user-created per-atom properties +from "fix property/atom"_fix_property_atom.html. The {pair} keyword lets you specify in what format the pair coefficient information is written into the data file. If the value From 04bd26874562937e4311021a0a9299f80564870d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 4 Mar 2018 09:55:44 -0500 Subject: [PATCH 3/4] rename noextra flag to nofix --- src/write_data.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/write_data.cpp b/src/write_data.cpp index 6dc447a966..d9694f7cd3 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -74,7 +74,7 @@ void WriteData::command(int narg, char **arg) pairflag = II; coeffflag = 1; - extraflag = 1; + fixflag = 1; int noinit = 0; int iarg = 1; @@ -91,8 +91,8 @@ 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; + } else if (strcmp(arg[iarg],"nofix") == 0) { + fixflag = 0; iarg++; } else error->all(FLERR,"Illegal write_data command"); } @@ -210,7 +210,7 @@ void WriteData::write(char *file) } // extra sections managed by fixes - if (extraflag) + if (fixflag) 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); @@ -256,10 +256,11 @@ void WriteData::header() } } - for (int i = 0; i < modify->nfix; i++) - if (modify->fix[i]->wd_header) - for (int m = 0; m < modify->fix[i]->wd_header; m++) - modify->fix[i]->write_data_header(fp,m); + if (fixflag) + for (int i = 0; i < modify->nfix; i++) + if (modify->fix[i]->wd_header) + for (int m = 0; m < modify->fix[i]->wd_header; m++) + modify->fix[i]->write_data_header(fp,m); fprintf(fp,"\n"); From 49aad1d157cc2e6c3e2afeef26e3edf57c0e570b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 4 Mar 2018 09:56:22 -0500 Subject: [PATCH 4/4] rename noextra flag to nofix --- src/write_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_data.h b/src/write_data.h index b1d2b747ef..ced6a3be8b 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -35,7 +35,7 @@ class WriteData : protected Pointers { int me,nprocs; int pairflag; int coeffflag; - int extraflag; + int fixflag; FILE *fp; bigint nbonds_local,nbonds; bigint nangles_local,nangles;