whitespace fixes
This commit is contained in:
@ -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]);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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
|
||||
|
||||
18
src/atom.cpp
18
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");
|
||||
}
|
||||
|
||||
|
||||
@ -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 &);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user