diff --git a/doc/README.md b/doc/README.md index 26a51c13ab..b843b7eabe 100644 --- a/doc/README.md +++ b/doc/README.md @@ -14,8 +14,8 @@ make clean-all # remove entire build folder and any cached data ## Installing prerequisites -To run the documention build toolchain Python 3 and virtualenv have to be -installed. Here are instructions for common setups: +To run the documention build toolchain, Python 3 and virtualenv have +to be installed. Here are instructions for common setups: ### Ubuntu @@ -23,10 +23,16 @@ installed. Here are instructions for common setups: sudo apt-get install python-virtualenv ``` -### Fedora +### Fedora (up to version 21), Red Hat Enterprise Linux or CentOS (up to version 7.x) +```bash +sudo yum install python3-virtualenv ``` -sudo yum install python-virtualenv + +### Fedora (since version 22) + +```bash +sudo dnf install python3-virtualenv ``` ### MacOS X diff --git a/doc/src/compute_omega_chunk.txt b/doc/src/compute_omega_chunk.txt index f820f1cd72..c46184212f 100644 --- a/doc/src/compute_omega_chunk.txt +++ b/doc/src/compute_omega_chunk.txt @@ -64,7 +64,7 @@ command, for example: compute cc1 all chunk/atom molecule compute myChunk all omega/chunk cc1 -fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre +fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector :pre [Output info:] diff --git a/lib/meam/meam_setup_done.F b/lib/meam/meam_setup_done.F index f33ac96f1e..0684fde70b 100755 --- a/lib/meam/meam_setup_done.F +++ b/lib/meam/meam_setup_done.F @@ -438,9 +438,17 @@ c use precomputed values rho0_2 = rho0_meam(b)*Z2*G2 endif Gam1 = (t11av*rho11+t21av*rho21+t31av*rho31) - Gam1 = Gam1/(rho01*rho01) + if (rho01 < 1.0d-14) then + Gam1 = 0.0d0 + else + Gam1 = Gam1/(rho01*rho01) + endif Gam2 = (t12av*rho12+t22av*rho22+t32av*rho32) - Gam2 = Gam2/(rho02*rho02) + if (rho02 < 1.0d-14) then + Gam2 = 0.0d0 + else + Gam2 = Gam2/(rho02*rho02) + endif call G_gam(Gam1,ibar_meam(a),gsmooth_factor,G1,errorflag) call G_gam(Gam2,ibar_meam(b),gsmooth_factor,G2,errorflag) if (mix_ref_t.eq.1) then diff --git a/src/BODY/compute_body_local.h b/src/BODY/compute_body_local.h index 5e9c036ff2..e2ff9a38bd 100644 --- a/src/BODY/compute_body_local.h +++ b/src/BODY/compute_body_local.h @@ -37,8 +37,6 @@ class ComputeBodyLocal : public Compute { int *which,*index; int nmax; - double *vector; - double **array; class AtomVecBody *avec; class Body *bptr; diff --git a/src/RIGID/compute_rigid_local.h b/src/RIGID/compute_rigid_local.h index 2e54a19ab5..d7d545d1fd 100644 --- a/src/RIGID/compute_rigid_local.h +++ b/src/RIGID/compute_rigid_local.h @@ -41,8 +41,6 @@ class ComputeRigidLocal : public Compute { class FixRigidSmall *fixrigid; int nmax; - double *vector; - double **array; int compute_rigid(int); void reallocate(int); diff --git a/src/USER-REAXC/compute_spec_atom.h b/src/USER-REAXC/compute_spec_atom.h index 107a2bd39f..4d5cb86d71 100644 --- a/src/USER-REAXC/compute_spec_atom.h +++ b/src/USER-REAXC/compute_spec_atom.h @@ -36,8 +36,6 @@ class ComputeSpecAtom : public Compute { private: int nvalues; int nmax; - double *vector; - double **array; double *buf; double *vbuf; diff --git a/src/atom.cpp b/src/atom.cpp index a6463259fd..86b1dea3d6 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1589,6 +1589,7 @@ void Atom::add_molecule(int narg, char **arg) int Atom::find_molecule(char *id) { + if(id == NULL) return -1; int imol; for (imol = 0; imol < nmolecule; imol++) if (strcmp(id,molecules[imol]->id) == 0) return imol; @@ -1913,6 +1914,8 @@ void Atom::add_callback(int flag) void Atom::delete_callback(const char *id, int flag) { + if(id==NULL) return; + int ifix; for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(id,modify->fix[ifix]->id) == 0) break; @@ -1968,6 +1971,8 @@ void Atom::update_callback(int ifix) int Atom::find_custom(const char *name, int &flag) { + if(name == NULL) return -1; + for (int i = 0; i < nivector; i++) if (iname[i] && strcmp(iname[i],name) == 0) { flag = 0; diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index 2ea78311a2..c9d4c00a67 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -33,8 +33,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), - vector(NULL), array(NULL) + Compute(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal compute angle/local command"); diff --git a/src/compute_angle_local.h b/src/compute_angle_local.h index c3248b242a..cf5d2fbe37 100644 --- a/src/compute_angle_local.h +++ b/src/compute_angle_local.h @@ -37,8 +37,6 @@ class ComputeAngleLocal : public Compute { int ncount; int nmax; - double *vector; - double **array; int compute_angles(int); void reallocate(int); diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index f7917acd2b..6fb1b689b6 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -34,7 +34,7 @@ enum{DIST,ENG,FORCE}; ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vector(NULL), array(NULL) + bstyle(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute bond/local command"); diff --git a/src/compute_bond_local.h b/src/compute_bond_local.h index a6639c2118..7d04515007 100644 --- a/src/compute_bond_local.h +++ b/src/compute_bond_local.h @@ -39,8 +39,6 @@ class ComputeBondLocal : public Compute { int singleflag; int nmax; - double *vector; - double **array; int compute_bonds(int); void reallocate(int); diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index 7b578611f0..fafcf7aee3 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -57,9 +57,10 @@ ComputeChunkAtom *ComputeChunkAtom::cptr; ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL), chunk(NULL), ichunk(NULL), exclude(NULL), - chunk_volume_vec(NULL), coord(NULL), chunkID(NULL), idregion(NULL), cfvid(NULL), - hash(NULL), varatom(NULL) + chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL), + cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL), + varatom(NULL), id_fix(NULL), fixstore(NULL), lockfix(NULL), chunk(NULL), + exclude(NULL), hash(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command"); diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 024a95d9d1..9680921e5f 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -279,7 +279,7 @@ void ComputeCNAAtom::compute_peratom() for (n = 0; n < ncommon; n++) bonds[n] = 0; nbonds = 0; - for (jj = 0; jj < ncommon; jj++) { + for (jj = 0; jj < ncommon-1; jj++) { j = common[jj]; xtmp = x[j][0]; ytmp = x[j][1]; diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index f50f49fa11..d8fc1b792c 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -34,8 +34,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), - vector(NULL), array(NULL) + Compute(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command"); diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h index 095ed68df3..cc4c16ca79 100644 --- a/src/compute_dihedral_local.h +++ b/src/compute_dihedral_local.h @@ -37,8 +37,6 @@ class ComputeDihedralLocal : public Compute { int ncount; int nmax; - double *vector; - double **array; int compute_dihedrals(int); void reallocate(int); diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 03a56b2bc4..9b9e165699 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL), displace(NULL) + displace(NULL), id_fix(NULL) { if (narg != 3) error->all(FLERR,"Illegal compute displace/atom command"); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index b9d69dc5b8..05a0cb4291 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -35,8 +35,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), - vector(NULL), array(NULL) + Compute(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal compute improper/local command"); diff --git a/src/compute_improper_local.h b/src/compute_improper_local.h index 9a3905e057..57f6b9dcf9 100644 --- a/src/compute_improper_local.h +++ b/src/compute_improper_local.h @@ -37,8 +37,6 @@ class ComputeImproperLocal : public Compute { int ncount; int nmax; - double *vector; - double **array; int compute_impropers(int); void reallocate(int); diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 50f7db7aa7..602888af8f 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -27,8 +27,8 @@ using namespace LAMMPS_NS; ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - angmom(NULL), angmomall(NULL) + idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(NULL), + inertia(NULL),inertiaall(NULL),angmom(NULL),angmomall(NULL),omega(NULL) { if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command"); @@ -64,6 +64,9 @@ ComputeOmegaChunk::~ComputeOmegaChunk() memory->destroy(comall); memory->destroy(angmom); memory->destroy(angmomall); + memory->destroy(inertia); + memory->destroy(inertiaall); + memory->destroy(omega); } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index 6ba4b75728..01a317f4a4 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -37,7 +37,7 @@ enum{TYPE,RADIUS}; ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pindex(NULL), vector(NULL), array(NULL) + pstyle(NULL), pindex(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute pair/local command"); diff --git a/src/compute_pair_local.h b/src/compute_pair_local.h index d6c2a12f22..2e01cba3ac 100644 --- a/src/compute_pair_local.h +++ b/src/compute_pair_local.h @@ -41,8 +41,6 @@ class ComputePairLocal : public Compute { int singleflag; int nmax; - double *vector; - double **array; class NeighList *list; diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 2ce10fdb68..5d454fef84 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - index(NULL), vector(NULL), array(NULL), pack_choice(NULL) + index(NULL), pack_choice(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute property/atom command"); diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h index 67fe83eeab..a81f39f6a9 100644 --- a/src/compute_property_atom.h +++ b/src/compute_property_atom.h @@ -36,8 +36,6 @@ class ComputePropertyAtom : public Compute { int nvalues; int nmax; int *index; - double *vector; - double **array; double *buf; class AtomVecEllipsoid *avec_ellipsoid; class AtomVecLine *avec_line; diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index b9472cb45b..d39f8825e3 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -35,7 +35,7 @@ enum{TYPE,RADIUS}; ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vector(NULL), array(NULL), indices(NULL), pack_choice(NULL) + indices(NULL), pack_choice(NULL) { if (narg < 4) error->all(FLERR,"Illegal compute property/local command"); diff --git a/src/compute_property_local.h b/src/compute_property_local.h index 9262bf163f..fb2c5d2d18 100644 --- a/src/compute_property_local.h +++ b/src/compute_property_local.h @@ -37,8 +37,6 @@ class ComputePropertyLocal : public Compute { int nvalues,kindflag,cutstyle; int nmax; - double *vector; - double **array; double *buf; class NeighList *list; diff --git a/src/create_box.cpp b/src/create_box.cpp index 94a11c1af8..c7fd98b2b2 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -158,7 +158,7 @@ void CreateBox::command(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); - atom->maxspecial = force->inumeric(FLERR,arg[iarg+1]); + force->special_extra = force->inumeric(FLERR,arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal create_box command"); } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 6c0951597f..0223636a77 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -40,7 +40,14 @@ enum{ONE,RUNNING,WINDOW}; /* ---------------------------------------------------------------------- */ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) + Fix(lmp, narg, arg), + nvalues(0), nrepeat(0), + which(NULL), argindex(NULL), value2index(NULL), ids(NULL), + fp(NULL), idchunk(NULL), varatom(NULL), + count_one(NULL), count_many(NULL), count_sum(NULL), + values_one(NULL), values_many(NULL), values_sum(NULL), + count_total(NULL), count_list(NULL), + values_total(NULL), values_list(NULL) { if (narg < 7) error->all(FLERR,"Illegal fix ave/chunk command"); @@ -72,7 +79,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : argindex = new int[nargnew]; ids = new char*[nargnew]; value2index = new int[nargnew]; - nvalues = 0; int iarg = 0; while (iarg < nargnew) { @@ -149,7 +155,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : normflag = ALL; scaleflag = ATOM; ave = ONE; - fp = NULL; nwindow = 0; biasflag = 0; id_bias = NULL; @@ -433,7 +438,6 @@ FixAveChunk::~FixAveChunk() if (fp && me == 0) fclose(fp); memory->destroy(varatom); - memory->destroy(count_one); memory->destroy(count_many); memory->destroy(count_sum); @@ -457,6 +461,24 @@ FixAveChunk::~FixAveChunk() } delete [] idchunk; + which = NULL; + argindex = NULL; + ids = NULL; + value2index = NULL; + fp = NULL; + varatom = NULL; + count_one = NULL; + count_many = NULL; + count_sum = NULL; + count_total = NULL; + count_list = NULL; + values_one = NULL; + values_many = NULL; + values_sum = NULL; + values_total = NULL; + values_list = NULL; + idchunk = NULL; + cchunk = NULL; } /* ---------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index 5c37aa5c56..219c233f2b 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -911,6 +911,7 @@ void Modify::delete_fix(const char *id) int Modify::find_fix(const char *id) { + if(id==NULL) return -1; int ifix; for (ifix = 0; ifix < nfix; ifix++) if (strcmp(id,fix[ifix]->id) == 0) break; @@ -1040,6 +1041,7 @@ void Modify::delete_compute(const char *id) int Modify::find_compute(const char *id) { + if(id==NULL) return -1; int icompute; for (icompute = 0; icompute < ncompute; icompute++) if (strcmp(id,compute[icompute]->id) == 0) break; diff --git a/src/variable.cpp b/src/variable.cpp index 05c55ec7c6..63fcf1dfda 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -710,6 +710,7 @@ int Variable::next(int narg, char **arg) int Variable::find(char *name) { + if(name==NULL) return -1; for (int i = 0; i < nvar; i++) if (strcmp(name,names[i]) == 0) return i; return -1;