Skip to content

Commit

Permalink
Merge pull request lammps#4054 from akohlmey/consolidate-sphere-omega…
Browse files Browse the repository at this point in the history
…-flag

Remove sphere_flag and replace with radius_flag and omega_flag as needed
  • Loading branch information
akohlmey authored Jan 26, 2024
2 parents 3941bae + 40782fe commit 7d53f8d
Show file tree
Hide file tree
Showing 40 changed files with 402 additions and 328 deletions.
548 changes: 315 additions & 233 deletions doc/src/atom_style.rst

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions doc/utils/sphinx-config/false_positives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ antisymmetry
anton
Antonelli
api
apolar
Apoorva
Appl
Appshaw
Expand Down Expand Up @@ -799,6 +800,7 @@ dlabel
dlambda
DLAMMPS
dll
dlm
dlopen
dm
dmax
Expand Down Expand Up @@ -1016,6 +1018,7 @@ Ercolessi
Erdmann
erf
erfc
erforce
Erhart
erorate
erose
Expand Down Expand Up @@ -2236,8 +2239,10 @@ Mohd
Mohles
mol
Mol
molatom
molfile
Molfile
molindex
MolPairStyle
moltemplate
momb
Expand Down Expand Up @@ -2570,6 +2575,7 @@ ns
Ns
Nsample
Nskip
nspecial
Nspecies
nsq
Nstart
Expand Down Expand Up @@ -3878,6 +3884,7 @@ versa
Verstraelen
ves
vflag
vfrac
vhi
vibrational
Vij
Expand Down
24 changes: 0 additions & 24 deletions purge-workflows.py

This file was deleted.

1 change: 0 additions & 1 deletion src/BPM/atom_vec_bpm_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ AtomVecBPMSphere::AtomVecBPMSphere(LAMMPS *_lmp) : AtomVec(_lmp)
radvary = 0;

atom->molecule_flag = 1;
atom->sphere_flag = 1;
atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = atom->quat_flag = 1;

// strings with peratom variables to include in each AtomVec method
Expand Down
2 changes: 1 addition & 1 deletion src/BPM/bond_bpm_rotational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ void BondBPMRotational::init_style()
{
BondBPM::init_style();

if (!atom->quat_flag || !atom->sphere_flag)
if (!atom->quat_flag || !atom->radius_flag || !atom->omega_flag)
error->all(FLERR, "Bond bpm/rotational requires atom style bpm/sphere");
if (comm->ghost_velocity == 0)
error->all(FLERR, "Bond bpm/rotational requires ghost atoms store velocity");
Expand Down
2 changes: 1 addition & 1 deletion src/BPM/fix_nve_bpm_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ FixNVEBPMSphere::FixNVEBPMSphere(LAMMPS *_lmp, int narg, char **arg) : FixNVE(_l

// error checks

if (!atom->quat_flag || !atom->sphere_flag)
if (!atom->quat_flag || !atom->radius_flag || !atom->omega_flag)
error->all(FLERR, "Fix nve/bpm/sphere requires atom style bpm/sphere");
}

Expand Down
1 change: 0 additions & 1 deletion src/BROWNIAN/fix_brownian_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ FixBrownianSphere::FixBrownianSphere(LAMMPS *lmp, int narg, char **arg) :

if (!gamma_t_flag || !gamma_r_flag) error->all(FLERR, "Illegal fix brownian/sphere command.");
if (!atom->mu_flag) error->all(FLERR, "Fix brownian/sphere requires atom attribute mu");
if (!atom->sphere_flag) error->all(FLERR, "Fix brownian/sphere requires atom style sphere");
}

