From adc04f87f67304e739664a27e4d5f050f0155253 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 May 2020 08:24:24 -0400 Subject: [PATCH 1/3] whitespace fixes --- src/DIPOLE/atom_vec_dipole.cpp | 2 +- src/GRANULAR/fix_pour.cpp | 2 +- src/MOLECULE/atom_vec_angle.cpp | 4 ++-- src/MOLECULE/atom_vec_bond.cpp | 2 +- src/MOLECULE/atom_vec_bond.h | 2 +- src/MOLECULE/atom_vec_full.cpp | 10 +++++----- src/MOLECULE/atom_vec_molecular.cpp | 10 +++++----- src/PERI/atom_vec_peri.cpp | 2 +- src/SPIN/atom_vec_spin.cpp | 2 +- src/USER-AWPMD/atom_vec_wavepacket.cpp | 4 ++-- src/USER-SMD/atom_vec_smd.cpp | 22 +++++++++++----------- src/atom.cpp | 18 +++++++++--------- src/atom.h | 4 ++-- src/atom_vec.cpp | 26 +++++++++++++------------- src/atom_vec.h | 2 +- src/atom_vec_body.cpp | 8 ++++---- src/atom_vec_ellipsoid.cpp | 4 ++-- src/atom_vec_hybrid.cpp | 14 +++++++------- src/atom_vec_line.cpp | 4 ++-- src/atom_vec_sphere.cpp | 10 +++++----- src/atom_vec_tri.cpp | 4 ++-- src/replicate.cpp | 12 ++++++------ src/verlet.cpp | 2 +- 23 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index 074a59d5a1..b6895be301 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -72,6 +72,6 @@ void AtomVecDipole::grow_pointers() void AtomVecDipole::data_atom_post(int ilocal) { double *mu_one = mu[ilocal]; - mu_one[3] = + mu_one[3] = sqrt(mu_one[0]*mu_one[0] + mu_one[1]*mu_one[1] + mu_one[2]*mu_one[2]); } diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index b8db9fb8e6..73b42b9653 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -320,7 +320,7 @@ void FixPour::init() error->all(FLERR,"No fix gravity defined for fix pour"); int varflag = ((FixGravity *) modify->fix[ifix])->varflag; - if (varflag != CONSTANT) + if (varflag != CONSTANT) error->all(FLERR,"Fix gravity for fix pour must be constant"); double xgrav = ((FixGravity *) modify->fix[ifix])->xgrav; diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index f3ebe3258b..1e00a73617 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -31,7 +31,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) + fields_grow = (char *) "molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3 nspecial special"; fields_copy = (char *) @@ -45,7 +45,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) fields_exchange = (char *) "molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3 nspecial special"; - fields_restart = (char *) + fields_restart = (char *) "molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3"; fields_create = (char *) "molecule num_bond num_angle nspecial"; diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 64a52fa80a..2fa445c8ee 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -31,7 +31,7 @@ AtomVecBond::AtomVecBond(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) + fields_grow = (char *) "molecule num_bond bond_type bond_atom nspecial special"; fields_copy = (char *) "molecule num_bond bond_type bond_atom nspecial special"; diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h index c938655127..403167ac11 100644 --- a/src/MOLECULE/atom_vec_bond.h +++ b/src/MOLECULE/atom_vec_bond.h @@ -36,7 +36,7 @@ class AtomVecBond : public AtomVec { void data_atom_post(int); private: - int *num_bond; + int *num_bond; int **bond_type; int **nspecial; diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 89afae5005..866cf796c9 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -31,7 +31,7 @@ AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) + fields_grow = (char *) "q molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3 " "num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 " @@ -60,14 +60,14 @@ AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) "num_improper improper_type improper_atom1 improper_atom2 " "improper_atom3 improper_atom4 " "nspecial special"; - fields_restart = (char *) + fields_restart = (char *) "q molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3 " "num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 " "dihedral_atom3 dihedral_atom4 " "num_improper improper_type improper_atom1 improper_atom2 " "improper_atom3 improper_atom4"; - fields_create = (char *) + fields_create = (char *) "q molecule num_bond num_angle num_dihedral num_improper nspecial"; fields_data_atom = (char *) "id molecule type q x"; fields_data_vel = (char *) "id v"; @@ -194,13 +194,13 @@ void AtomVecFull::pack_restart_post(int ilocal) if (any_dihedral_negative) { for (int m = 0; m < num_dihedral[ilocal]; m++) - if (dihedral_negative[m]) + if (dihedral_negative[m]) dihedral_type[ilocal][m] = -dihedral_type[ilocal][m]; } if (any_improper_negative) { for (int m = 0; m < num_improper[ilocal]; m++) - if (improper_negative[m]) + if (improper_negative[m]) improper_type[ilocal][m] = -improper_type[ilocal][m]; } } diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index c2b71468c0..e90bec5108 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -31,7 +31,7 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) + fields_grow = (char *) "molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3 " "num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 " @@ -60,14 +60,14 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) "num_improper improper_type improper_atom1 improper_atom2 " "improper_atom3 improper_atom4 " "nspecial special"; - fields_restart = (char *) + fields_restart = (char *) "molecule num_bond bond_type bond_atom " "num_angle angle_type angle_atom1 angle_atom2 angle_atom3 " "num_dihedral dihedral_type dihedral_atom1 dihedral_atom2 " "dihedral_atom3 dihedral_atom4 " "num_improper improper_type improper_atom1 improper_atom2 " "improper_atom3 improper_atom4"; - fields_create = (char *) + fields_create = (char *) "molecule num_bond num_angle num_dihedral num_improper nspecial"; fields_data_atom = (char *) "id molecule type x"; fields_data_vel = (char *) "id v"; @@ -194,13 +194,13 @@ void AtomVecMolecular::pack_restart_post(int ilocal) if (any_dihedral_negative) { for (int m = 0; m < num_dihedral[ilocal]; m++) - if (dihedral_negative[m]) + if (dihedral_negative[m]) dihedral_type[ilocal][m] = -dihedral_type[ilocal][m]; } if (any_improper_negative) { for (int m = 0; m < num_improper[ilocal]; m++) - if (improper_negative[m]) + if (improper_negative[m]) improper_type[ilocal][m] = -improper_type[ilocal][m]; } } diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index 46d03c35eb..093878d4cf 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -108,7 +108,7 @@ void AtomVecPeri::data_atom_post(int ilocal) x0[ilocal][1] = x[ilocal][1]; x0[ilocal][2] = x[ilocal][2]; - if (rmass[ilocal] <= 0.0) + if (rmass[ilocal] <= 0.0) error->one(FLERR,"Invalid mass in Atoms section of data file"); } diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index 1e745fd0c1..2f7f3f7655 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -94,7 +94,7 @@ void AtomVecSpin::force_clear(int n, size_t nbytes) void AtomVecSpin::data_atom_post(int ilocal) { double *sp_one = sp[ilocal]; - double norm = + double norm = 1.0/sqrt(sp_one[0]*sp_one[0] + sp_one[1]*sp_one[1] + sp_one[2]*sp_one[2]); sp_one[0] *= norm; sp_one[1] *= norm; diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp index c71a3cb6c2..0d11e983ad 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.cpp +++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp @@ -35,7 +35,7 @@ AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp) : AtomVec(lmp) atom->electron_flag = 1; // compatible with eff atom->q_flag = atom->spin_flag = atom->eradius_flag = atom->ervel_flag = atom->erforce_flag = 1; - atom->cs_flag = atom->csforce_flag = + atom->cs_flag = atom->csforce_flag = atom->vforce_flag = atom->ervelforce_flag = atom->etag_flag = 1; // strings with peratom variables to include in each AtomVec method @@ -43,7 +43,7 @@ AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) + fields_grow = (char *) "q spin eradius ervel erforce cs csforce " "vforce ervelforce etag"; fields_copy = (char *) "q spin eradius ervel cs etag"; diff --git a/src/USER-SMD/atom_vec_smd.cpp b/src/USER-SMD/atom_vec_smd.cpp index 8e51f661ea..670783a3d7 100644 --- a/src/USER-SMD/atom_vec_smd.cpp +++ b/src/USER-SMD/atom_vec_smd.cpp @@ -34,7 +34,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -AtomVecSMD::AtomVecSMD(LAMMPS *lmp) : AtomVec(lmp) +AtomVecSMD::AtomVecSMD(LAMMPS *lmp) : AtomVec(lmp) { molecular = 0; mass_type = 1; @@ -61,35 +61,35 @@ AtomVecSMD::AtomVecSMD(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = (char *) + fields_grow = (char *) "esph desph vfrac rmass x0 radius contact_radius molecule " "smd_data_9 vest smd_stress " "eff_plastic_strain eff_plastic_strain_rate damage"; - fields_copy = (char *) + fields_copy = (char *) "esph vfrac rmass x0 radius contact_radius molecule " "eff_plastic_strain eff_plastic_strain_rate vest " "smd_data_9 smd_stress damage"; fields_comm = (char *) "radius vfrac vest esph"; fields_comm_vel = (char *) "radius vfrac vest esph"; fields_reverse = (char *) "desph"; - fields_border = (char *) + fields_border = (char *) "x0 molecule radius rmass vfrac contact_radius esph " "eff_plastic_strain smd_data_9 smd_stress"; - fields_border_vel = (char *) + fields_border_vel = (char *) "x0 molecule radius rmass vfrac contact_radius esph " "eff_plastic_strain smd_data_9 smd_stress vest"; - fields_exchange = (char *) + fields_exchange = (char *) "x0 molecule radius rmass vfrac contact_radius esph " "eff_plastic_strain eff_plastic_strain_rate smd_data_9 smd_stress " "vest damage"; - fields_restart = (char *) + fields_restart = (char *) "x0 molecule radius rmass vfrac contact_radius esph " "eff_plastic_strain eff_plastic_strain_rate smd_data_9 smd_stress " "vest damage"; - fields_create = (char *) + fields_create = (char *) "x0 vest vfrac rmass radius contact_radius molecule esph " "eff_plastic_strain eff_plastic_strain_rate smd_data_9 smd_stress damage"; - fields_data_atom = (char *) + fields_data_atom = (char *) "id type molecule vfrac rmass radius contact_radius x0 x"; fields_data_vel = (char *) "id v"; @@ -130,7 +130,7 @@ void AtomVecSMD::grow_pointers() NOTE: does f need to be re-cleared? ------------------------------------------------------------------------- */ -void AtomVecSMD::force_clear(int n, size_t nbytes) +void AtomVecSMD::force_clear(int n, size_t nbytes) { memset(&desph[n],0,nbytes); memset(&f[n][0],0,3*nbytes); @@ -151,7 +151,7 @@ void AtomVecSMD::create_atom_post(int ilocal) radius[ilocal] = 0.5; contact_radius[ilocal] = 0.5; molecule[ilocal] = 1; - + smd_data_9[ilocal][0] = 1.0; // xx smd_data_9[ilocal][4] = 1.0; // yy smd_data_9[ilocal][8] = 1.0; // zz diff --git a/src/atom.cpp b/src/atom.cpp index 1e86a778a4..bbdecc5b98 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -139,7 +139,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) etag = NULL; // USER-DPD package - + uCond = uMech = uChem = uCG = uCGnew = NULL; duChem = dpdTheta = NULL; @@ -158,7 +158,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) damage = NULL; // USER-SPH package - + rho = drho = esph = desph = cv = NULL; vest = NULL; @@ -569,17 +569,17 @@ void Atom::peratom_create() /* ---------------------------------------------------------------------- add info for a single per-atom vector/array to PerAtom data struct - cols = 0: per-atom vector + cols = 0: per-atom vector cols = N: static per-atom array with N columns use add_peratom_vary() when column count varies per atom ------------------------------------------------------------------------- */ -void Atom::add_peratom(const char *name, void *address, +void Atom::add_peratom(const char *name, void *address, int datatype, int cols, int threadflag) { if (nperatom == maxperatom) { maxperatom += DELTA_PERATOM; - peratom = (PerAtom *) + peratom = (PerAtom *) memory->srealloc(peratom,maxperatom*sizeof(PerAtom),"atom:peratom"); } @@ -606,7 +606,7 @@ void Atom::add_peratom_change_columns(const char *name, int cols) int i; for (int i = 0; i < nperatom; i++) if (strcmp(name,peratom[i].name) == 0) peratom[i].cols = cols; - if (i == nperatom) + if (i == nperatom) error->all(FLERR,"Could not find name of peratom array for column change"); } @@ -616,18 +616,18 @@ void Atom::add_peratom_change_columns(const char *name, int cols) for collength = 0: length = address of peratom vector with column count per atom e.g. num_bond - for collength = N: + for collength = N: length = address of peratom array with column count per atom collength = index of column (1 to N) in peratom array with count e.g. nspecial ------------------------------------------------------------------------- */ -void Atom::add_peratom_vary(const char *name, void *address, +void Atom::add_peratom_vary(const char *name, void *address, int datatype, int *cols, void *length, int collength) { if (nperatom == maxperatom) { maxperatom += DELTA_PERATOM; - peratom = (PerAtom *) + peratom = (PerAtom *) memory->srealloc(peratom,maxperatom*sizeof(PerAtom),"atom:peratom"); } diff --git a/src/atom.h b/src/atom.h index 3a7335b796..c55821eea2 100644 --- a/src/atom.h +++ b/src/atom.h @@ -38,7 +38,7 @@ class Atom : protected Pointers { bigint nlines; // number of lines bigint ntris; // number of triangles bigint nbodies; // number of bodies - + // system properties bigint nbonds,nangles,ndihedrals,nimpropers; @@ -260,7 +260,7 @@ class Atom : protected Pointers { void peratom_create(); void add_peratom(const char *, void *, int, int, int threadflag=0); void add_peratom_change_columns(const char *, int); - void add_peratom_vary(const char *, void *, int, int *, + void add_peratom_vary(const char *, void *, int, int *, void *, int collength=0); void create_avec(const char *, int, char **, int); virtual class AtomVec *new_avec(const char *, int, int &); diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 5799038667..1ce4bc9e42 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -280,7 +280,7 @@ void AtomVec::copy(int i, int j, int delflag) double **array = *((double ***) pdata); for (m = 0; m < cols; m++) array[j][m] = array[i][m]; - } else { + } else { double **array = *((double ***) pdata); collength = mcopy.collength[n]; plength = mcopy.plength[n]; @@ -913,7 +913,7 @@ int AtomVec::pack_border(int n, int *list, double *buf, int pbc_flag, int *pbc) /* ---------------------------------------------------------------------- */ -int AtomVec::pack_border_vel(int n, int *list, double *buf, +int AtomVec::pack_border_vel(int n, int *list, double *buf, int pbc_flag, int *pbc) { int i,j,m,mm,nn,datatype,cols; @@ -1207,7 +1207,7 @@ int AtomVec::pack_exchange(int i, double *buf) buf[m++] = ubuf(type[i]).d; buf[m++] = ubuf(mask[i]).d; buf[m++] = ubuf(image[i]).d; - + if (nexchange) { for (nn = 0; nn < nexchange; nn++) { pdata = mexchange.pdata[nn]; @@ -1252,7 +1252,7 @@ int AtomVec::pack_exchange(int i, double *buf) bigint *vec = *((bigint **) pdata); buf[m++] = ubuf(vec[i]).d; } else if (cols > 0) { - bigint **array = *((bigint ***) pdata); + bigint **array = *((bigint ***) pdata); for (mm = 0; mm < cols; mm++) buf[m++] = ubuf(array[i][mm]).d; } else { @@ -2438,7 +2438,7 @@ void AtomVec::setup_fields() size_data_atom = 0; for (n = 0; n < ndata_atom; n++) { cols = mdata_atom.cols[n]; - if (strcmp(atom->peratom[mdata_atom.index[n]].name,"x") == 0) + if (strcmp(atom->peratom[mdata_atom.index[n]].name,"x") == 0) xcol_data = size_data_atom + 1; if (cols == 0) size_data_atom++; else size_data_atom += cols; @@ -2471,7 +2471,7 @@ int AtomVec::process_fields(char *str, const char *default_str, Method *method) int ndef = tokenize((char *) default_str,defwords,copy2); // process fields one by one, add to index vector - + Atom::PerAtom *peratom = atom->peratom; int nperatom = atom->nperatom; @@ -2479,7 +2479,7 @@ int AtomVec::process_fields(char *str, const char *default_str, Method *method) int match; for (int i = 0; i < nfield; i++) { - + // find field in master Atom::peratom list for (match = 0; match < nperatom; match++) @@ -2495,18 +2495,18 @@ int AtomVec::process_fields(char *str, const char *default_str, Method *method) for (match = 0; match < i; match++) if (index[i] == index[match]) { - char str[128]; - sprintf(str,"Peratom field %s is repeated",words[i]); - error->all(FLERR,str); + char str[128]; + sprintf(str,"Peratom field %s is repeated",words[i]); + error->all(FLERR,str); } // error if field is in default str for (match = 0; match < ndef; match++) if (strcmp(words[i],defwords[match]) == 0) { - char str[128]; - sprintf(str,"Peratom field %s is a default",words[i]); - error->all(FLERR,str); + char str[128]; + sprintf(str,"Peratom field %s is a default",words[i]); + error->all(FLERR,str); } } diff --git a/src/atom_vec.h b/src/atom_vec.h index b54e827995..f3a31caad3 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -74,7 +74,7 @@ class AtomVec : protected Pointers { virtual void force_clear(int, size_t) {} virtual bigint roundup(bigint); - + virtual void grow(int); virtual void grow_pointers() {} virtual void copy(int, int, int); diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index c262f1a5b6..89fe1681cb 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -282,7 +282,7 @@ int AtomVecBody::pack_border_bonus(int n, int *list, double *buf) buf[m++] = ubuf(bonus[body[j]].ndouble).d; m += bptr->pack_border_body(&bonus[body[j]],&buf[m]); } - } + } return m; } @@ -540,7 +540,7 @@ void AtomVecBody::data_atom_post(int ilocal) void AtomVecBody::data_body(int m, int ninteger, int ndouble, int *ivalues, double *dvalues) { - if (body[m]) + if (body[m]) error->one(FLERR,"Assigning body parameters to non-body atom"); if (nlocal_bonus == nmax_bonus) grow_bonus(); bonus[nlocal_bonus].ilocal = m; @@ -572,7 +572,7 @@ bigint AtomVecBody::memory_usage_bonus() ------------------------------------------------------------------------- */ void AtomVecBody::pack_data_pre(int ilocal) -{ +{ body_flag = body[ilocal]; if (body_flag < 0) body[ilocal] = 0; @@ -584,7 +584,7 @@ void AtomVecBody::pack_data_pre(int ilocal) ------------------------------------------------------------------------- */ void AtomVecBody::pack_data_post(int ilocal) -{ +{ body[ilocal] = body_flag; } diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index 2537fe2538..4d83565c7a 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -452,7 +452,7 @@ void AtomVecEllipsoid::data_atom_post(int ilocal) ------------------------------------------------------------------------- */ void AtomVecEllipsoid::pack_data_pre(int ilocal) -{ +{ double *shape; ellipsoid_flag = atom->ellipsoid[ilocal]; @@ -472,7 +472,7 @@ void AtomVecEllipsoid::pack_data_pre(int ilocal) ------------------------------------------------------------------------- */ void AtomVecEllipsoid::pack_data_post(int ilocal) -{ +{ ellipsoid[ilocal] = ellipsoid_flag; rmass[ilocal] = rmass_one; } diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 965bfe8543..7f47f64d91 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp) : AtomVec(lmp) +AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp) : AtomVec(lmp) { nstyles = 0; styles = NULL; @@ -325,7 +325,7 @@ void AtomVecHybrid::data_atom_post(int ilocal) ------------------------------------------------------------------------- */ void AtomVecHybrid::pack_data_pre(int ilocal) -{ +{ for (int k = 0; k < nstyles; k++) styles[k]->pack_data_pre(ilocal); } @@ -335,7 +335,7 @@ void AtomVecHybrid::pack_data_pre(int ilocal) ------------------------------------------------------------------------- */ void AtomVecHybrid::pack_data_post(int ilocal) -{ +{ for (int k = 0; k < nstyles; k++) styles[k]->pack_data_post(ilocal); } @@ -494,7 +494,7 @@ void AtomVecHybrid::pack_property_atom(int multiindex, double *buf, so caller can check for problematic fields, call will free it ------------------------------------------------------------------------- */ -char *AtomVecHybrid::merge_fields(int inum, char *root, +char *AtomVecHybrid::merge_fields(int inum, char *root, int concat_flag, char *&concat_str) { // create concatenated string of length size from root + all substyles @@ -517,7 +517,7 @@ char *AtomVecHybrid::merge_fields(int inum, char *root, char **words; int nwords = tokenize(concat,words,copystr); int *unique = new int[nwords]; - + for (int i = 0; i < nwords; i++) { unique[i] = 1; for (int j = 0; j < i; j++) @@ -528,7 +528,7 @@ char *AtomVecHybrid::merge_fields(int inum, char *root, char *dedup = new char[size]; dedup[0] = '\0'; - + for (int i = 0; i < nwords; i++) { if (!unique[i]) continue; strcat(dedup,words[i]); @@ -541,7 +541,7 @@ char *AtomVecHybrid::merge_fields(int inum, char *root, else delete [] concat; // clean up - + delete [] copystr; delete [] words; delete [] unique; diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index e178d1f78a..88d02161d5 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -431,7 +431,7 @@ void AtomVecLine::data_atom_post(int ilocal) ------------------------------------------------------------------------- */ void AtomVecLine::pack_data_pre(int ilocal) -{ +{ line_flag = line[ilocal]; rmass_one = rmass[ilocal]; @@ -449,7 +449,7 @@ void AtomVecLine::pack_data_pre(int ilocal) ------------------------------------------------------------------------- */ void AtomVecLine::pack_data_post(int ilocal) -{ +{ line[ilocal] = line_flag; rmass[ilocal] = rmass_one; } diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index 64a198c94d..e1d92c7a8d 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -61,7 +61,7 @@ AtomVecSphere::AtomVecSphere(LAMMPS *lmp) : AtomVec(lmp) void AtomVecSphere::process_args(int narg, char **arg) { - if (narg != 0 && narg != 1) + if (narg != 0 && narg != 1) error->all(FLERR,"Illegal atom_style sphere command"); radvary = 0; @@ -130,10 +130,10 @@ void AtomVecSphere::data_atom_post(int ilocal) { radius_one = 0.5 * atom->radius[ilocal]; radius[ilocal] = radius_one; - if (radius_one > 0.0) + if (radius_one > 0.0) rmass[ilocal] *= 4.0*MY_PI/3.0 * radius_one*radius_one*radius_one; - if (rmass[ilocal] <= 0.0) + if (rmass[ilocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); } @@ -147,8 +147,8 @@ void AtomVecSphere::pack_data_pre(int ilocal) rmass_one = rmass[ilocal]; radius[ilocal] *= 2.0; - if (radius_one!= 0.0) - rmass[ilocal] = + if (radius_one!= 0.0) + rmass[ilocal] = rmass_one / (4.0*MY_PI/3.0 * radius_one*radius_one*radius_one); } diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index b130198075..d5ca2342e8 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -655,7 +655,7 @@ void AtomVecTri::data_atom_post(int ilocal) ------------------------------------------------------------------------- */ void AtomVecTri::pack_data_pre(int ilocal) -{ +{ tri_flag = tri[ilocal]; rmass_one = rmass[ilocal]; @@ -680,7 +680,7 @@ void AtomVecTri::pack_data_pre(int ilocal) ------------------------------------------------------------------------- */ void AtomVecTri::pack_data_post(int ilocal) -{ +{ tri[ilocal] = tri_flag; rmass[ilocal] = rmass_one; } diff --git a/src/replicate.cpp b/src/replicate.cpp index 75f6aa61f4..50842ddd0c 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -355,7 +355,7 @@ void Replicate::command(int narg, char **arg) int *disp_buf_rnk; memory->create(disp_buf_rnk, nprocs, "replicate:disp_buf_rnk"); disp_buf_rnk[0] = 0; - for (i = 1; i < nprocs; i++) + for (i = 1; i < nprocs; i++) disp_buf_rnk[i] = disp_buf_rnk[i-1] + size_buf_rnk[i-1]; // allgather buf_all @@ -370,16 +370,16 @@ void Replicate::command(int narg, char **arg) double _orig_lo[3], _orig_hi[3]; if (triclinic) { - _orig_lo[0] = domain->boxlo[0] + + _orig_lo[0] = domain->boxlo[0] + _imagelo[0] * old_xprd + _imagelo[1] * old_xy + _imagelo[2] * old_xz; - _orig_lo[1] = domain->boxlo[1] + + _orig_lo[1] = domain->boxlo[1] + _imagelo[1] * old_yprd + _imagelo[2] * old_yz; _orig_lo[2] = domain->boxlo[2] + _imagelo[2] * old_zprd; - _orig_hi[0] = domain->boxlo[0] + - (_imagehi[0]+1) * old_xprd + + _orig_hi[0] = domain->boxlo[0] + + (_imagehi[0]+1) * old_xprd + (_imagehi[1]+1) * old_xy + (_imagehi[2]+1) * old_xz; - _orig_hi[1] = domain->boxlo[1] + + _orig_hi[1] = domain->boxlo[1] + (_imagehi[1]+1) * old_yprd + (_imagehi[2]+1) * old_yz; _orig_hi[2] = domain->boxlo[2] + (_imagehi[2]+1) * old_zprd; } else { diff --git a/src/verlet.cpp b/src/verlet.cpp index fe9645618a..8cd6fe940d 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -109,7 +109,7 @@ void Verlet::setup(int flag) domain->pbc(); domain->reset_box(); comm->setup(); - if (neighbor->style) neighbor->setup_bins(); + if (neighbor->style) neighbor->setup_bins(); comm->exchange(); if (atom->sortfreq > 0) atom->sort(); comm->borders(); From 4930389ea41d0083edd2f8c06f8bed7a3f109f2f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 May 2020 08:38:36 -0400 Subject: [PATCH 2/3] propagate bugfix in fix omp to OpenMP pragma --- src/USER-OMP/fix_omp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index 53ad46bc28..d7216a4571 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -351,7 +351,7 @@ void FixOMP::pre_force(int) double *drho = atom->drho; #if defined(_OPENMP) -#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(f,torque,erforce,de,drho) +#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(f,torque,erforce,desph,drho) #endif { const int tid = get_tid(); From 6659946de16c91742ab039262e7ee12b169e2c8c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 May 2020 08:50:07 -0400 Subject: [PATCH 3/3] fix more warnins and 64-bit issues --- src/USER-SMD/atom_vec_smd.h | 2 +- src/atom_vec.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/USER-SMD/atom_vec_smd.h b/src/USER-SMD/atom_vec_smd.h index c4d66c0b64..055ad795c4 100644 --- a/src/USER-SMD/atom_vec_smd.h +++ b/src/USER-SMD/atom_vec_smd.h @@ -45,7 +45,7 @@ class AtomVecSMD : public AtomVec { void data_atom_post(int); private: - int *molecule; + tagint *molecule; double *esph,*desph,*vfrac,*rmass,*radius,*contact_radius; double *eff_plastic_strain,*eff_plastic_strain_rate,*damage; double **x0,**smd_data_9,**smd_stress,**vest; diff --git a/src/atom_vec.h b/src/atom_vec.h index f3a31caad3..eaff5bd6f8 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -115,7 +115,7 @@ class AtomVec : protected Pointers { virtual void pack_restart_post(int) {} virtual void unpack_restart_init(int) {} - virtual int size_restart_bonus() {} + virtual int size_restart_bonus() {return 0;} virtual int pack_restart_bonus(int, double *) {return 0;} virtual int unpack_restart_bonus(int, double *) {return 0;} @@ -149,7 +149,7 @@ class AtomVec : protected Pointers { virtual void pack_property_atom(int, double *, int, int) {} virtual bigint memory_usage(); - virtual bigint memory_usage_bonus() {} + virtual bigint memory_usage_bonus() {return 0;} protected: int nmax; // local copy of atom->nmax