diff --git a/src/angle_zero.cpp b/src/angle_zero.cpp index 9803f64379..df5b083e4e 100644 --- a/src/angle_zero.cpp +++ b/src/angle_zero.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -AngleZero::AngleZero(LAMMPS *lmp) : Angle(lmp), check_coeffs(1) {} +AngleZero::AngleZero(LAMMPS *lmp) : Angle(lmp), coeffflag(1) {} /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ void AngleZero::settings(int narg, char **arg) error->all(FLERR,"Illegal angle_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) check_coeffs=0; + if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; else error->all(FLERR,"Illegal angle_style command"); } } @@ -80,7 +80,7 @@ void AngleZero::allocate() void AngleZero::coeff(int narg, char **arg) { - if ((narg < 1) || (check_coeffs && narg > 2)) + if ((narg < 1) || (coeffflag && narg > 2)) error->all(FLERR,"Incorrect args for angle coefficients"); if (!allocated) allocate(); @@ -89,7 +89,7 @@ void AngleZero::coeff(int narg, char **arg) force->bounds(arg[0],atom->nangletypes,ilo,ihi); double theta0_one = 0.0; - if (check_coeffs && (narg == 2)) + if (coeffflag && (narg == 2)) theta0_one = force->numeric(FLERR,arg[1]); diff --git a/src/angle_zero.h b/src/angle_zero.h index eda5311088..59c55679a8 100644 --- a/src/angle_zero.h +++ b/src/angle_zero.h @@ -42,7 +42,7 @@ class AngleZero : public Angle { protected: double *theta0; - int check_coeffs; + int coeffflag; void allocate(); }; diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index aec32468e3..0a354a758e 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -BondZero::BondZero(LAMMPS *lmp) : Bond(lmp), check_coeffs(1) {} +BondZero::BondZero(LAMMPS *lmp) : Bond(lmp), coeffflag(1) {} /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ void BondZero::settings(int narg, char **arg) error->all(FLERR,"Illegal bond_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) check_coeffs=0; + if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; else error->all(FLERR,"Illegal bond_style command"); } } @@ -80,7 +80,7 @@ void BondZero::allocate() void BondZero::coeff(int narg, char **arg) { - if ((narg < 1) || (check_coeffs && narg > 2)) + if ((narg < 1) || (coeffflag && narg > 2)) error->all(FLERR,"Incorrect args for bond coefficients"); if (!allocated) allocate(); @@ -89,7 +89,7 @@ void BondZero::coeff(int narg, char **arg) force->bounds(arg[0],atom->nbondtypes,ilo,ihi); double r0_one = 0.0; - if (check_coeffs && (narg == 2)) + if (coeffflag && (narg == 2)) r0_one = force->numeric(FLERR,arg[1]); int count = 0; diff --git a/src/bond_zero.h b/src/bond_zero.h index 157262c27a..a169e094e8 100644 --- a/src/bond_zero.h +++ b/src/bond_zero.h @@ -42,7 +42,7 @@ class BondZero : public Bond { protected: double *r0; - int check_coeffs; + int coeffflag; virtual void allocate(); }; diff --git a/src/dihedral_zero.cpp b/src/dihedral_zero.cpp index 8d5ad5f02b..1e4a4ab3ae 100644 --- a/src/dihedral_zero.cpp +++ b/src/dihedral_zero.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -DihedralZero::DihedralZero(LAMMPS *lmp) : Dihedral(lmp), check_coeffs(1) {} +DihedralZero::DihedralZero(LAMMPS *lmp) : Dihedral(lmp), coeffflag(1) {} /* ---------------------------------------------------------------------- */ @@ -56,7 +56,7 @@ void DihedralZero::settings(int narg, char **arg) error->all(FLERR,"Illegal dihedral_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) check_coeffs=0; + if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; else error->all(FLERR,"Illegal dihedral_style command"); } } @@ -78,7 +78,7 @@ void DihedralZero::allocate() void DihedralZero::coeff(int narg, char **arg) { - if ((narg < 1) || (check_coeffs && narg > 1)) + if ((narg < 1) || (coeffflag && narg > 1)) error->all(FLERR,"Incorrect args for dihedral coefficients"); if (!allocated) allocate(); diff --git a/src/dihedral_zero.h b/src/dihedral_zero.h index 3fd9444536..cb16340f81 100644 --- a/src/dihedral_zero.h +++ b/src/dihedral_zero.h @@ -42,7 +42,7 @@ class DihedralZero : public Dihedral { void write_data(FILE *); protected: - int check_coeffs; + int coeffflag; virtual void allocate(); }; diff --git a/src/improper_zero.cpp b/src/improper_zero.cpp index a8f9923cd2..958f662162 100644 --- a/src/improper_zero.cpp +++ b/src/improper_zero.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ImproperZero::ImproperZero(LAMMPS *lmp) : Improper(lmp), check_coeffs(1) {} +ImproperZero::ImproperZero(LAMMPS *lmp) : Improper(lmp), coeffflag(1) {} /* ---------------------------------------------------------------------- */ @@ -56,7 +56,7 @@ void ImproperZero::settings(int narg, char **arg) error->all(FLERR,"Illegal improper_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) check_coeffs=0; + if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; else error->all(FLERR,"Illegal improper_style command"); } } @@ -78,7 +78,7 @@ void ImproperZero::allocate() void ImproperZero::coeff(int narg, char **arg) { - if ((narg < 1) || (check_coeffs && narg > 1)) + if ((narg < 1) || (coeffflag && narg > 1)) error->all(FLERR,"Incorrect args for improper coefficients"); if (!allocated) allocate(); diff --git a/src/improper_zero.h b/src/improper_zero.h index f0eec1e01d..d999bdd8d9 100644 --- a/src/improper_zero.h +++ b/src/improper_zero.h @@ -38,7 +38,7 @@ class ImproperZero : public Improper { void write_data(FILE *); protected: - int check_coeffs; + int coeffflag; virtual void allocate(); }; diff --git a/src/pair_zero.cpp b/src/pair_zero.cpp index 731a743d53..01fc912daf 100644 --- a/src/pair_zero.cpp +++ b/src/pair_zero.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -PairZero::PairZero(LAMMPS *lmp) : Pair(lmp), check_coeffs(1) {} +PairZero::PairZero(LAMMPS *lmp) : Pair(lmp), coeffflag(1) {} /* ---------------------------------------------------------------------- */ @@ -82,7 +82,7 @@ void PairZero::settings(int narg, char **arg) cut_global = force->numeric(FLERR,arg[0]); if (narg == 2) { - if (strcmp("nocoeff",arg[1]) == 0) check_coeffs=0; + if (strcmp("nocoeff",arg[1]) == 0) coeffflag=0; else error->all(FLERR,"Illegal pair_style command"); } @@ -100,7 +100,7 @@ void PairZero::settings(int narg, char **arg) void PairZero::coeff(int narg, char **arg) { - if ((narg < 2) || (check_coeffs && narg > 3)) + if ((narg < 2) || (coeffflag && narg > 3)) error->all(FLERR,"Incorrect args for pair coefficients"); if (!allocated) allocate(); @@ -110,7 +110,7 @@ void PairZero::coeff(int narg, char **arg) force->bounds(arg[1],atom->ntypes,jlo,jhi); double cut_one = cut_global; - if (check_coeffs && (narg == 3)) cut_one = force->numeric(FLERR,arg[2]); + if (coeffflag && (narg == 3)) cut_one = force->numeric(FLERR,arg[2]); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -185,7 +185,7 @@ void PairZero::read_restart(FILE *fp) void PairZero::write_restart_settings(FILE *fp) { fwrite(&cut_global,sizeof(double),1,fp); - fwrite(&check_coeffs,sizeof(int),1,fp); + fwrite(&coeffflag,sizeof(int),1,fp); } /* ---------------------------------------------------------------------- @@ -197,9 +197,9 @@ void PairZero::read_restart_settings(FILE *fp) int me = comm->me; if (me == 0) { fread(&cut_global,sizeof(double),1,fp); - fread(&check_coeffs,sizeof(int),1,fp); + fread(&coeffflag,sizeof(int),1,fp); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); - MPI_Bcast(&check_coeffs,1,MPI_INT,0,world); + MPI_Bcast(&coeffflag,1,MPI_INT,0,world); } diff --git a/src/pair_zero.h b/src/pair_zero.h index 962a059458..a0c18aa68b 100644 --- a/src/pair_zero.h +++ b/src/pair_zero.h @@ -50,7 +50,7 @@ class PairZero : public Pair { protected: double cut_global; double **cut; - int check_coeffs; + int coeffflag; virtual void allocate(); }; diff --git a/src/read_data.cpp b/src/read_data.cpp index 5403f5bf02..39afcfbcf8 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -123,7 +123,7 @@ void ReadData::command(int narg, char **arg) // optional args addflag = NONE; - no_coeffs = 0; + coeffflag = 1; id_offset = 0; offsetflag = shiftflag = 0; toffset = boffset = aoffset = doffset = ioffset = 0; @@ -174,7 +174,7 @@ void ReadData::command(int narg, char **arg) error->all(FLERR,"Non-zero read_data shift z value for 2d simulation"); iarg += 4; } else if (strcmp(arg[iarg],"nocoeff") == 0) { - no_coeffs = 1; + coeffflag = 0; iarg ++; } else if (strcmp(arg[iarg],"extra/atom/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); @@ -290,7 +290,7 @@ void ReadData::command(int narg, char **arg) Improper *saved_improper = NULL; KSpace *saved_kspace = NULL; - if (no_coeffs) { + if (coeffflag == 0) { char *coeffs[2]; coeffs[0] = (char *) "10.0"; coeffs[1] = (char *) "nocoeff"; @@ -825,8 +825,8 @@ void ReadData::command(int narg, char **arg) "Read_data shrink wrap did not assign all atoms correctly"); } - // restore old styles, for nocoeff flag read - if (no_coeffs) { + // restore old styles, when reading with nocoeff flag given + if (coeffflag == 0) { if (force->pair) delete force->pair; force->pair = saved_pair; diff --git a/src/read_data.h b/src/read_data.h index c0a27ee15b..5463c86f08 100644 --- a/src/read_data.h +++ b/src/read_data.h @@ -64,7 +64,7 @@ class ReadData : protected Pointers { // optional args - int addflag,offsetflag,shiftflag,no_coeffs; + int addflag,offsetflag,shiftflag,coeffflag; tagint addvalue; int toffset,boffset,aoffset,doffset,ioffset; double shift[3];