/* ---------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion src/COLLOID/fix_wall_colloid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) : FixWall(lmp,

void FixWallColloid::init()
{
if (!atom->sphere_flag) error->all(FLERR, "Fix wall/colloid requires atom style sphere");
if (!atom->radius_flag) error->all(FLERR, "Fix wall/colloid requires atom attribute radius");

// ensure all particles in group are extended particles

Expand Down
2 changes: 1 addition & 1 deletion src/COLLOID/pair_brownian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ void PairBrownian::coeff(int narg, char **arg)

void PairBrownian::init_style()
{
if (!atom->sphere_flag) error->all(FLERR, "Pair brownian requires atom style sphere");
if (!atom->radius_flag) error->all(FLERR, "Pair brownian requires atom attribute radius");

// if newton off, forces between atoms ij will be double computed
// using different random numbers
Expand Down
4 changes: 2 additions & 2 deletions src/COLLOID/pair_brownian_poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ void PairBrownianPoly::init_style()
{
if (force->newton_pair == 1)
error->all(FLERR,"Pair brownian/poly requires newton pair off");
if (!atom->sphere_flag)
error->all(FLERR,"Pair brownian/poly requires atom style sphere");
if (!atom->radius_flag)
error->all(FLERR,"Pair brownian/poly requires atom attribute radius");

// ensure all particles are finite-size
// for pair hybrid, should limit test to types using the pair style
Expand Down
6 changes: 4 additions & 2 deletions src/COLLOID/pair_lubricate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,10 @@ void PairLubricate::coeff(int narg, char **arg)

void PairLubricate::init_style()
{
if (!atom->sphere_flag)
error->all(FLERR,"Pair lubricate requires atom style sphere");
if (!atom->omega_flag)
error->all(FLERR,"Pair lubricate requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR,"Pair lubricate requires atom attribute radius");
if (comm->ghost_velocity == 0)
error->all(FLERR,"Pair lubricate requires ghost atoms store velocity");

Expand Down
6 changes: 4 additions & 2 deletions src/COLLOID/pair_lubricateU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,8 +1760,10 @@ void PairLubricateU::coeff(int narg, char **arg)

void PairLubricateU::init_style()
{
if (!atom->sphere_flag)
error->all(FLERR,"Pair lubricateU requires atom style sphere");
if (!atom->omega_flag)
error->all(FLERR,"Pair lubricateU requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR,"Pair lubricateU requires atom attribute radius");
if (comm->ghost_velocity == 0)
error->all(FLERR,"Pair lubricateU requires ghost atoms store velocity");

Expand Down
13 changes: 7 additions & 6 deletions src/COLLOID/pair_lubricateU_poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,13 @@ void PairLubricateUPoly::settings(int narg, char **arg)
void PairLubricateUPoly::init_style()
{
if (force->newton_pair == 1)
error->all(FLERR,"Pair lubricateU/poly requires newton pair off");
error->all(FLERR, "Pair lubricateU/poly requires newton pair off");
if (comm->ghost_velocity == 0)
error->all(FLERR,
"Pair lubricateU/poly requires ghost atoms store velocity");
if (!atom->sphere_flag)
error->all(FLERR,"Pair lubricate/poly requires atom style sphere");
error->all(FLERR, "Pair lubricateU/poly requires ghost atoms store velocity");
if (!atom->omega_flag)
error->all(FLERR, "Pair lubricateU/poly requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR, "Pair lubricateU/poly requires atom attribute radius");

// ensure all particles are finite-size
// for pair hybrid, should limit test to types using the pair style
Expand All @@ -1136,7 +1137,7 @@ void PairLubricateUPoly::init_style()

for (int i = 0; i < nlocal; i++)
if (radius[i] == 0.0)
error->one(FLERR,"Pair lubricate/poly requires extended particles");
error->one(FLERR,"Pair lubricateU/poly requires extended particles");

// Set the isotropic constants depending on the volume fraction

Expand Down
13 changes: 7 additions & 6 deletions src/COLLOID/pair_lubricate_poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,13 @@ void PairLubricatePoly::compute(int eflag, int vflag)
void PairLubricatePoly::init_style()
{
if (force->newton_pair == 1)
error->all(FLERR,"Pair lubricate/poly requires newton pair off");
error->all(FLERR, "Pair lubricate/poly requires newton pair off");
if (comm->ghost_velocity == 0)
error->all(FLERR,
"Pair lubricate/poly requires ghost atoms store velocity");
if (!atom->sphere_flag)
error->all(FLERR,"Pair lubricate/poly requires atom style sphere");
error->all(FLERR, "Pair lubricate/poly requires ghost atoms store velocity");
if (!atom->omega_flag)
error->all(FLERR, "Pair lubricate/poly requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR, "Pair lubricate/poly requires atom attribute radius");

// ensure all particles are finite-size
// for pair hybrid, should limit test to types using the pair style
Expand All @@ -439,7 +440,7 @@ void PairLubricatePoly::init_style()

for (int i = 0; i < nlocal; i++)
if (radius[i] == 0.0)
error->one(FLERR,"Pair lubricate/poly requires extended particles");
error->one(FLERR,"Pair lubricate/poly requires only extended particles");

neighbor->add_request(this, NeighConst::REQ_FULL);

Expand Down
4 changes: 2 additions & 2 deletions src/COLLOID/pair_yukawa_colloid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ void PairYukawaColloid::compute(int eflag, int vflag)

void PairYukawaColloid::init_style()
{
if (!atom->sphere_flag)
error->all(FLERR,"Pair yukawa/colloid requires atom style sphere");
if (!atom->radius_flag)
error->all(FLERR,"Pair yukawa/colloid requires atom attribute radius");

neighbor->add_request(this);

Expand Down
2 changes: 1 addition & 1 deletion src/EXTRA-FIX/fix_viscous_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ FixViscousSphere::FixViscousSphere(LAMMPS *_lmp, int narg, char **arg) :
{
dynamic_group_allow = 1;

if (!atom->sphere_flag) error->all(FLERR, "Fix viscous/sphere requires atom style sphere");
if (!atom->omega_flag) error->all(FLERR, "Fix viscous/sphere requires atom attribute omega");

if (narg < 4) error->all(FLERR, "Illegal fix viscous/sphere command");

Expand Down
2 changes: 1 addition & 1 deletion src/GPU/pair_yukawa_colloid_gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void PairYukawaColloidGPU::compute(int eflag, int vflag)

void PairYukawaColloidGPU::init_style()
{
if (!atom->sphere_flag) error->all(FLERR, "Pair yukawa/colloid/gpu requires atom style sphere");
if (!atom->radius_flag) error->all(FLERR, "Pair style yukawa/colloid/gpu requires atom attribute radius");

// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;
Expand Down
2 changes: 1 addition & 1 deletion src/GRANULAR/compute_contact_atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) :

// error checks

if (!atom->sphere_flag) error->all(FLERR, "Compute contact/atom requires atom style sphere");
if (!atom->radius_flag) error->all(FLERR, "Compute contact/atom requires atom attribute radius");
}

/* ---------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion src/GRANULAR/fix_damping_cundall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ FixDampingCundall::FixDampingCundall(LAMMPS *_lmp, int narg, char **arg) :
{
dynamic_group_allow = 1;

if (!atom->sphere_flag) error->all(FLERR, "Fix damping/cundall requires atom style sphere");
if (!atom->omega_flag) error->all(FLERR, "Fix damping/cundall requires atom attribute omega");

if (narg < 5) utils::missing_cmd_args(FLERR, "fix damping/cundall", error);

Expand Down
4 changes: 2 additions & 2 deletions src/GRANULAR/fix_wall_gran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 4) utils::missing_cmd_args(FLERR,"fix wall/gran", error);

if (!atom->sphere_flag)
error->all(FLERR,"Fix wall/gran requires atom style sphere");
if (!atom->omega_flag) error->all(FLERR,"Fix wall/gran requires atom attribute omega");
if (!atom->radius_flag) error->all(FLERR,"Fix wall/gran requires atom attribute radius");

create_attribute = 1;

Expand Down
6 changes: 3 additions & 3 deletions src/GRANULAR/pair_gran_hooke_history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ void PairGranHookeHistory::init_style()

// error and warning checks

if (!atom->radius_flag || !atom->rmass_flag)
error->all(FLERR, "Pair granular requires atom attributes radius, rmass");
if (!atom->radius_flag || !atom->rmass_flag || !atom->omega_flag)
error->all(FLERR, "Pair gran/h* requires atom attributes radius, rmass, omega");
if (comm->ghost_velocity == 0)
error->all(FLERR, "Pair granular requires ghost atoms store velocity");
error->all(FLERR, "Pair gran/h* requires ghost atoms store velocity");

// need a granular neighbor list

Expand Down
4 changes: 2 additions & 2 deletions src/GRANULAR/pair_granular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ void PairGranular::init_style()
{
// error and warning checks

if (!atom->radius_flag || !atom->rmass_flag)
error->all(FLERR,"Pair granular requires atom attributes radius, rmass");
if (!atom->radius_flag || !atom->rmass_flag || !atom->omega_flag)
error->all(FLERR,"Pair granular requires atom attributes radius, rmass, omega");
if (comm->ghost_velocity == 0)
error->all(FLERR,"Pair granular requires ghost atoms store velocity");

Expand Down
4 changes: 2 additions & 2 deletions src/KOKKOS/fix_wall_gran_old.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ FixWallGranOld::FixWallGranOld(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 4) error->all(FLERR,"Illegal fix wall/gran command");

if (!atom->sphere_flag)
error->all(FLERR,"Fix wall/gran requires atom style sphere");
if (!atom->omega_flag) error->all(FLERR,"Fix {} requires atom attribute omega", style);
if (!atom->radius_flag) error->all(FLERR,"Fix {} requires atom attribute radius", style);

create_attribute = 1;
limit_damping = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/OPENMP/fix_nh_sphere_omp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ typedef struct { double x,y,z; } dbl3_t;
FixNHSphereOMP::FixNHSphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHOMP(lmp, narg, arg)
{
if (!atom->sphere_flag)
error->all(FLERR,"Fix nvt/nph/npt sphere requires atom style sphere");
if (!atom->omega_flag) error->all(FLERR,"Fix {} requires atom attribute omega", style);
if (!atom->radius_flag) error->all(FLERR,"Fix {} requires atom attribute radius", style);
}

/* ---------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion src/atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ void Atom::set_atomflag_defaults()
// identical list as 2nd customization in atom.h

labelmapflag = 0;
sphere_flag = ellipsoid_flag = line_flag = tri_flag = body_flag = 0;
ellipsoid_flag = line_flag = tri_flag = body_flag = 0;
quat_flag = 0;
peri_flag = electron_flag = 0;
wavepacket_flag = sph_flag = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/atom.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Atom : protected Pointers {
// 1 if variable is used, 0 if not

int labelmapflag, types_style;
int sphere_flag, ellipsoid_flag, line_flag, tri_flag, body_flag;
int ellipsoid_flag, line_flag, tri_flag, body_flag;
int peri_flag, electron_flag;
int wavepacket_flag, sph_flag;

Expand Down
1 change: 0 additions & 1 deletion src/atom_vec_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp)
atom->line_flag = 1;
atom->molecule_flag = atom->rmass_flag = 1;
atom->radius_flag = atom->omega_flag = atom->torque_flag = 1;
atom->sphere_flag = 1;

nlocal_bonus = nghost_bonus = nmax_bonus = 0;
bonus = nullptr;
Expand Down
1 change: 0 additions & 1 deletion src/atom_vec_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ AtomVecSphere::AtomVecSphere(LAMMPS *lmp) : AtomVec(lmp)
molecular = Atom::ATOMIC;
radvary = 0;

atom->sphere_flag = 1;
atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = 1;

// strings with peratom variables to include in each AtomVec method
Expand Down
1 change: 0 additions & 1 deletion src/atom_vec_tri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp)
atom->molecule_flag = atom->rmass_flag = 1;
atom->radius_flag = atom->omega_flag = atom->angmom_flag = 1;
atom->torque_flag = 1;
atom->sphere_flag = 1;

nlocal_bonus = nghost_bonus = nmax_bonus = 0;
bonus = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/compute_erotate_sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ComputeERotateSphere::ComputeERotateSphere(LAMMPS *lmp, int narg, char **arg) :

// error check

if (!atom->sphere_flag) error->all(FLERR, "Compute erotate/sphere requires atom style sphere");
if (!atom->omega_flag) error->all(FLERR, "Compute erotate/sphere requires atom attribute omega");
}

/* ---------------------------------------------------------------------- */
Expand Down
6 changes: 4 additions & 2 deletions src/compute_erotate_sphere_atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) :

// error check

if (!atom->sphere_flag)
error->all(FLERR,"Compute erotate/sphere/atom requires atom style sphere");
if (!atom->omega_flag)
error->all(FLERR,"Compute erotate/sphere/atom requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR,"Compute erotate/sphere/atom requires atom attribute radius");

nmax = 0;
}
Expand Down
Loading

0 comments on commit 7d53f8d

Please sign in to comment.