From 9d0c3bc665a428e0405c5fc1957b8a58fd28eb78 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 11 Sep 2020 18:44:13 -0400 Subject: [PATCH] replace some numeric constants in Atom and AtomVec classes with enumerators --- src/DIPOLE/atom_vec_dipole.cpp | 4 +-- src/GPU/fix_gpu.cpp | 2 +- src/GPU/pair_lj_cut_tip4p_long_gpu.cpp | 4 +-- src/GRANULAR/fix_pour.cpp | 6 ++--- src/GRANULAR/fix_wall_gran.cpp | 8 +++--- src/KOKKOS/atom_kokkos.cpp | 2 +- src/KOKKOS/atom_vec_angle_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_atomic_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_bond_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_charge_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_dpd_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_full_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_hybrid_kokkos.cpp | 8 +++--- src/KOKKOS/atom_vec_molecular_kokkos.cpp | 4 +-- src/KOKKOS/atom_vec_sphere_kokkos.cpp | 2 +- src/KOKKOS/comm_kokkos.cpp | 4 +-- src/KOKKOS/fix_langevin_kokkos.cpp | 2 +- src/KOKKOS/neigh_bond_kokkos.cpp | 20 +++++++-------- src/KOKKOS/npair_kokkos.cpp | 14 +++++------ src/KOKKOS/npair_ssa_kokkos.cpp | 4 +-- src/MC/fix_bond_create.cpp | 4 +-- src/MC/fix_gcmc.cpp | 23 +++++++++-------- src/MC/fix_widom.cpp | 11 ++++---- src/MESSAGE/fix_client_md.cpp | 2 +- src/MESSAGE/server_mc.cpp | 2 +- src/MESSAGE/server_md.cpp | 2 +- src/MISC/fix_deposit.cpp | 6 ++--- src/MISC/fix_evaporate.cpp | 10 ++++---- src/MISC/fix_gld.cpp | 8 +++--- src/MISC/fix_ttm.cpp | 4 +-- src/MOLECULE/atom_vec_angle.cpp | 4 +-- src/MOLECULE/atom_vec_bond.cpp | 4 +-- src/MOLECULE/atom_vec_full.cpp | 4 +-- src/MOLECULE/atom_vec_molecular.cpp | 4 +-- src/MOLECULE/atom_vec_template.cpp | 4 +-- src/MOLECULE/bond_quartic.cpp | 2 +- src/MOLECULE/fix_cmap.cpp | 8 +++--- src/MOLECULE/pair_hbond_dreiding_lj.cpp | 12 ++++----- src/MOLECULE/pair_hbond_dreiding_morse.cpp | 12 ++++----- src/PERI/atom_vec_peri.cpp | 2 +- src/PERI/fix_peri_neigh.cpp | 8 +++--- src/PERI/pair_peri_eps.cpp | 2 +- src/PERI/pair_peri_lps.cpp | 2 +- src/PERI/pair_peri_pmb.cpp | 2 +- src/PERI/pair_peri_ves.cpp | 2 +- src/POEMS/fix_poems.cpp | 10 ++++---- src/QEQ/fix_qeq.cpp | 4 +-- src/REPLICA/fix_event.cpp | 4 +-- src/REPLICA/fix_hyper_global.cpp | 2 +- src/REPLICA/fix_hyper_local.cpp | 2 +- src/REPLICA/neb.cpp | 2 +- src/REPLICA/prd.cpp | 2 +- src/REPLICA/tad.cpp | 2 +- src/RIGID/fix_ehex.cpp | 4 +-- src/RIGID/fix_rigid.cpp | 4 +-- src/RIGID/fix_rigid_small.cpp | 6 ++--- src/RIGID/fix_shake.cpp | 22 ++++++++-------- src/SHOCK/fix_append_atoms.cpp | 2 +- src/SPIN/atom_vec_spin.cpp | 4 +-- src/SPIN/fix_nve_spin.cpp | 2 +- src/SPIN/neb_spin.cpp | 2 +- src/USER-ATC/fix_atc.cpp | 4 +-- src/USER-AWPMD/atom_vec_wavepacket.cpp | 4 +-- src/USER-AWPMD/fix_nve_awpmd.cpp | 2 -- src/USER-COLVARS/fix_colvars.cpp | 2 +- src/USER-DPD/atom_vec_dpd.cpp | 4 +-- src/USER-DPD/npair_half_bin_newton_ssa.cpp | 6 ++--- src/USER-DRUDE/fix_drude.cpp | 14 +++++------ src/USER-EFF/atom_vec_electron.cpp | 4 +-- src/USER-INTEL/npair_full_bin_ghost_intel.cpp | 4 +-- src/USER-INTEL/npair_intel.cpp | 4 +-- src/USER-INTEL/verlet_lrt_intel.cpp | 2 +- src/USER-LB/fix_lb_fluid.cpp | 4 +-- src/USER-LB/fix_lb_pc.cpp | 4 +-- src/USER-LB/fix_lb_rigid_pc_sphere.cpp | 6 ++--- src/USER-MESODPD/atom_vec_edpd.cpp | 4 +-- src/USER-MESODPD/atom_vec_mdpd.cpp | 4 +-- src/USER-MESODPD/atom_vec_tdpd.cpp | 4 +-- src/USER-MESONT/atom_vec_mesont.cpp | 4 +-- src/USER-MISC/fix_ffl.cpp | 8 +++--- src/USER-MISC/fix_filter_corotate.cpp | 8 +++--- src/USER-MISC/fix_gle.cpp | 4 +-- src/USER-MISC/fix_pimd.cpp | 6 ++--- src/USER-MISC/fix_srp.cpp | 16 ++++++------ src/USER-MISC/fix_ti_spring.cpp | 8 +++--- src/USER-MISC/fix_ttm_mod.cpp | 4 +-- src/USER-MISC/pair_list.cpp | 2 +- src/USER-OMP/fix_omp.cpp | 2 +- src/USER-OMP/npair_full_bin_ghost_omp.cpp | 4 +-- src/USER-OMP/npair_full_bin_omp.cpp | 4 +-- src/USER-OMP/npair_full_multi_omp.cpp | 4 +-- src/USER-OMP/npair_full_nsq_ghost_omp.cpp | 4 +-- src/USER-OMP/npair_full_nsq_omp.cpp | 4 +-- .../npair_half_bin_newtoff_ghost_omp.cpp | 4 +-- src/USER-OMP/npair_half_bin_newtoff_omp.cpp | 4 +-- src/USER-OMP/npair_half_bin_newton_omp.cpp | 6 ++--- .../npair_half_bin_newton_tri_omp.cpp | 4 +-- src/USER-OMP/npair_half_multi_newtoff_omp.cpp | 4 +-- src/USER-OMP/npair_half_multi_newton_omp.cpp | 6 ++--- .../npair_half_multi_newton_tri_omp.cpp | 4 +-- .../npair_half_nsq_newtoff_ghost_omp.cpp | 4 +-- src/USER-OMP/npair_half_nsq_newtoff_omp.cpp | 4 +-- src/USER-OMP/npair_half_nsq_newton_omp.cpp | 4 +-- .../npair_half_respa_bin_newtoff_omp.cpp | 4 +-- .../npair_half_respa_bin_newton_omp.cpp | 6 ++--- .../npair_half_respa_bin_newton_tri_omp.cpp | 4 +-- .../npair_half_respa_nsq_newtoff_omp.cpp | 4 +-- .../npair_half_respa_nsq_newton_omp.cpp | 4 +-- src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp | 4 +-- .../pair_hbond_dreiding_morse_omp.cpp | 4 +-- src/USER-PHONON/dynamical_matrix.cpp | 4 +-- src/USER-PHONON/third_order.cpp | 4 +-- src/USER-QTB/fix_qbmsst.cpp | 4 +-- src/USER-QTB/fix_qtb.cpp | 4 +-- src/USER-REACTION/fix_bond_react.cpp | 2 +- src/USER-REAXC/fix_qeq_reax.cpp | 4 +-- src/USER-REAXC/fix_reaxc.cpp | 4 +-- src/USER-SCAFACOS/scafacos.cpp | 2 +- src/USER-SDPD/fix_meso_move.cpp | 8 +++--- src/USER-SMD/atom_vec_smd.cpp | 4 +-- src/USER-SMD/fix_smd_integrate_tlsph.cpp | 2 +- src/USER-SMD/fix_smd_integrate_ulsph.cpp | 2 +- .../fix_smd_move_triangulated_surface.cpp | 8 +++--- .../fix_smd_tlsph_reference_configuration.cpp | 6 ++--- src/USER-SMD/fix_smd_wall_surface.cpp | 10 ++++---- src/USER-SPH/atom_vec_sph.cpp | 4 +-- src/VORONOI/compute_voronoi_atom.cpp | 2 +- src/atom.cpp | 22 ++++++++-------- src/atom.h | 3 +++ src/atom_map.cpp | 25 +++++++++++-------- src/atom_vec.cpp | 4 +-- src/atom_vec.h | 3 ++- src/atom_vec_atomic.cpp | 6 +++-- src/atom_vec_body.cpp | 2 +- src/atom_vec_charge.cpp | 4 +-- src/atom_vec_ellipsoid.cpp | 2 +- src/atom_vec_hybrid.cpp | 8 +++--- src/atom_vec_line.cpp | 2 +- src/atom_vec_sphere.cpp | 4 +-- src/atom_vec_tri.cpp | 2 +- src/balance.cpp | 2 +- src/comm_brick.cpp | 4 +-- src/comm_tiled.cpp | 4 +-- src/compute_angle_local.cpp | 4 +-- src/compute_bond_local.cpp | 4 +-- src/compute_dihedral_local.cpp | 4 +-- src/compute_improper_local.cpp | 4 +-- src/compute_property_local.cpp | 2 +- src/create_atoms.cpp | 8 +++--- src/delete_atoms.cpp | 14 +++++------ src/domain.cpp | 8 +++--- src/dump_image.cpp | 4 +-- src/finish.cpp | 4 +-- src/fix_ave_atom.cpp | 4 +-- src/fix_external.cpp | 4 +-- src/fix_langevin.cpp | 4 +-- src/fix_minimize.cpp | 4 +-- src/fix_move.cpp | 8 +++--- src/fix_neigh_history.cpp | 8 +++--- src/fix_numdiff.cpp | 2 +- src/fix_property_atom.cpp | 14 +++++------ src/fix_read_restart.cpp | 4 +-- src/fix_respa.cpp | 4 +-- src/fix_restrain.cpp | 2 +- src/fix_spring_self.cpp | 8 +++--- src/fix_store.cpp | 8 +++--- src/fix_store_state.cpp | 8 +++--- src/fix_tmd.cpp | 6 ++--- src/info.cpp | 2 +- src/input.cpp | 2 +- src/library.cpp | 10 ++++---- src/molecule.cpp | 2 +- src/neighbor.cpp | 20 +++++++-------- src/npair_full_bin.cpp | 4 +-- src/npair_full_bin_ghost.cpp | 4 +-- src/npair_full_multi.cpp | 4 +-- src/npair_full_nsq.cpp | 4 +-- src/npair_full_nsq_ghost.cpp | 4 +-- src/npair_half_bin_newtoff.cpp | 4 +-- src/npair_half_bin_newtoff_ghost.cpp | 4 +-- src/npair_half_bin_newton.cpp | 6 ++--- src/npair_half_bin_newton_tri.cpp | 4 +-- src/npair_half_multi_newtoff.cpp | 4 +-- src/npair_half_multi_newton.cpp | 6 ++--- src/npair_half_multi_newton_tri.cpp | 4 +-- src/npair_half_nsq_newtoff.cpp | 4 +-- src/npair_half_nsq_newtoff_ghost.cpp | 4 +-- src/npair_half_nsq_newton.cpp | 4 +-- src/npair_half_respa_bin_newtoff.cpp | 4 +-- src/npair_half_respa_bin_newton.cpp | 6 ++--- src/npair_half_respa_bin_newton_tri.cpp | 4 +-- src/npair_half_respa_nsq_newtoff.cpp | 4 +-- src/npair_half_respa_nsq_newton.cpp | 4 +-- src/read_data.cpp | 22 ++++++++-------- src/read_dump.cpp | 6 ++--- src/read_restart.cpp | 6 ++--- src/replicate.cpp | 8 +++--- src/reset_atom_ids.cpp | 10 ++++---- src/set.cpp | 2 +- src/variable.cpp | 4 +-- src/velocity.cpp | 4 +-- src/write_data.cpp | 12 ++++----- 202 files changed, 539 insertions(+), 530 deletions(-) diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index 4193b5c6a8..10aaff0ab2 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -23,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecDipole::AtomVecDipole(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->q_flag = atom->mu_flag = 1; diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 15bc42c37e..f123050633 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -221,7 +221,7 @@ void FixGPU::init() { // GPU package cannot be used with atom_style template - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"GPU package does not (yet) work with " "atom_style template"); diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 2bd7420e72..4aca75cd4d 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -179,9 +179,9 @@ void PairLJCutTIP4PLongGPU::init_style() if (force->angle == NULL) error->all(FLERR,"Must use an angle style with TIP4P potential"); - if (atom->map_style == 2) + if (atom->map_style == Atom::MAP_HASH) error->all(FLERR,"GPU-accelerated lj/cut/tip4p/long currently" - " requires map style 'array' (atom_modify map array)"); + " requires 'array' style atom map (atom_modify map array)"); //PairLJCutCoulLong::init_style(); // Repeat cutsq calculation because done after call to init_style diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index d449bb5614..4a8e0dbb74 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -135,7 +135,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : ntype+onemols[i]->ntypes > atom->ntypes) error->all(FLERR,"Invalid atom type in fix pour mol command"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix pour molecule template ID must be same " "as atom style template ID"); onemols[i]->check_attributes(0); @@ -644,7 +644,7 @@ void FixPour::pre_exchange() atom->molecule[n] = maxmol_all+1; } } - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { atom->molindex[n] = 0; atom->molatom[n] = m; } @@ -712,7 +712,7 @@ void FixPour::pre_exchange() } if (maxtag_all >= MAXTAGINT) error->all(FLERR,"New atom IDs exceed maximum allowed ID"); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 9ec76b88f1..a30217dddd 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -409,8 +409,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : history_one = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); nmax = 0; mass_rigid = NULL; @@ -438,8 +438,8 @@ FixWallGran::~FixWallGran() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete local storage diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index e826a7c392..c3ded3ec63 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -118,7 +118,7 @@ void AtomKokkos::sync_overlapping_device(const ExecutionSpace space, unsigned in void AtomKokkos::allocate_type_arrays() { - if (avec->mass_type) { + if (avec->mass_type == AtomVec::PER_TYPE) { k_mass = DAT::tdual_float_1d("Mass",ntypes+1); mass = k_mass.h_view.data(); mass_setflag = new int[ntypes+1]; diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 662f09fe5a..a22f6817d1 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecAngleKokkos::AtomVecAngleKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 995985b29d..436b303665 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; AtomVecAtomicKokkos::AtomVecAtomicKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index db56d58dff..5da67b835f 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecBondKokkos::AtomVecBondKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 9846d2f4f8..bce0a4e61e 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; AtomVecChargeKokkos::AtomVecChargeKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index b112605859..14ffbbbf5f 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; AtomVecDPDKokkos::AtomVecDPDKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 0; size_forward = 7; diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 89275c7067..c06c20d14e 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecFullKokkos::AtomVecFullKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index 7c7f3c9826..694893e28d 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -89,7 +89,7 @@ void AtomVecHybridKokkos::process_args(int narg, char **arg) // hybrid settings are MAX or MIN of sub-style settings // hybrid sizes are minimal values plus extra values for each sub-style - molecular = 0; + molecular = Atom::ATOMIC; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -100,8 +100,8 @@ void AtomVecHybridKokkos::process_args(int narg, char **arg) xcol_data = 3; for (int k = 0; k < nstyles; k++) { - if ((styles[k]->molecular == 1 && molecular == 2) || - (styles[k]->molecular == 2 && molecular == 1)) + if ((styles[k]->molecular == Atom::MOLECULAR && molecular == Atom::TEMPLATE) || + (styles[k]->molecular == Atom::TEMPLATE && molecular == Atom::MOLECULAR)) error->all(FLERR,"Cannot mix molecular and molecule template " "atom styles"); molecular = MAX(molecular,styles[k]->molecular); @@ -114,7 +114,7 @@ void AtomVecHybridKokkos::process_args(int narg, char **arg) dipole_type = MAX(dipole_type,styles[k]->dipole_type); forceclearflag = MAX(forceclearflag,styles[k]->forceclearflag); - if (styles[k]->molecular == 2) onemols = styles[k]->onemols; + if (styles[k]->molecular == Atom::TEMPLATE) onemols = styles[k]->onemols; comm_x_only = MIN(comm_x_only,styles[k]->comm_x_only); comm_f_only = MIN(comm_f_only,styles[k]->comm_f_only); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index 7e3cdbf5e3..b52609a28e 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecMolecularKokkos::AtomVecMolecularKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index 6b62014e4a..8cbe917c3c 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -36,7 +36,7 @@ using namespace MathConst; AtomVecSphereKokkos::AtomVecSphereKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; comm_x_only = 1; comm_f_only = 0; diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 51ba6bbdb2..c5ff66e99c 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -568,7 +568,7 @@ void CommKokkos::exchange_device() // map_set() is done at end of borders() // clear ghost count and any ghost bonus data internal to AtomVec - if (map_style) atom->map_clear(); + if (map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); @@ -1043,7 +1043,7 @@ void CommKokkos::borders_device() { // reset global->local map atomKK->modified(exec_space,ALL_MASK); - if (map_style) { + if (map_style != Atom::MAP_NONE) { atomKK->sync(Host,TAG_MASK); atom->map_set(); } diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index dadf9e4c8b..6f4b21463e 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -63,7 +63,7 @@ FixLangevinKokkos::FixLangevinKokkos(LAMMPS *lmp, int narg, char **a if(gjfflag){ grow_arrays(atomKK->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize franprev to zero for (int i = 0; i < atomKK->nlocal; i++) { franprev[i][0] = 0.0; diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp index 021dcc7a1c..2fdb09f880 100644 --- a/src/KOKKOS/neigh_bond_kokkos.cpp +++ b/src/KOKKOS/neigh_bond_kokkos.cpp @@ -102,7 +102,7 @@ void NeighBondKokkos::init_topology_kk() { } // set flags that determine which topology neighboring routines to use - // bonds,etc can only be broken for atom->molecular = 1, not 2 + // bonds,etc can only be broken for atom->molecular = Atom::MOLECULAR, not Atom::TEMPLATE // SHAKE sets bonds and angles negative // gcmc sets all bonds, angles, etc negative // bond_quartic sets bonds to 0 @@ -117,7 +117,7 @@ void NeighBondKokkos::init_topology_kk() { bond_off = angle_off = 1; if (force->bond && force->bond_match("quartic")) bond_off = 1; - if (atom->avec->bonds_allow && atom->molecular == 1) { + if (atom->avec->bonds_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (bond_off) break; for (m = 0; m < atom->num_bond[i]; m++) @@ -125,7 +125,7 @@ void NeighBondKokkos::init_topology_kk() { } } - if (atom->avec->angles_allow && atom->molecular == 1) { + if (atom->avec->angles_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (angle_off) break; for (m = 0; m < atom->num_angle[i]; m++) @@ -134,7 +134,7 @@ void NeighBondKokkos::init_topology_kk() { } int dihedral_off = 0; - if (atom->avec->dihedrals_allow && atom->molecular == 1) { + if (atom->avec->dihedrals_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (dihedral_off) break; for (m = 0; m < atom->num_dihedral[i]; m++) @@ -143,7 +143,7 @@ void NeighBondKokkos::init_topology_kk() { } int improper_off = 0; - if (atom->avec->impropers_allow && atom->molecular == 1) { + if (atom->avec->impropers_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (improper_off) break; for (m = 0; m < atom->num_improper[i]; m++) @@ -168,19 +168,19 @@ void NeighBondKokkos::init_topology_kk() { // set ptrs to topology build functions - if (atom->molecular == 2) bond_build_kk = &NeighBondKokkos::bond_template; + if (atom->molecular == Atom::TEMPLATE) bond_build_kk = &NeighBondKokkos::bond_template; else if (bond_off) bond_build_kk = &NeighBondKokkos::bond_partial; else bond_build_kk = &NeighBondKokkos::bond_all; - if (atom->molecular == 2) angle_build_kk = &NeighBondKokkos::angle_template; + if (atom->molecular == Atom::TEMPLATE) angle_build_kk = &NeighBondKokkos::angle_template; else if (angle_off) angle_build_kk = &NeighBondKokkos::angle_partial; else angle_build_kk = &NeighBondKokkos::angle_all; - if (atom->molecular == 2) dihedral_build_kk = &NeighBondKokkos::dihedral_template; + if (atom->molecular == Atom::TEMPLATE) dihedral_build_kk = &NeighBondKokkos::dihedral_template; else if (dihedral_off) dihedral_build_kk = &NeighBondKokkos::dihedral_partial; else dihedral_build_kk = &NeighBondKokkos::dihedral_all; - if (atom->molecular == 2) improper_build_kk = &NeighBondKokkos::improper_template; + if (atom->molecular == Atom::TEMPLATE) improper_build_kk = &NeighBondKokkos::improper_template; else if (improper_off) improper_build_kk = &NeighBondKokkos::improper_partial; else improper_build_kk = &NeighBondKokkos::improper_all; @@ -211,7 +211,7 @@ void NeighBondKokkos::build_topology_kk() // don't yet have atom_map_kokkos routines, so move data from host to device - if (atom->map_style != 1) + if (atom->map_style != Atom::MAP_ARRAY) error->all(FLERR,"Must use atom map style array with Kokkos"); int* map_array_host = atom->get_map_array(); diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 724d485379..4cad8632b4 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -397,7 +397,7 @@ void NeighborKokkosExecute:: int n = 0; int which = 0; int moltemplate; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; // get subview of neighbors of i @@ -431,7 +431,7 @@ void NeighborKokkosExecute:: const X_FLOAT delz = ztmp - x(j, 2); const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(i,j); /* else if (imol >= 0) */ @@ -488,7 +488,7 @@ void NeighborKokkosExecute:: const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = NeighborKokkosExecute::find_special(i,j); /* else if (imol >= 0) */ @@ -614,7 +614,7 @@ void NeighborKokkosExecute::build_ItemCuda(typename Kokkos::TeamPoli const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { int which = 0; if (!moltemplate) which = NeighborKokkosExecute::find_special(i,j); @@ -692,7 +692,7 @@ void NeighborKokkosExecute::build_ItemCuda(typename Kokkos::TeamPoli const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { int which = 0; if (!moltemplate) which = NeighborKokkosExecute::find_special(i,j); @@ -748,7 +748,7 @@ void NeighborKokkosExecute:: int n = 0; int which = 0; int moltemplate; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; // get subview of neighbors of i @@ -787,7 +787,7 @@ void NeighborKokkosExecute:: const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(i,j); /* else if (imol >= 0) */ diff --git a/src/KOKKOS/npair_ssa_kokkos.cpp b/src/KOKKOS/npair_ssa_kokkos.cpp index d2b6c79698..ab509dc9ae 100644 --- a/src/KOKKOS/npair_ssa_kokkos.cpp +++ b/src/KOKKOS/npair_ssa_kokkos.cpp @@ -580,7 +580,7 @@ void NPairSSAKokkosExecute::build_locals_onePhase(const bool firstTr const X_FLOAT delz = ztmp - x(j, 2); const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(i,j); /* else if (imol >= 0) */ @@ -708,7 +708,7 @@ void NPairSSAKokkosExecute::build_ghosts_onePhase(int workPhase) con const X_FLOAT delz = ztmp - x(j, 2); const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(j,i); /* else if (jmol >= 0) */ diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index a2c2eee2c5..002ba45026 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -165,7 +165,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : bondcount = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); countflag = 0; // set comm sizes needed by this fix @@ -204,7 +204,7 @@ FixBondCreate::~FixBondCreate() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete random; diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index fc306696ed..bae9b148b3 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -73,7 +73,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : { if (narg < 11) error->all(FLERR,"Illegal fix gcmc command"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Fix gcmc does not (yet) work with atom_style template"); dynamic_group_allow = 1; @@ -170,7 +170,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : if (onemols[imol]->qflag == 1 && atom->q == NULL) error->all(FLERR,"Fix gcmc molecule has charges, but atom style does not"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix gcmc molecule template ID must be same " "as atom_style template ID"); onemols[imol]->check_attributes(0); @@ -534,7 +534,8 @@ void FixGCMC::init() } if (exchmode == EXCHMOL || movemode == MOVEMOL) - if (atom->molecule_flag == 0 || !atom->tag_enable || !atom->map_style) + if (atom->molecule_flag == 0 || !atom->tag_enable + || (atom->map_style == Atom::MAP_NONE)) error->all(FLERR, "Fix gcmc molecule command requires that " "atoms have molecule attributes"); @@ -905,7 +906,7 @@ void FixGCMC::attempt_atomic_deletion() if (success_all) { atom->natoms--; if (atom->tag_enable) { - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -1018,7 +1019,7 @@ void FixGCMC::attempt_atomic_insertion() atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -1262,7 +1263,7 @@ void FixGCMC::attempt_molecule_deletion() } else i++; } atom->natoms -= natoms_per_molecule; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); @@ -1456,7 +1457,7 @@ void FixGCMC::attempt_molecule_insertion() atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); @@ -1591,7 +1592,7 @@ void FixGCMC::attempt_atomic_deletion_full() atom->nlocal--; } atom->natoms--; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); ndeletion_successes += 1.0; energy_stored = energy_after; } else { @@ -1689,7 +1690,7 @@ void FixGCMC::attempt_atomic_insertion_full() atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -1963,7 +1964,7 @@ void FixGCMC::attempt_molecule_deletion_full() } else i++; } atom->natoms -= natoms_per_molecule; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); ndeletion_successes += 1.0; energy_stored = energy_after; } else { @@ -2147,7 +2148,7 @@ void FixGCMC::attempt_molecule_insertion_full() atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 94b2481742..386abc91f9 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -64,7 +64,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : { if (narg < 8) error->all(FLERR,"Illegal fix Widom command"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Fix Widom does not (yet) work with atom_style template"); dynamic_group_allow = 1; @@ -154,7 +154,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : if (onemols[imol]->qflag == 1 && atom->q == NULL) error->all(FLERR,"Fix Widom molecule has charges, but atom style does not"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix Widom molecule template ID must be same " "as atom_style template ID"); onemols[imol]->check_attributes(0); @@ -318,7 +318,8 @@ void FixWidom::init() } if (exchmode == EXCHMOL) - if (atom->molecule_flag == 0 || !atom->tag_enable || !atom->map_style) + if (atom->molecule_flag == 0 || !atom->tag_enable + || (atom->map_style == Atom::MAP_NONE)) error->all(FLERR, "Fix Widom molecule command requires that " "atoms have molecule attributes"); @@ -764,7 +765,7 @@ void FixWidom::attempt_atomic_insertion_full() atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -922,7 +923,7 @@ void FixWidom::attempt_molecule_insertion_full() atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index 1cbce3a7f9..5a795c99fc 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -42,7 +42,7 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : { if (lmp->clientserver != 1) error->all(FLERR,"Fix client/md requires LAMMPS be running as a client"); - if (!atom->map_style) error->all(FLERR,"Fix client/md requires atom map"); + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix client/md requires atom map"); if (sizeof(tagint) != 4) error->all(FLERR,"Fix client/md only supports 32-bit atom IDs"); diff --git a/src/MESSAGE/server_mc.cpp b/src/MESSAGE/server_mc.cpp index af7850a0e9..d74594be3e 100644 --- a/src/MESSAGE/server_mc.cpp +++ b/src/MESSAGE/server_mc.cpp @@ -47,7 +47,7 @@ void ServerMC::loop() if (domain->box_exist == 0) error->all(FLERR,"Server command before simulation box is defined"); - if (!atom->map_style) error->all(FLERR,"Server mc requires atom map"); + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Server mc requires atom map"); if (atom->tag_enable == 0) error->all(FLERR,"Server mc requires atom IDs"); if (sizeof(tagint) != 4) error->all(FLERR,"Server mc requires 32-bit atom IDs"); diff --git a/src/MESSAGE/server_md.cpp b/src/MESSAGE/server_md.cpp index 418162e5d9..ef00e95563 100644 --- a/src/MESSAGE/server_md.cpp +++ b/src/MESSAGE/server_md.cpp @@ -46,7 +46,7 @@ ServerMD::ServerMD(LAMMPS *lmp) : Pointers(lmp) if (domain->box_exist == 0) error->all(FLERR,"Server command before simulation box is defined"); - if (!atom->map_style) error->all(FLERR,"Server md requires atom map"); + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Server md requires atom map"); if (atom->tag_enable == 0) error->all(FLERR,"Server md requires atom IDs"); if (sizeof(tagint) != 4) error->all(FLERR,"Server md requires 32-bit atom IDs"); diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index 7ee6fce1b9..4e2ef6b035 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -113,7 +113,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : ntype+onemols[i]->ntypes > atom->ntypes) error->all(FLERR,"Invalid atom type in fix deposit mol command"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix deposit molecule template ID must be same " "as atom_style template ID"); onemols[i]->check_attributes(0); @@ -543,7 +543,7 @@ void FixDeposit::pre_exchange() atom->molecule[n] = maxmol_all+1; } } - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { atom->molindex[n] = 0; atom->molatom[n] = m; } @@ -613,7 +613,7 @@ void FixDeposit::pre_exchange() maxmol_all++; } } - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp index 6396d139a0..37d7ebde21 100644 --- a/src/MISC/fix_evaporate.cpp +++ b/src/MISC/fix_evaporate.cpp @@ -264,8 +264,8 @@ void FixEvaporate::pre_exchange() // if mol ID > 0, delete any atom in molecule and decrement counters // if mol ID == 0, delete single iatom // logic with ndeltopo is to count # of deleted bonds,angles,etc - // for atom->molecular = 1, do this for each deleted atom in molecule - // for atom->molecular = 2, use Molecule counts for just 1st atom in mol + // for atom->molecular = Atom::MOLECULAR, do this for each deleted atom in molecule + // for atom->molecular = Atom::TEMPLATE, use Molecule counts for just 1st atom in mol MPI_Allreduce(&me,&proc,1,MPI_INT,MPI_MAX,world); MPI_Bcast(&imolecule,1,MPI_LMP_TAGINT,proc,world); @@ -275,7 +275,7 @@ void FixEvaporate::pre_exchange() mark[i] = 1; ndelone++; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow) { if (force->newton_bond) ndeltopo[0] += atom->num_bond[i]; else { @@ -312,7 +312,7 @@ void FixEvaporate::pre_exchange() } } - } else if (molecular == 2) { + } else if (molecular == Atom::TEMPLATE) { if (molatom[i] == 0) { index = molindex[i]; ndeltopo[0] += onemols[index]->nbonds; @@ -376,7 +376,7 @@ void FixEvaporate::pre_exchange() atom->nimpropers -= all[3]; } - if (ndel && atom->map_style) { + if (ndel && (atom->map_style != Atom::MAP_NONE)) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index 75642b632f..2eee815f4d 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -92,8 +92,8 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : s_gld = NULL; grow_arrays(atom->nmax); // add callbacks to enable restarts - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // read in the Prony series coefficients int iarg = narg_min; @@ -179,8 +179,8 @@ FixGLD::~FixGLD() memory->destroy(s_gld); // remove callbacks to fix, so atom class stops calling it - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); } /* ---------------------------------------------------------------------- diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 2d38f3c6c6..954234240f 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -139,8 +139,8 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : flangevin[i][2] = 0; } - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // set initial electron temperatures from user input file diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 3dc8c90882..3f7e31dcb2 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = 1; diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 2fa445c8ee..7801b4e4e1 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecBond::AtomVecBond(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = 1; diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 866cf796c9..8f3f06a014 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = atom->q_flag = 1; diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index e90bec5108..426e4e20dd 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = 1; diff --git a/src/MOLECULE/atom_vec_template.cpp b/src/MOLECULE/atom_vec_template.cpp index ead8de7cb5..74e8199883 100644 --- a/src/MOLECULE/atom_vec_template.cpp +++ b/src/MOLECULE/atom_vec_template.cpp @@ -23,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecTemplate::AtomVecTemplate(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 2; - mass_type = 1; + molecular = Atom::TEMPLATE; + mass_type = PER_TYPE; atom->molecule_flag = 1; diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index c8d182e4ff..dc75df74ab 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -234,7 +234,7 @@ void BondQuartic::init_style() if (force->angle || force->dihedral || force->improper) error->all(FLERR, "Bond style quartic cannot be used with 3,4-body interactions"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR, "Bond style quartic cannot be used with atom style template"); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 2de6dd4183..85146b69e1 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -111,8 +111,8 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : nmax_previous = 0; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // local list of crossterms @@ -127,8 +127,8 @@ FixCMAP::~FixCMAP() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); memory->destroy(g_axis); memory->destroy(cmapgrid); diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index 6d9c851422..a7be928819 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -118,7 +118,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -146,7 +146,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; @@ -394,11 +394,11 @@ void PairHbondDreidingLJ::init_style() // pair newton on required since are looping over D atoms // and computing forces on A,H which may be on different procs - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Pair style hbond/dreiding requires molecular system"); if (atom->tag_enable == 0) error->all(FLERR,"Pair style hbond/dreiding requires atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair style hbond/dreiding requires an atom map, " "see atom_modify"); if (force->newton_pair == 0) @@ -494,7 +494,7 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype, if (!acceptor[jtype]) return 0.0; int molecular = atom->molecular; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = atom->special[i]; knum = atom->nspecial[i][0]; } else { @@ -510,7 +510,7 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype, factor_hb = special_lj[sbmask(j)]; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp index 422da8d827..7aba2697f4 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp @@ -88,7 +88,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -116,7 +116,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; @@ -321,11 +321,11 @@ void PairHbondDreidingMorse::init_style() // pair newton on required since are looping over D atoms // and computing forces on A,H which may be on different procs - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Pair style hbond/dreiding requires molecular system"); if (atom->tag_enable == 0) error->all(FLERR,"Pair style hbond/dreiding requires atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair style hbond/dreiding requires an atom map, " "see atom_modify"); if (force->newton_pair == 0) @@ -397,7 +397,7 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype, if (!acceptor[jtype]) return 0.0; int molecular = atom->molecular; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = atom->special[i]; knum = atom->nspecial[i][0]; } else { @@ -413,7 +413,7 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype, factor_hb = special_lj[sbmask(j)]; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index ada25431c8..a29b658199 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -43,7 +43,7 @@ AtomVecPeri::AtomVecPeri(LAMMPS *lmp) : AtomVec(lmp) { if (lmp->citeme) lmp->citeme->add(cite_peri_package); - molecular = 0; + molecular = Atom::ATOMIC; atom->rmass_flag = 1; atom->peri_flag = 1; diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 2950381197..784947a0b3 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -67,8 +67,8 @@ FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) : wvolume = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // initialize npartner to 0 so atom migration is OK the 1st time @@ -86,8 +86,8 @@ FixPeriNeigh::~FixPeriNeigh() { // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp index 0e5760ac8d..93d8eea92a 100644 --- a/src/PERI/pair_peri_eps.cpp +++ b/src/PERI/pair_peri_eps.cpp @@ -502,7 +502,7 @@ void PairPeriEPS::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); if (domain->lattice == NULL) diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index b60f28d9f1..41d140a216 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -427,7 +427,7 @@ void PairPeriLPS::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); if (domain->lattice->xlattice != domain->lattice->ylattice || diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 5d6973a915..14e9c8bc28 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -357,7 +357,7 @@ void PairPeriPMB::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); if (domain->lattice->xlattice != domain->lattice->ylattice || diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp index 93c980702b..e50b6b4168 100644 --- a/src/PERI/pair_peri_ves.cpp +++ b/src/PERI/pair_peri_ves.cpp @@ -481,7 +481,7 @@ void PairPeriVES::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); if (domain->lattice == NULL) diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 12dc59c286..3bf305e9cb 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -88,7 +88,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : atom2body = NULL; displace = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize each atom to belong to no rigid bodies @@ -99,7 +99,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : // readfile() and jointbuild() use global atom IDs int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -157,7 +157,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"molecule") == 0) { if (narg != 4) error->all(FLERR,"Illegal fix poems command"); - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR, "Must use a molecular atom style with fix poems molecule"); @@ -260,7 +260,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } // create POEMS instance @@ -291,7 +291,7 @@ FixPOEMS::~FixPOEMS() // if atom class still exists: // unregister this fix so atom class doesn't invoke it any more - if (atom) atom->delete_callback(id,0); + if (atom) atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 5cadce617f..172dedf5f0 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -101,7 +101,7 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : s_hist = t_hist = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); for( int i = 0; i < atom->nmax; i++ ) for (int j = 0; j < nprev; ++j ) @@ -122,7 +122,7 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : FixQEq::~FixQEq() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(s_hist); memory->destroy(t_hist); diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index 41f91332cb..a67bdbc51f 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -38,7 +38,7 @@ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -47,7 +47,7 @@ FixEvent::~FixEvent() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored array diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index f104d14c2f..e562b152ab 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -43,7 +43,7 @@ using namespace FixConst; FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : FixHyper(lmp, narg, arg), blist(NULL), xold(NULL), tagold(NULL) { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix hyper/global command requires atom map"); if (narg != 7) error->all(FLERR,"Illegal fix hyper/global command"); diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index da444bc451..5d42e25eda 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -54,7 +54,7 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : { // error checks - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix hyper/local command requires atom map"); // parse args diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 2d1dd6eea7..9992e8d934 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -133,7 +133,7 @@ void NEB::command(int narg, char **arg) // error checks if (nreplica == 1) error->all(FLERR,"Cannot use NEB with a single replica"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use NEB unless atom map exists"); // process file-style setting to setup initial configs for all replicas diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index cdb1eb9b02..998fc69f9d 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -61,7 +61,7 @@ void PRD::command(int narg, char **arg) if (domain->box_exist == 0) error->all(FLERR,"PRD command before simulation box is defined"); if (universe->nworlds != universe->nprocs && - atom->map_style == 0) + atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use PRD with multi-processor replicas " "unless atom map exists"); if (universe->nworlds == 1 && comm->me == 0) diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index db74b63c35..fbb555097b 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -77,7 +77,7 @@ void TAD::command(int narg, char **arg) error->all(FLERR,"Can only use TAD with 1-processor replicas for NEB"); if (atom->sortfreq > 0) error->all(FLERR,"Cannot use TAD with atom_modify sort enabled for NEB"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use TAD unless atom map exists for NEB"); if (narg < 7) error->universe_all(FLERR,"Illegal tad command"); diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index 03b79cc750..eab17df47f 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -129,7 +129,7 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), scale = 1.0; scalingmask = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); } @@ -145,7 +145,7 @@ void FixEHEX::grow_arrays(int nmax) { FixEHEX::~FixEHEX() { - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete [] idregion; memory->destroy(scalingmask); diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index f74cce8233..8c9f30c57f 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -83,7 +83,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : orient = NULL; dorient = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // parse args for rigid body specification // set nbody and body[i] for each atom @@ -619,7 +619,7 @@ FixRigid::~FixRigid() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete random; delete [] inpfile; diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 85cadc826e..2a662ec4c9 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -91,7 +91,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : orient = NULL; dorient = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // parse args for rigid body specification @@ -158,7 +158,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Unsupported fix rigid custom property"); } else error->all(FLERR,"Illegal fix rigid/small command"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix rigid/small requires an atom map, see atom_modify"); // maxmol = largest bodyID # @@ -497,7 +497,7 @@ FixRigidSmall::~FixRigidSmall() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index ee88f57341..2756ccbe91 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -70,7 +70,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // error check molecular = atom->molecular; - if (molecular == 0) + if (molecular == Atom::ATOMIC) error->all(FLERR,"Cannot use fix shake with non-molecular system"); // perform initial allocation of atom-based arrays @@ -85,7 +85,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : vtmp = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // set comm size needed by this fix @@ -242,7 +242,7 @@ FixShake::~FixShake() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // set bond_type and angle_type back to positive for SHAKE clusters // must set for all SHAKE bonds and angles stored by each atom @@ -715,7 +715,7 @@ void FixShake::find_clusters() // ----------------------------------------------------- int max = 0; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][0]); } else { for (i = 0; i < nlocal; i++) { @@ -749,7 +749,7 @@ void FixShake::find_clusters() // set npartner and partner_tag from special arrays // ----------------------------------------------------- - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { for (i = 0; i < nlocal; i++) { npartner[i] = nspecial[i][0]; for (j = 0; j < npartner[i]; j++) @@ -2568,7 +2568,7 @@ int FixShake::bondtype_findset(int i, tagint n1, tagint n2, int setflag) int m,nbonds; int *btype; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { tagint *tag = atom->tag; tagint **bond_atom = atom->bond_atom; nbonds = atom->num_bond[i]; @@ -2595,10 +2595,10 @@ int FixShake::bondtype_findset(int i, tagint n1, tagint n2, int setflag) if (m < nbonds) { if (setflag == 0) { - if (molecular == 1) return atom->bond_type[i][m]; + if (molecular == Atom::MOLECULAR) return atom->bond_type[i][m]; else return btype[m]; } - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if ((setflag < 0 && atom->bond_type[i][m] > 0) || (setflag > 0 && atom->bond_type[i][m] < 0)) atom->bond_type[i][m] = -atom->bond_type[i][m]; @@ -2624,7 +2624,7 @@ int FixShake::angletype_findset(int i, tagint n1, tagint n2, int setflag) int m,nangles; int *atype; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { tagint **angle_atom1 = atom->angle_atom1; tagint **angle_atom3 = atom->angle_atom3; nangles = atom->num_angle[i]; @@ -2652,10 +2652,10 @@ int FixShake::angletype_findset(int i, tagint n1, tagint n2, int setflag) if (m < nangles) { if (setflag == 0) { - if (molecular == 1) return atom->angle_type[i][m]; + if (molecular == Atom::MOLECULAR) return atom->angle_type[i][m]; else return atype[m]; } - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if ((setflag < 0 && atom->angle_type[i][m] > 0) || (setflag > 0 && atom->angle_type[i][m] < 0)) atom->angle_type[i][m] = -atom->angle_type[i][m]; diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 509e45202c..601030fa23 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -515,7 +515,7 @@ void FixAppendAtoms::pre_exchange() if (atom->natoms < 0) error->all(FLERR,"Too many total atoms"); if (atom->tag_enable) atom->tag_extend(); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index ef0a79a8d3..ae73d65f1c 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->sp_flag = 1; diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 462a359d99..c72faddd30 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -77,7 +77,7 @@ FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) : // checking if map array or hash is defined - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix NVE/spin requires an atom map, see atom_modify"); // defining sector_flag diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index a89ca403ce..498d0bc923 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -123,7 +123,7 @@ void NEBSpin::command(int narg, char **arg) // error checks if (nreplica == 1) error->all(FLERR,"Cannot use NEBSpin with a single replica"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use NEBSpin unless atom map exists"); // process file-style setting to setup initial configs for all replicas diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index dd02676466..e60e0bcb6f 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -474,7 +474,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), throw; } - lmp->atom->add_callback(0); + lmp->atom->add_callback(Atom::GROW); // we write our own restart file restart_global = 0; @@ -507,7 +507,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), /*----------------------------------------------------------------------- */ FixATC::~FixATC() { - if (lmp->atom) lmp->atom->delete_callback(id,0); + if (lmp->atom) lmp->atom->delete_callback(id,Atom::GROW); if (atc_) delete atc_; } diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp index 46b239be08..4b7575d2dd 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.cpp +++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp @@ -27,8 +27,8 @@ using namespace LAMMPS_NS; AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp) : AtomVec(lmp) { - mass_type = 1; - molecular = 0; + mass_type = PER_TYPE; + molecular = Atom::ATOMIC; forceclearflag = 1; atom->wavepacket_flag = 1; diff --git a/src/USER-AWPMD/fix_nve_awpmd.cpp b/src/USER-AWPMD/fix_nve_awpmd.cpp index 178f0f42de..e68f096ab1 100644 --- a/src/USER-AWPMD/fix_nve_awpmd.cpp +++ b/src/USER-AWPMD/fix_nve_awpmd.cpp @@ -36,8 +36,6 @@ FixNVEAwpmd::FixNVEAwpmd(LAMMPS *lmp, int narg, char **arg) : { if (!atom->wavepacket_flag) error->all(FLERR,"Fix nve/awpmd requires atom style wavepacket"); - //if (!atom->mass_type != 1) - // error->all(FLERR,"Fix nve/awpmd requires per type mass"); time_integrate = 1; } diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index fcbfb58456..e8ce877ea9 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -404,7 +404,7 @@ void FixColvars::init() if (atom->tag_enable == 0) error->all(FLERR,"Cannot use fix colvars without atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix colvars requires an atom map, see atom_modify"); if ((me == 0) && (update->whichflag == 2)) diff --git a/src/USER-DPD/atom_vec_dpd.cpp b/src/USER-DPD/atom_vec_dpd.cpp index 34efd9bc2b..aac08ced20 100644 --- a/src/USER-DPD/atom_vec_dpd.cpp +++ b/src/USER-DPD/atom_vec_dpd.cpp @@ -25,8 +25,8 @@ using namespace LAMMPS_NS; AtomVecDPD::AtomVecDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->rho_flag = 1; atom->dpd_flag = 1; diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.cpp b/src/USER-DPD/npair_half_bin_newton_ssa.cpp index 4fb5714d11..0fd39e1801 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.cpp +++ b/src/USER-DPD/npair_half_bin_newton_ssa.cpp @@ -88,7 +88,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; int molecular = atom->molecular; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -198,7 +198,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -279,7 +279,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[j],nspecial[j],tag[i]); else { diff --git a/src/USER-DRUDE/fix_drude.cpp b/src/USER-DRUDE/fix_drude.cpp index 313ac249d7..7b53cbd8a3 100644 --- a/src/USER-DRUDE/fix_drude.cpp +++ b/src/USER-DRUDE/fix_drude.cpp @@ -55,9 +55,9 @@ FixDrude::FixDrude(LAMMPS *lmp, int narg, char **arg) : drudeid = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); - atom->add_callback(2); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); + atom->add_callback(Atom::BORDER); // one-time assignment of Drude partners @@ -72,9 +72,9 @@ FixDrude::FixDrude(LAMMPS *lmp, int narg, char **arg) : FixDrude::~FixDrude() { - atom->delete_callback(id,2); - atom->delete_callback(id,1); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::BORDER); + atom->delete_callback(id,Atom::RESTART); + atom->delete_callback(id,Atom::GROW); memory->destroy(drudetype); memory->destroy(drudeid); } @@ -110,7 +110,7 @@ void FixDrude::build_drudeid(){ std::vector core_drude_vec; partner_set = new std::set[nlocal]; // Temporary sets of bond partner tags - if (atom->molecular == 1) + if (atom->molecular == Atom::MOLECULAR) { // Build list of my atoms' bond partners for (int i=0; iciteme) lmp->citeme->add(cite_user_eff_package); - mass_type = 1; - molecular = 0; + mass_type = PER_TYPE; + molecular = Atom::ATOMIC; forceclearflag = 1; atom->electron_flag = 1; diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp index bd4a95f774..89e80b021a 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp @@ -123,7 +123,7 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, tagint *s = NULL; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; - if (molecular) { + if (molecular != Atom::ATOMIC) { s = atom->special[0]; ns = atom->nspecial[0]; special_size = aend; @@ -153,7 +153,7 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, #endif int moltemplate; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; if (moltemplate) error->all(FLERR, diff --git a/src/USER-INTEL/npair_intel.cpp b/src/USER-INTEL/npair_intel.cpp index 9aae0d27b7..9b8f3481ee 100644 --- a/src/USER-INTEL/npair_intel.cpp +++ b/src/USER-INTEL/npair_intel.cpp @@ -129,7 +129,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, tagint *s = NULL; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; - if (molecular) { + if (molecular != Atom::ATOMIC) { s = atom->special[0]; ns = atom->nspecial[0]; special_size = aend; @@ -526,7 +526,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, } } // for u - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!THREE) neighptr2 = neighptr; int alln = n; diff --git a/src/USER-INTEL/verlet_lrt_intel.cpp b/src/USER-INTEL/verlet_lrt_intel.cpp index 4efed0d337..cad9a09dda 100644 --- a/src/USER-INTEL/verlet_lrt_intel.cpp +++ b/src/USER-INTEL/verlet_lrt_intel.cpp @@ -171,7 +171,7 @@ void VerletLRTIntel::setup(int flag) if (pair_compute_flag) force->pair->compute(eflag,vflag); else if (force->pair) force->pair->compute_dummy(eflag,vflag); - if (atom->molecular) { + if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 204a9c073b..22188bb938 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -242,7 +242,7 @@ a z wall velocity without implementing fixed BCs in z"); //-------------------------------------------------------------------------- hydroF = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); for(int i=0; inmax; i++) for(int j=0; j<3; j++) @@ -510,7 +510,7 @@ a z wall velocity without implementing fixed BCs in z"); FixLbFluid::~FixLbFluid() { - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(hydroF); memory->destroy(Ng_lb); diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index 2c7e8dbf47..4a4fd34400 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -49,7 +49,7 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) : up = NULL; up_old = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); Gamma_MD = new double[atom->ntypes+1]; @@ -76,7 +76,7 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) : FixLbPC::~FixLbPC() { - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(force_old); memory->destroy(up); diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index f714e31719..09eac47865 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -57,7 +57,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : body = NULL; up = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // by default assume all of the particles interact with the fluid. inner_nodes = 0; @@ -93,7 +93,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"molecule") == 0) { iarg = 4; - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Must use a molecular atom style with " "fix lb/rigid/pc/sphere molecule"); @@ -400,7 +400,7 @@ FixLbRigidPCSphere::~FixLbRigidPCSphere() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/USER-MESODPD/atom_vec_edpd.cpp b/src/USER-MESODPD/atom_vec_edpd.cpp index 1542c73604..84e7d0f1be 100644 --- a/src/USER-MESODPD/atom_vec_edpd.cpp +++ b/src/USER-MESODPD/atom_vec_edpd.cpp @@ -26,8 +26,8 @@ using namespace LAMMPS_NS; AtomVecEDPD::AtomVecEDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->edpd_flag = 1; diff --git a/src/USER-MESODPD/atom_vec_mdpd.cpp b/src/USER-MESODPD/atom_vec_mdpd.cpp index 0acaaf6253..a77ce72ec1 100644 --- a/src/USER-MESODPD/atom_vec_mdpd.cpp +++ b/src/USER-MESODPD/atom_vec_mdpd.cpp @@ -23,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecMDPD::AtomVecMDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->rho_flag = 1; diff --git a/src/USER-MESODPD/atom_vec_tdpd.cpp b/src/USER-MESODPD/atom_vec_tdpd.cpp index 63b88f921d..c95d0f1ed2 100644 --- a/src/USER-MESODPD/atom_vec_tdpd.cpp +++ b/src/USER-MESODPD/atom_vec_tdpd.cpp @@ -24,8 +24,8 @@ using namespace LAMMPS_NS; AtomVecTDPD::AtomVecTDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->tdpd_flag = 1; diff --git a/src/USER-MESONT/atom_vec_mesont.cpp b/src/USER-MESONT/atom_vec_mesont.cpp index a113433eed..038c88ac3e 100644 --- a/src/USER-MESONT/atom_vec_mesont.cpp +++ b/src/USER-MESONT/atom_vec_mesont.cpp @@ -22,8 +22,8 @@ using namespace LAMMPS_NS; AtomVecMesoNT::AtomVecMesoNT(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->mesont_flag = 1; diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index fb111c1f27..cea6e8ed0e 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -115,8 +115,8 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : grow_arrays(atom->nmax); // add callbacks to enable restarts - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); energy = 0.0; } @@ -127,8 +127,8 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : FixFFL::~FixFFL() { delete random; - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); memory->destroy(sqrt_m); memory->destroy(ffl_tmp1); diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 86650cd50d..eb663fbdef 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -71,10 +71,10 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_size(world,&nprocs); molecular = atom->molecular; - if (molecular == 0) + if (molecular == Atom::ATOMIC) error->all(FLERR,"Cannot use fix filter/corotate " "with non-molecular system"); - if (molecular == 2) + if (molecular == Atom::TEMPLATE) error->all(FLERR,"Cannot use fix filter/corotate " "with molecular template system"); @@ -155,7 +155,7 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : shake_type = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); //calls grow_arrays + atom->add_callback(Atom::GROW); //calls grow_arrays x_store = NULL; @@ -212,7 +212,7 @@ FixFilterCorotate::~FixFilterCorotate() memory->destroy(dn2dx); memory->destroy(dn3dx); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index f4776c3d6c..8e6fac34fb 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -361,8 +361,8 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : init_gles(); // add callbacks to enable restarts - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); energy = 0.0; } diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 5be9bf162b..f07a89b964 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -127,8 +127,8 @@ FixPIMD::FixPIMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) extvector = 1; comm_forward = 3; - atom->add_callback(0); // Call LAMMPS to allocate memory for per-atom array - atom->add_callback(1); // Call LAMMPS to re-assign restart-data for per-atom array + atom->add_callback(Atom::GROW); // Call LAMMPS to allocate memory for per-atom array + atom->add_callback(Atom::RESTART); // Call LAMMPS to re-assign restart-data for per-atom array grow_arrays(atom->nmax); @@ -152,7 +152,7 @@ int FixPIMD::setmask() void FixPIMD::init() { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix pimd requires an atom map, see atom_modify"); if(universe->me==0 && screen) fprintf(screen,"Fix pimd initializing Path-Integral ...\n"); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 97bf1fb07b..b5956b98fd 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -59,9 +59,9 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) grow_arrays(atom->nmax); // extends pack_exchange() - atom->add_callback(0); - atom->add_callback(1); // restart - atom->add_callback(2); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // restart + atom->add_callback(Atom::BORDER); // initialize to illegal values so we capture btype = -1; @@ -78,9 +78,9 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) FixSRP::~FixSRP() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); - atom->delete_callback(id,2); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); + atom->delete_callback(id,Atom::BORDER); memory->destroy(array); } @@ -293,7 +293,7 @@ void FixSRP::setup_pre_force(int /*zz*/) // assign tags for new atoms, update map atom->tag_extend(); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); @@ -514,7 +514,7 @@ void FixSRP::post_run() bigint nblocal = atom->nlocal; MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index bc10b5284c..8197b267e9 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -76,8 +76,8 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : // Register with Atom class xoriginal = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // xoriginal = initial unwrapped positions of atoms @@ -117,8 +117,8 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : FixTISpring::~FixTISpring() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored array memory->destroy(xoriginal); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index c12019528c..7a6494f0a3 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -162,8 +162,8 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : flangevin[i][2] = 0; } - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // set initial electron temperatures from user input file diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index a93e0a81af..2f5e0a3ff7 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -368,7 +368,7 @@ void PairList::init_style() if (atom->tag_enable == 0) error->all(FLERR,"Pair style list requires atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair style list requires an atom map"); if (offset_flag) { diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index f3c86a7746..ef788dda80 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -170,7 +170,7 @@ int FixOMP::setmask() void FixOMP::init() { // USER-OMP package cannot be used with atom_style template - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"USER-OMP package does not (yet) work with " "atom_style template"); diff --git a/src/USER-OMP/npair_full_bin_ghost_omp.cpp b/src/USER-OMP/npair_full_bin_ghost_omp.cpp index e9297538d9..19d9ea4b67 100644 --- a/src/USER-OMP/npair_full_bin_ghost_omp.cpp +++ b/src/USER-OMP/npair_full_bin_ghost_omp.cpp @@ -39,7 +39,7 @@ void NPairFullBinGhostOmp::build(NeighList *list) const int nlocal = atom->nlocal; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -110,7 +110,7 @@ void NPairFullBinGhostOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_bin_omp.cpp b/src/USER-OMP/npair_full_bin_omp.cpp index 35835cae1d..9ee573ee16 100644 --- a/src/USER-OMP/npair_full_bin_omp.cpp +++ b/src/USER-OMP/npair_full_bin_omp.cpp @@ -37,7 +37,7 @@ void NPairFullBinOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -104,7 +104,7 @@ void NPairFullBinOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_multi_omp.cpp b/src/USER-OMP/npair_full_multi_omp.cpp index b4b0ea3033..6356d3031b 100644 --- a/src/USER-OMP/npair_full_multi_omp.cpp +++ b/src/USER-OMP/npair_full_multi_omp.cpp @@ -38,7 +38,7 @@ void NPairFullMultiOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -112,7 +112,7 @@ void NPairFullMultiOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_nsq_ghost_omp.cpp b/src/USER-OMP/npair_full_nsq_ghost_omp.cpp index 8b940f3724..3daabec87b 100644 --- a/src/USER-OMP/npair_full_nsq_ghost_omp.cpp +++ b/src/USER-OMP/npair_full_nsq_ghost_omp.cpp @@ -39,7 +39,7 @@ void NPairFullNsqGhostOmp::build(NeighList *list) const int nlocal = atom->nlocal; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -104,7 +104,7 @@ void NPairFullNsqGhostOmp::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_nsq_omp.cpp b/src/USER-OMP/npair_full_nsq_omp.cpp index 95c5caa148..cb0860d45c 100644 --- a/src/USER-OMP/npair_full_nsq_omp.cpp +++ b/src/USER-OMP/npair_full_nsq_omp.cpp @@ -39,7 +39,7 @@ void NPairFullNsqOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -104,7 +104,7 @@ void NPairFullNsqOmp::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp index 33fa4ed685..1075cd4d3d 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp @@ -43,7 +43,7 @@ void NPairHalfBinNewtoffGhostOmp::build(NeighList *list) const int nlocal = atom->nlocal; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -118,7 +118,7 @@ void NPairHalfBinNewtoffGhostOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_bin_newtoff_omp.cpp index 8e756d5072..df23bb3142 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newtoff_omp.cpp @@ -39,7 +39,7 @@ void NPairHalfBinNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -109,7 +109,7 @@ void NPairHalfBinNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newton_omp.cpp b/src/USER-OMP/npair_half_bin_newton_omp.cpp index e27a58de46..23e7c78bf6 100644 --- a/src/USER-OMP/npair_half_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newton_omp.cpp @@ -38,7 +38,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -110,7 +110,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) @@ -141,7 +141,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp index f88df4aed4..fd4b81e23b 100644 --- a/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp @@ -38,7 +38,7 @@ void NPairHalfBinNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -115,7 +115,7 @@ void NPairHalfBinNewtonTriOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_multi_newtoff_omp.cpp b/src/USER-OMP/npair_half_multi_newtoff_omp.cpp index 586809c174..70668a917c 100644 --- a/src/USER-OMP/npair_half_multi_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newtoff_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfMultiNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -116,7 +116,7 @@ void NPairHalfMultiNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_multi_newton_omp.cpp b/src/USER-OMP/npair_half_multi_newton_omp.cpp index 9b8fc78f09..8101d5cfef 100644 --- a/src/USER-OMP/npair_half_multi_newton_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newton_omp.cpp @@ -39,7 +39,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -112,7 +112,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) @@ -149,7 +149,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp b/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp index fec687d075..b0ac840aa7 100644 --- a/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -125,7 +125,7 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp index 316c63d541..a7ff39ab16 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp @@ -44,7 +44,7 @@ void NPairHalfNsqNewtoffGhostOmp::build(NeighList *list) const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -113,7 +113,7 @@ void NPairHalfNsqNewtoffGhostOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp index c937b5bc68..a1ab2c1eed 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp @@ -41,7 +41,7 @@ void NPairHalfNsqNewtoffOmp::build(NeighList *list) const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int nall = atom->nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -105,7 +105,7 @@ void NPairHalfNsqNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_nsq_newton_omp.cpp index 6baab97aa0..254d69fabe 100644 --- a/src/USER-OMP/npair_half_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newton_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfNsqNewtonOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -123,7 +123,7 @@ void NPairHalfNsqNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp index c8dc37f978..ccf9f519b1 100644 --- a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp @@ -41,7 +41,7 @@ void NPairHalfRespaBinNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -140,7 +140,7 @@ void NPairHalfRespaBinNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp index 98732a62ea..b25c6aeb18 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -142,7 +142,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) @@ -186,7 +186,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp index 65315a2905..34981536f9 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfRespaBinNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -147,7 +147,7 @@ void NPairHalfRespaBinNewtonTriOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp index 45d81069fc..321d479988 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp @@ -42,7 +42,7 @@ void NPairHalfRespaNsqNewtoffOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -137,7 +137,7 @@ void NPairHalfRespaNsqNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp index 1237ce7858..95b1cc69de 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp @@ -43,7 +43,7 @@ void NPairHalfRespaNsqNewtonOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -155,7 +155,7 @@ void NPairHalfRespaNsqNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index 338eb52453..6801e901ff 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -157,7 +157,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -190,7 +190,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 5094d5c193..5624b865f5 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -157,7 +157,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -190,7 +190,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 238aa7c96e..19b3100277 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -134,7 +134,7 @@ void DynamicalMatrix::command(int narg, char **arg) else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Dynamical_matrix command requires an atom map, see atom_modify"); // move atoms by 3-vector or specified variable(s) @@ -393,7 +393,7 @@ void DynamicalMatrix::update_force() force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } - if (atom->molecular) { + if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index e7997d6397..c7b24a9f60 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -133,7 +133,7 @@ void ThirdOrder::command(int narg, char **arg) else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); del = utils::numeric(FLERR, arg[2],false,lmp); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"third_order command requires an atom map, see atom_modify"); // move atoms by 3-vector or specified variable(s) @@ -408,7 +408,7 @@ void ThirdOrder::update_force() force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } - if (atom->molecular) { + if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 034738023c..ac07d0e0dd 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -268,7 +268,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : // allocate random-arrays and fran grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // allocate omega_H and time_H memory->create(omega_H,2*N_f,"qbmsst:omega_H"); @@ -303,7 +303,7 @@ FixQBMSST::~FixQBMSST() memory->destroy(random_array_2); memory->destroy(omega_H); memory->destroy(time_H); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); } /* ---------------------------------------------------------------------- diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 3f29229beb..fb26a580f0 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -114,7 +114,7 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : // allocate random-arrays and fran grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // allocate omega_H and time_H memory->create(omega_H,2*N_f,"qtb:omega_H"); @@ -136,7 +136,7 @@ FixQTB::~FixQTB() memory->destroy(random_array_2); memory->destroy(omega_H); memory->destroy(time_H); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); } /* ---------------------------------------------------------------------- diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 5d57b74056..2c801d23ff 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -436,7 +436,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } delete [] files; - if (atom->molecular != 1) + if (atom->molecular != Atom::ATOMIC) error->all(FLERR,"Bond/react: Cannot use fix bond/react with non-molecular systems"); // check if bonding atoms are 1-2, 1-3, or 1-4 bonded neighbors diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 4a61cfa03b..d379d65336 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -124,7 +124,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : s_hist = t_hist = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); for (int i = 0; i < atom->nmax; i++) for (int j = 0; j < nprev; ++j) s_hist[i][j] = t_hist[i][j] = 0; @@ -140,7 +140,7 @@ FixQEqReax::~FixQEqReax() // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(s_hist); memory->destroy(t_hist); diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index c98adf5b45..8bda03a023 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -44,7 +44,7 @@ FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : num_bonds = NULL; num_hbonds = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize arrays to MIN so atom migration is OK the 1st time // it is done in grow_arrays() now @@ -60,7 +60,7 @@ FixReaxC::~FixReaxC() { // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index c49f99a5a0..72da2599c7 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -118,7 +118,7 @@ void Scafacos::init() if (atom->natoms > INT_MAX && sizeof(int) != 8) error->all(FLERR,"Scafacos atom count exceeds 2B"); - if (atom->molecular > 0) + if (atom->molecular != Atom::ATOMIC) error->all(FLERR, "Cannot use Scafacos with molecular charged systems yet"); diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index c39d142a6e..a6320d5c19 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -234,8 +234,8 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); displace = velocity = NULL; @@ -259,8 +259,8 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : FixMesoMove::~FixMesoMove () { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays diff --git a/src/USER-SMD/atom_vec_smd.cpp b/src/USER-SMD/atom_vec_smd.cpp index 81a43ff7f3..26b63b6022 100644 --- a/src/USER-SMD/atom_vec_smd.cpp +++ b/src/USER-SMD/atom_vec_smd.cpp @@ -37,8 +37,8 @@ using namespace LAMMPS_NS; AtomVecSMD::AtomVecSMD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->smd_flag = 1; diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.cpp b/src/USER-SMD/fix_smd_integrate_tlsph.cpp index 7d5e89f895..6b3bfca9b4 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_tlsph.cpp @@ -95,7 +95,7 @@ FixSMDIntegrateTlsph::FixSMDIntegrateTlsph(LAMMPS *lmp, int narg, char **arg) : // set comm sizes needed by this fix - atom->add_callback(0); + atom->add_callback(Atom::GROW); } diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.cpp b/src/USER-SMD/fix_smd_integrate_ulsph.cpp index 215759331e..f11b55aaf4 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_ulsph.cpp @@ -123,7 +123,7 @@ FixSMDIntegrateUlsph::FixSMDIntegrateUlsph(LAMMPS *lmp, int narg, char **arg) : } // set comm sizes needed by this fix - atom->add_callback(0); + atom->add_callback(Atom::GROW); time_integrate = 1; } diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp index e0e76a18fb..ac77a7965d 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp @@ -206,8 +206,8 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : // set comm sizes needed by this fix comm_forward = 12; - //atom->add_callback(0); - //atom->add_callback(1); + //atom->add_callback(Atom::GROW); + //atom->add_callback(Atom::RESTART); time_integrate = 1; } @@ -217,8 +217,8 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : FixSMDMoveTriSurf::~FixSMDMoveTriSurf() { // unregister callbacks to this fix from Atom class - //atom->delete_callback(id,0); - //atom->delete_callback(id,1); + //atom->delete_callback(id,Atom::GROW); + //atom->delete_callback(id,Atom::RESTART); } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 3e63de08f3..107d00f2ee 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -55,7 +55,7 @@ using namespace SMD_Math; FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); maxpartner = 1; @@ -66,7 +66,7 @@ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS energy_per_bond = NULL; degradation_ij = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize npartner to 0 so neighbor list creation is OK the 1st time int nlocal = atom->nlocal; @@ -83,7 +83,7 @@ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS FixSMD_TLSPH_ReferenceConfiguration::~FixSMD_TLSPH_ReferenceConfiguration() { // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id, 0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays memory->destroy(npartner); diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 10f248c39f..769319bdd9 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -43,8 +43,8 @@ FixSMDWallSurface::FixSMDWallSurface(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 0; first = 1; - //atom->add_callback(0); - //atom->add_callback(1); + //atom->add_callback(Atom::GROW); + //atom->add_callback(Atom::RESTART); if (narg != 6) error->all(FLERR, "Illegal number of arguments for fix smd/wall_surface"); @@ -72,8 +72,8 @@ FixSMDWallSurface::~FixSMDWallSurface() { filename = NULL; // unregister this fix so atom class doesn't invoke it any more - //atom->delete_callback(id, 0); - //atom->delete_callback(id, 1); + //atom->delete_callback(id,Atom::GROW); + //atom->delete_callback(id,Atom::RESTART); } /* ---------------------------------------------------------------------- */ @@ -465,7 +465,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // create global mapping of atoms // zero nghost in case are adding new atoms to existing atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/USER-SPH/atom_vec_sph.cpp b/src/USER-SPH/atom_vec_sph.cpp index 93ca2b60a7..c653d6f7be 100644 --- a/src/USER-SPH/atom_vec_sph.cpp +++ b/src/USER-SPH/atom_vec_sph.cpp @@ -23,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecSPH::AtomVecSPH(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->esph_flag = 1; diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index be77b8457b..a3bc55253e 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -129,7 +129,7 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : if (occupation && ( surface!=VOROSURF_NONE || maxedge>0 ) ) error->all(FLERR,"Illegal compute voronoi/atom command (occupation and (surface or edges))"); - if (occupation && (atom->map_style == 0)) + if (occupation && (atom->map_style == Atom::MAP_NONE)) error->all(FLERR,"Compute voronoi/atom occupation requires an atom map, see atom_modify"); nmax = rmax = 0; diff --git a/src/atom.cpp b/src/atom.cpp index 49ff262764..7ec5cbbbef 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -230,7 +230,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // default atom ID and mapping values tag_enable = 1; - map_style = map_user = 0; + map_style = map_user = MAP_NONE; map_tag_max = -1; map_maxarray = map_nhash = map_nbucket = -1; @@ -666,7 +666,7 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu molecular = avec->molecular; if (molecular && tag_enable == 0) error->all(FLERR,"Atom IDs must be used for molecular systems"); - if (molecular) map_style = 3; + if (molecular != Atom::ATOMIC) map_style = MAP_YES; } /* ---------------------------------------------------------------------- @@ -1665,7 +1665,7 @@ void Atom::data_fix_compute_variable(int nprev, int nnew) void Atom::allocate_type_arrays() { - if (avec->mass_type) { + if (avec->mass_type == AtomVec::PER_TYPE) { mass = new double[ntypes+1]; mass_setflag = new int[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) mass_setflag[itype] = 0; @@ -2214,7 +2214,7 @@ void Atom::add_callback(int flag) // sorting is required in cases where fixes were replaced as it ensures atom // data is read/written/transfered in the same order that fixes are called - if (flag == 0) { + if (flag == GROW) { if (nextra_grow == nextra_grow_max) { nextra_grow_max += DELTA; memory->grow(extra_grow,nextra_grow_max,"atom:extra_grow"); @@ -2222,7 +2222,7 @@ void Atom::add_callback(int flag) extra_grow[nextra_grow] = ifix; nextra_grow++; std::sort(extra_grow, extra_grow + nextra_grow); - } else if (flag == 1) { + } else if (flag == RESTART) { if (nextra_restart == nextra_restart_max) { nextra_restart_max += DELTA; memory->grow(extra_restart,nextra_restart_max,"atom:extra_restart"); @@ -2230,7 +2230,7 @@ void Atom::add_callback(int flag) extra_restart[nextra_restart] = ifix; nextra_restart++; std::sort(extra_restart, extra_restart + nextra_restart); - } else if (flag == 2) { + } else if (flag == BORDER) { if (nextra_border == nextra_border_max) { nextra_border_max += DELTA; memory->grow(extra_border,nextra_border_max,"atom:extra_border"); @@ -2255,7 +2255,7 @@ void Atom::delete_callback(const char *id, int flag) // compact the list of callbacks - if (flag == 0) { + if (flag == GROW) { int match; for (match = 0; match < nextra_grow; match++) if (extra_grow[match] == ifix) break; @@ -2265,7 +2265,7 @@ void Atom::delete_callback(const char *id, int flag) extra_grow[i] = extra_grow[i+1]; nextra_grow--; - } else if (flag == 1) { + } else if (flag == RESTART) { int match; for (match = 0; match < nextra_restart; match++) if (extra_restart[match] == ifix) break; @@ -2275,7 +2275,7 @@ void Atom::delete_callback(const char *id, int flag) extra_restart[i] = extra_restart[i+1]; nextra_restart--; - } else if (flag == 2) { + } else if (flag == BORDER) { int match; for (match = 0; match < nextra_border; match++) if (extra_border[match] == ifix) break; @@ -2591,9 +2591,9 @@ bigint Atom::memory_usage() bigint bytes = avec->memory_usage(); bytes += max_same*sizeof(int); - if (map_style == 1) + if (map_style == MAP_ARRAY) bytes += memory->usage(map_array,map_maxarray); - else if (map_style == 2) { + else if (map_style == MAP_HASH) { bytes += map_nbucket*sizeof(int); bytes += map_nhash*sizeof(HashElem); } diff --git a/src/atom.h b/src/atom.h index 21b9c06f8c..545b72f0da 100644 --- a/src/atom.h +++ b/src/atom.h @@ -30,6 +30,9 @@ class Atom : protected Pointers { char *atom_style; AtomVec *avec; enum{DOUBLE,INT,BIGINT}; + enum{GROW=0,RESTART=1,BORDER=2}; + enum{ATOMIC=0,MOLECULAR=1,TEMPLATE=2}; + enum{MAP_NONE=0,MAP_ARRAY=1,MAP_HASH=2,MAP_YES=3}; // atom counts diff --git a/src/atom_map.cpp b/src/atom_map.cpp index 02b97a1134..f917b4f8e9 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -44,15 +44,15 @@ void Atom::map_init(int check) int recreate = 0; if (check) recreate = map_style_set(); - if (map_style == 1 && map_tag_max > map_maxarray) recreate = 1; - else if (map_style == 2 && nlocal+nghost > map_nhash) recreate = 1; + if (map_style == MAP_ARRAY && map_tag_max > map_maxarray) recreate = 1; + else if (map_style == MAP_HASH && nlocal+nghost > map_nhash) recreate = 1; // if not recreating: // for array, initialize current map_tag_max values // for hash, set all buckets to empty, put all entries in free list if (!recreate) { - if (map_style == 1) { + if (map_style == MAP_ARRAY) { for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1; } else { for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1; @@ -67,7 +67,7 @@ void Atom::map_init(int check) } else { map_delete(); - if (map_style == 1) { + if (map_style == MAP_ARRAY) { map_maxarray = map_tag_max; memory->create(map_array,map_maxarray+1,"atom:map_array"); for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1; @@ -114,7 +114,7 @@ void Atom::map_init(int check) void Atom::map_clear() { - if (map_style == 1) { + if (map_style == MAP_ARRAY) { int nall = nlocal + nghost; for (int i = 0; i < nall; i++) { sametag[i] = -1; @@ -169,7 +169,7 @@ void Atom::map_set() { int nall = nlocal + nghost; - if (map_style == 1) { + if (map_style == MAP_ARRAY) { // possible reallocation of sametag must come before loop over atoms // since loop sets sametag @@ -247,7 +247,7 @@ void Atom::map_set() void Atom::map_one(tagint global, int local) { - if (map_style == 1) map_array[global] = local; + if (map_style == MAP_ARRAY) map_array[global] = local; else { // search for key // if found it, just overwrite local value with index @@ -305,9 +305,12 @@ int Atom::map_style_set() // else use array int map_style_old = map_style; - if (map_user == 1 || map_user == 2) map_style = map_user; - else if (map_tag_max > 1000000 && !lmp->kokkos) map_style = 2; - else map_style = 1; + if (map_user == MAP_ARRAY || map_user == MAP_HASH) { + map_style = map_user; + } else { // map_user == MAP_YES + if (map_tag_max > 1000000 && !lmp->kokkos) map_style = MAP_HASH; + else map_style = MAP_ARRAY; + } // recreate = 1 if must create new map b/c map_style changed @@ -326,7 +329,7 @@ void Atom::map_delete() sametag = NULL; max_same = 0; - if (map_style == 1) { + if (map_style == MAP_ARRAY) { memory->destroy(map_array); map_array = NULL; } else { diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 4a00e5852b..9da52fe4e6 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -39,9 +39,9 @@ AtomVec::AtomVec(LAMMPS *lmp) : Pointers(lmp) nmax = 0; ngrow = 0; - molecular = 0; + molecular = Atom::ATOMIC; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 0; - mass_type = dipole_type = 0; + mass_type = dipole_type = PER_ATOM; forceclearflag = 0; maxexchange = 0; bonus_flag = 0; diff --git a/src/atom_vec.h b/src/atom_vec.h index 07dec63506..6b888005d6 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -20,7 +20,8 @@ namespace LAMMPS_NS { class AtomVec : protected Pointers { public: - int molecular; // 0 = atomic, 1 = molecular system + enum {PER_ATOM=0,PER_TYPE=1}; + int molecular; // 0 = atomic, 1 = molecular system, 2 = molecular template system int bonds_allow,angles_allow; // 1 if bonds, angles are used int dihedrals_allow,impropers_allow; // 1 if dihedrals, impropers used int mass_type; // 1 if per-type masses diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp index eb8dfc1b7e..1cd409a354 100644 --- a/src/atom_vec_atomic.cpp +++ b/src/atom_vec_atomic.cpp @@ -13,14 +13,16 @@ #include "atom_vec_atomic.h" +#include "atom.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ AtomVecAtomic::AtomVecAtomic(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index e9044519c9..7e8b9a7583 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; // first 3 sizes do not include values from body itself diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp index 5957ef5215..e50bf6fe35 100644 --- a/src/atom_vec_charge.cpp +++ b/src/atom_vec_charge.cpp @@ -20,8 +20,8 @@ using namespace LAMMPS_NS; AtomVecCharge::AtomVecCharge(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->q_flag = 1; diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index c22111f48c..495cdf95fd 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -34,7 +34,7 @@ using namespace MathConst; AtomVecEllipsoid::AtomVecEllipsoid(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; size_forward_bonus = 4; diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 7a8c73570d..6affd56421 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -121,12 +121,12 @@ void AtomVecHybrid::process_args(int narg, char **arg) // hybrid settings are MAX or MIN of sub-style settings // check for both mass_type = 0 and 1, so can warn - molecular = 0; + molecular = Atom::ATOMIC; maxexchange = 0; for (int k = 0; k < nstyles; k++) { - if ((styles[k]->molecular == 1 && molecular == 2) || - (styles[k]->molecular == 2 && molecular == 1)) + if ((styles[k]->molecular == Atom::MOLECULAR && molecular == Atom::TEMPLATE) || + (styles[k]->molecular == Atom::TEMPLATE && molecular == Atom::MOLECULAR)) error->all(FLERR, "Cannot mix molecular and molecule template atom styles"); molecular = MAX(molecular,styles[k]->molecular); @@ -140,7 +140,7 @@ void AtomVecHybrid::process_args(int narg, char **arg) forceclearflag = MAX(forceclearflag,styles[k]->forceclearflag); maxexchange += styles[k]->maxexchange; - if (styles[k]->molecular == 2) onemols = styles[k]->onemols; + if (styles[k]->molecular == Atom::TEMPLATE) onemols = styles[k]->onemols; } // issue a warning if both per-type mass and per-atom rmass are defined diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 88dcb8c2fa..fae833cd25 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -33,7 +33,7 @@ using namespace MathConst; AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; size_forward_bonus = 1; diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index 03412a11cc..27dc95e360 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -29,8 +29,8 @@ using namespace MathConst; AtomVecSphere::AtomVecSphere(LAMMPS *lmp) : AtomVec(lmp) { - mass_type = 0; - molecular = 0; + mass_type = PER_ATOM; + molecular = Atom::ATOMIC; atom->sphere_flag = 1; atom->radius_flag = atom->rmass_flag = atom->omega_flag = diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index e391a73215..0b6863b96d 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -34,7 +34,7 @@ using namespace MathConst; AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; size_forward_bonus = 4; diff --git a/src/balance.cpp b/src/balance.cpp index af8d904812..f7059aa2c5 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -263,7 +263,7 @@ void Balance::command(int narg, char **arg) domain->reset_box(); comm->setup(); comm->exchange(); - if (atom->map_style) atom->map_set(); + if (atom->map_style != Atom::MAP_NONE) atom->map_set(); if (domain->triclinic) domain->lamda2x(atom->nlocal); // imbinit = initial imbalance diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 37a4f0ae3d..cf80073316 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -589,7 +589,7 @@ void CommBrick::exchange() // map_set() is done at end of borders() // clear ghost count and any ghost bonus data internal to AtomVec - if (map_style) atom->map_clear(); + if (map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); @@ -864,7 +864,7 @@ void CommBrick::borders() // reset global->local map - if (map_style) atom->map_set(); + if (map_style != Atom::MAP_NONE) atom->map_set(); } /* ---------------------------------------------------------------------- diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index 48c9680d2f..e4f5937a0f 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -777,7 +777,7 @@ void CommTiled::exchange() // map_set() is done at end of borders() // clear ghost count and any ghost bonus data internal to AtomVec - if (map_style) atom->map_clear(); + if (map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); @@ -1163,7 +1163,7 @@ void CommTiled::borders() // reset global->local map - if (map_style) atom->map_set(); + if (map_style != Atom::MAP_NONE) atom->map_set(); } /* ---------------------------------------------------------------------- diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index b100824ea9..57ee9b4acf 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -227,7 +227,7 @@ int ComputeAngleLocal::compute_angles(int flag) for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; - if (molecular == 1) na = num_angle[atom2]; + if (molecular == Atom::MOLECULAR) na = num_angle[atom2]; else { if (molindex[atom2] < 0) continue; imol = molindex[atom2]; @@ -236,7 +236,7 @@ int ComputeAngleLocal::compute_angles(int flag) } for (i = 0; i < na; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (tag[atom2] != angle_atom2[atom2][i]) continue; atype = angle_type[atom2][i]; atom1 = atom->map(angle_atom1[atom2][i]); diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 010e8db627..cb7ed3a4e0 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -268,7 +268,7 @@ int ComputeBondLocal::compute_bonds(int flag) for (atom1 = 0; atom1 < nlocal; atom1++) { if (!(mask[atom1] & groupbit)) continue; - if (molecular == 1) nb = num_bond[atom1]; + if (molecular == Atom::MOLECULAR) nb = num_bond[atom1]; else { if (molindex[atom1] < 0) continue; imol = molindex[atom1]; @@ -277,7 +277,7 @@ int ComputeBondLocal::compute_bonds(int flag) } for (i = 0; i < nb; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { btype = bond_type[atom1][i]; atom2 = atom->map(bond_atom[atom1][i]); } else { diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index ac2c884c3f..26ff17f48e 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -224,7 +224,7 @@ int ComputeDihedralLocal::compute_dihedrals(int flag) for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; - if (molecular == 1) nd = num_dihedral[atom2]; + if (molecular == Atom::MOLECULAR) nd = num_dihedral[atom2]; else { if (molindex[atom2] < 0) continue; imol = molindex[atom2]; @@ -233,7 +233,7 @@ int ComputeDihedralLocal::compute_dihedrals(int flag) } for (i = 0; i < nd; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (tag[atom2] != dihedral_atom2[atom2][i]) continue; atom1 = atom->map(dihedral_atom1[atom2][i]); atom3 = atom->map(dihedral_atom3[atom2][i]); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index e363749b67..187ae93f53 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -143,7 +143,7 @@ int ComputeImproperLocal::compute_impropers(int flag) for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; - if (molecular == 1) ni = num_improper[atom2]; + if (molecular == Atom::MOLECULAR) ni = num_improper[atom2]; else { if (molindex[atom2] < 0) continue; imol = molindex[atom2]; @@ -152,7 +152,7 @@ int ComputeImproperLocal::compute_impropers(int flag) } for (i = 0; i < ni; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (tag[atom2] != improper_atom2[atom2][i]) continue; atom1 = atom->map(improper_atom1[atom2][i]); atom3 = atom->map(improper_atom3[atom2][i]); diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 651e1190b1..7cdc27000c 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -233,7 +233,7 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : // error check - if (atom->molecular == 2 && (kindflag == BOND || kindflag == ANGLE || + if (atom->molecular == Atom::TEMPLATE && (kindflag == BOND || kindflag == ANGLE || kindflag == DIHEDRAL || kindflag == IMPROPER)) error->all(FLERR,"Compute property/local does not (yet) work " "with atom_style template"); diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 7e84e9cce0..ca90cc6996 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -425,7 +425,7 @@ void CreateAtoms::command(int narg, char **arg) // if global map exists, reset it // invoke map_init() b/c atom count has grown - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -511,10 +511,10 @@ void CreateAtoms::command(int narg, char **arg) molecule[ilocal] = moloffset + 1; } } - if (molecular == 2) { + if (molecular == Atom::TEMPLATE) { atom->molindex[ilocal] = 0; atom->molatom[ilocal] = m; - } else if (molecular) { + } else if (molecular != Atom::ATOMIC) { if (onemol->bondflag) for (int j = 0; j < num_bond[ilocal]; j++) bond_atom[ilocal][j] += offset; @@ -585,7 +585,7 @@ void CreateAtoms::command(int narg, char **arg) // only if onemol added bonds but not special info if (mode == MOLECULE) { - if (atom->molecular == 1 && onemol->bondflag && !onemol->specialflag) { + if (atom->molecular == Atom::MOLECULAR && onemol->bondflag && !onemol->specialflag) { Special special(lmp); special.build(); diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 8baee645cf..53d78602dc 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -116,7 +116,7 @@ void DeleteAtoms::command(int narg, char **arg) // set all atom IDs to 0, call tag_extend() if (compress_flag) { - if (atom->molecular == 0) { + if (atom->molecular == Atom::ATOMIC) { tagint *tag = atom->tag; int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) tag[i] = 0; @@ -159,7 +159,7 @@ void DeleteAtoms::command(int narg, char **arg) // reset atom->map if it exists // set nghost to 0 so old ghosts of deleted atoms won't be mapped - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); @@ -522,7 +522,7 @@ void DeleteAtoms::delete_molecule() /* ---------------------------------------------------------------------- update bond,angle,etc counts - different for atom->molecular = 1 or 2 + different for atom->molecular = Atom::MOLECULAR or Atom::TEMPLATE ------------------------------------------------------------------------- */ void DeleteAtoms::recount_topology() @@ -532,7 +532,7 @@ void DeleteAtoms::recount_topology() bigint ndihedrals = 0; bigint nimpropers = 0; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { int *num_bond = atom->num_bond; int *num_angle = atom->num_angle; int *num_dihedral = atom->num_dihedral; @@ -546,7 +546,7 @@ void DeleteAtoms::recount_topology() if (num_improper) nimpropers += num_improper[i]; } - } else if (atom->molecular == 2) { + } else if (atom->molecular == Atom::TEMPLATE) { Molecule **onemols = atom->avec->onemols; int *molindex = atom->molindex; int *molatom = atom->molatom; @@ -742,10 +742,10 @@ void DeleteAtoms::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"bond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal delete_atoms command"); - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Cannot delete_atoms bond yes for " "non-molecular systems"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Cannot use delete_atoms bond yes with " "atom_style template"); if (strcmp(arg[iarg+1],"yes") == 0) bond_flag = 1; diff --git a/src/domain.cpp b/src/domain.cpp index 984c735a20..759f5d74a5 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -768,7 +768,7 @@ void Domain::image_check() int flag = 0; for (i = 0; i < nlocal; i++) { - if (molecular == 1) n = num_bond[i]; + if (molecular == Atom::MOLECULAR) n = num_bond[i]; else { if (molindex[i] < 0) continue; imol = molindex[i]; @@ -777,7 +777,7 @@ void Domain::image_check() } for (j = 0; j < n; j++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (bond_type[i][j] <= 0) continue; k = atom->map(bond_atom[i][j]); } else { @@ -867,7 +867,7 @@ void Domain::box_too_small_check() int nmissing = 0; for (i = 0; i < nlocal; i++) { - if (molecular == 1) n = num_bond[i]; + if (molecular == Atom::MOLECULAR) n = num_bond[i]; else { if (molindex[i] < 0) continue; imol = molindex[i]; @@ -876,7 +876,7 @@ void Domain::box_too_small_check() } for (j = 0; j < n; j++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (bond_type[i][j] <= 0) continue; k = atom->map(bond_atom[i][j]); } else { diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 96a338950b..a4c6fd8205 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -952,7 +952,7 @@ void DumpImage::create_image() for (i = 0; i < nchoose; i++) { atom1 = clist[i]; - if (molecular == 1) n = num_bond[atom1]; + if (molecular == Atom::MOLECULAR) n = num_bond[atom1]; else { if (molindex[atom1] < 0) continue; imol = molindex[atom1]; @@ -961,7 +961,7 @@ void DumpImage::create_image() } for (m = 0; m < n; m++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { btype = bond_type[atom1][m]; atom2 = atom->map(bond_atom[atom1][m]); } else { diff --git a/src/finish.cpp b/src/finish.cpp index 3bfe3a7bbf..783bb6f855 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -555,14 +555,14 @@ void Finish::end(int flag) int nspec; double nspec_all = 0; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { int **nspecial = atom->nspecial; int nlocal = atom->nlocal; nspec = 0; for (i = 0; i < nlocal; i++) nspec += nspecial[i][2]; tmp = nspec; MPI_Allreduce(&tmp,&nspec_all,1,MPI_DOUBLE,MPI_SUM,world); - } else if (atom->molecular == 2) { + } else if (atom->molecular == Atom::TEMPLATE) { Molecule **onemols = atom->avec->onemols; int *molindex = atom->molindex; int *molatom = atom->molatom; diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index da009c55d5..4cbd284317 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -194,7 +194,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // zero the array since dump may access it on timestep 0 // zero the array since a variable may access it before first run @@ -221,7 +221,7 @@ FixAveAtom::~FixAveAtom() { // unregister callback to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete [] which; delete [] argindex; diff --git a/src/fix_external.cpp b/src/fix_external.cpp index 1db7e15295..e31092fd07 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -59,7 +59,7 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); user_energy = 0.0; @@ -75,7 +75,7 @@ FixExternal::~FixExternal() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(fexternal); delete [] caller_vector; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 9d0b5f28f1..5f67d5d77a 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -178,7 +178,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : if (gjfflag) { grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize franprev to zero @@ -211,7 +211,7 @@ FixLangevin::~FixLangevin() if (gjfflag) { memory->destroy(franprev); memory->destroy(lv); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); } } diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 93b13fac49..a8e1e4834e 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -28,7 +28,7 @@ FixMinimize::FixMinimize(LAMMPS *lmp, int narg, char **arg) : // register callback to this fix from Atom class // don't perform initial allocation here, must wait until add_vector() - atom->add_callback(0); + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -37,7 +37,7 @@ FixMinimize::~FixMinimize() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored data diff --git a/src/fix_move.cpp b/src/fix_move.cpp index d6f61af091..582c0877de 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -256,8 +256,8 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); displace = velocity = NULL; @@ -334,8 +334,8 @@ FixMove::~FixMove() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 43415a6ef5..cf0b9b49b2 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -63,8 +63,8 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : // register with atom class grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); pgsize = oneatom = 0; @@ -99,8 +99,8 @@ FixNeighHistory::~FixNeighHistory() // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 145d60e8df..9f4c0ed630 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -64,7 +64,7 @@ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : maxatom = 0; - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix numdiff requires an atom map, see atom_modify"); // perform initial allocation of atom-based arrays diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 07108721c4..c20a9dc029 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -136,9 +136,9 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : nmax_old = 0; if (!lmp->kokkos) grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); - if (border) atom->add_callback(2); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); + if (border) atom->add_callback(Atom::BORDER); } /* ---------------------------------------------------------------------- */ @@ -147,9 +147,9 @@ FixPropertyAtom::~FixPropertyAtom() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); - if (border) atom->delete_callback(id,2); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); + if (border) atom->delete_callback(id,Atom::BORDER); // deallocate per-atom vectors in Atom class // set ptrs to NULL, so they no longer exist for Atom class @@ -211,7 +211,7 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, char *next; int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 2e10b15ffa..7fa799c04a 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -32,7 +32,7 @@ FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // extra = copy of atom->extra @@ -54,7 +54,7 @@ FixReadRestart::~FixReadRestart() { // unregister callback to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index b116f8ccac..0c71912ffa 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -44,7 +44,7 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : f_level = NULL; t_level = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ FixRespa::~FixRespa() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 4f675bf7bf..266b0c60e1 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -150,7 +150,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : // require atom map to lookup atom IDs - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix restrain requires an atom map, see atom_modify"); } diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 8e7b3eb925..54e20ca285 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -72,8 +72,8 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : xoriginal = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // xoriginal = initial unwrapped positions of atoms @@ -96,8 +96,8 @@ FixSpringSelf::~FixSpringSelf() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored array diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 3eb2075250..adb0985ff2 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -82,8 +82,8 @@ vstore(NULL), astore(NULL), rbuf(NULL) } if (flavor == PERATOM) { grow_arrays(atom->nmax); - atom->add_callback(0); - if (restart_peratom) atom->add_callback(1); + atom->add_callback(Atom::GROW); + if (restart_peratom) atom->add_callback(Atom::RESTART); rbuf = NULL; } @@ -117,8 +117,8 @@ FixStore::~FixStore() // unregister callbacks to this fix from Atom class if (flavor == PERATOM) { - atom->delete_callback(id,0); - if (restart_peratom) atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + if (restart_peratom) atom->delete_callback(id,Atom::RESTART); } memory->destroy(vstore); diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index fd4563b7ad..de76276905 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -350,8 +350,8 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : values = NULL; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // zero the array since dump may access it on timestep 0 // zero the array since a variable may access it before first run @@ -375,8 +375,8 @@ FixStoreState::~FixStoreState() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); delete [] which; delete [] argindex; diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 12e36d890e..74273ea69e 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -57,11 +57,11 @@ nfileevery(0), fp(NULL), xf(NULL), xold(NULL) // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // make sure an atom map exists before reading in target coordinates - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use fix TMD unless atom map exists"); // read from arg[4] and store coordinates of final target in xf @@ -128,7 +128,7 @@ FixTMD::~FixTMD() // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/info.cpp b/src/info.cpp index 87161e9ca5..3d91d01f72 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -393,7 +393,7 @@ void Info::command(int narg, char **arg) fmt::print(out,"Atom map = {}\n", mapstyles[atom->map_style]); if (atom->molecular > 0) { const char *msg; - msg = (atom->molecular == 2) ? "template" : "standard"; + msg = (atom->molecular == Atom::TEMPLATE) ? "template" : "standard"; fmt::print(out,"Molecule type = {}\n",msg); } fmt::print(out,"Atoms = {:12}, types = {:8d}, style = {}\n", diff --git a/src/input.cpp b/src/input.cpp index 6456f6c229..0a5286d83e 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1791,7 +1791,7 @@ void Input::special_bonds() // if simulation box defined and saved values changed, redo special list - if (domain->box_exist && atom->molecular == 1) { + if (domain->box_exist && atom->molecular == Atom::MOLECULAR) { if (lj2 != force->special_lj[2] || lj3 != force->special_lj[3] || coul2 != force->special_coul[2] || coul3 != force->special_coul[3] || angle != force->special_angle || diff --git a/src/library.cpp b/src/library.cpp index 72105bdd15..3fd8a18946 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1273,7 +1273,7 @@ int lammps_create_atoms(void *handle, int n, tagint *id, int *type, // if global map exists, reset it // invoke map_init() b/c atom count has grown - if (lmp->atom->map_style) { + if (lmp->atom->map_style != Atom::MAP_NONE) { lmp->atom->map_init(); lmp->atom->map_set(); } @@ -2252,7 +2252,7 @@ void lammps_scatter_atoms(void *handle, char *name, if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1; if (lmp->atom->natoms > MAXSMALLINT) flag = 1; - if (lmp->atom->map_style == 0) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; if (flag) { if (lmp->comm->me == 0) lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms"); @@ -2382,7 +2382,7 @@ void lammps_scatter_atoms_subset(void *handle, char *name, int flag = 0; if (lmp->atom->tag_enable == 0) flag = 1; if (lmp->atom->natoms > MAXSMALLINT) flag = 1; - if (lmp->atom->map_style == 0) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; if (flag) { if (lmp->comm->me == 0) lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms_subset"); @@ -3228,7 +3228,7 @@ void lammps_scatter(void *ptr, char *name, if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1; if (lmp->atom->natoms > MAXSMALLINT) flag = 1; - if (lmp->atom->map_style == 0) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; if (flag) { if (lmp->comm->me == 0) lmp->error->warning(FLERR,"Library error in lammps_scatter"); @@ -3432,7 +3432,7 @@ void lammps_scatter_subset(void *ptr, char *name, int flag = 0; if (lmp->atom->tag_enable == 0) flag = 1; if (lmp->atom->natoms > MAXSMALLINT) flag = 1; - if (lmp->atom->map_style == 0) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; if (flag) { if (lmp->comm->me == 0) lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms_subset"); diff --git a/src/molecule.cpp b/src/molecule.cpp index 0d81f49a50..7cc4707c8a 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -1655,7 +1655,7 @@ void Molecule::check_attributes(int flag) // for molecular atom styles, check bond_per_atom,etc + maxspecial // do not check for atom style template, since nothing stored per atom - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow && atom->bond_per_atom < onemol->bond_per_atom) mismatch = 1; if (atom->avec->angles_allow && diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 66ab92496a..56e56d50b0 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -1300,7 +1300,7 @@ void Neighbor::init_topology() // set flags that determine which topology neighbor classes to use // these settings could change from run to run, depending on fixes defined - // bonds,etc can only be broken for atom->molecular = 1, not 2 + // bonds,etc can only be broken for atom->molecular = Atom::MOLECULAR, not Atom::TEMPLATE // SHAKE sets bonds and angles negative // gcmc sets all bonds, angles, etc negative // bond_quartic sets bonds to 0 @@ -1314,7 +1314,7 @@ void Neighbor::init_topology() bond_off = angle_off = 1; if (force->bond && force->bond_match("quartic")) bond_off = 1; - if (atom->avec->bonds_allow && atom->molecular == 1) { + if (atom->avec->bonds_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (bond_off) break; for (m = 0; m < atom->num_bond[i]; m++) @@ -1322,7 +1322,7 @@ void Neighbor::init_topology() } } - if (atom->avec->angles_allow && atom->molecular == 1) { + if (atom->avec->angles_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (angle_off) break; for (m = 0; m < atom->num_angle[i]; m++) @@ -1331,7 +1331,7 @@ void Neighbor::init_topology() } int dihedral_off = 0; - if (atom->avec->dihedrals_allow && atom->molecular == 1) { + if (atom->avec->dihedrals_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (dihedral_off) break; for (m = 0; m < atom->num_dihedral[i]; m++) @@ -1340,7 +1340,7 @@ void Neighbor::init_topology() } int improper_off = 0; - if (atom->avec->impropers_allow && atom->molecular == 1) { + if (atom->avec->impropers_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (improper_off) break; for (m = 0; m < atom->num_improper[i]; m++) @@ -1367,7 +1367,7 @@ void Neighbor::init_topology() if (atom->avec->bonds_allow) { int old_bondwhich = bondwhich; - if (atom->molecular == 2) bondwhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) bondwhich = TEMPLATE; else if (bond_off) bondwhich = PARTIAL; else bondwhich = ALL; if (!neigh_bond || bondwhich != old_bondwhich) { @@ -1383,7 +1383,7 @@ void Neighbor::init_topology() if (atom->avec->angles_allow) { int old_anglewhich = anglewhich; - if (atom->molecular == 2) anglewhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) anglewhich = TEMPLATE; else if (angle_off) anglewhich = PARTIAL; else anglewhich = ALL; if (!neigh_angle || anglewhich != old_anglewhich) { @@ -1399,7 +1399,7 @@ void Neighbor::init_topology() if (atom->avec->dihedrals_allow) { int old_dihedralwhich = dihedralwhich; - if (atom->molecular == 2) dihedralwhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) dihedralwhich = TEMPLATE; else if (dihedral_off) dihedralwhich = PARTIAL; else dihedralwhich = ALL; if (!neigh_dihedral || dihedralwhich != old_dihedralwhich) { @@ -1415,7 +1415,7 @@ void Neighbor::init_topology() if (atom->avec->impropers_allow) { int old_improperwhich = improperwhich; - if (atom->molecular == 2) improperwhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) improperwhich = TEMPLATE; else if (improper_off) improperwhich = PARTIAL; else improperwhich = ALL; if (!neigh_improper || improperwhich != old_improperwhich) { @@ -1799,7 +1799,7 @@ int Neighbor::choose_pair(NeighRequest *rq) // if molecular on, do not match ATOMONLY (b/c a MOLONLY Npair exists) // if molecular off, do not match MOLONLY (b/c an ATOMONLY Npair exists) - if (molecular) { + if (molecular != Atom::ATOMIC) { if (mask & NP_ATOMONLY) continue; } else if (!molecular) { if (mask & NP_MOLONLY) continue; diff --git a/src/npair_full_bin.cpp b/src/npair_full_bin.cpp index 464dca9251..d1eecb7832 100644 --- a/src/npair_full_bin.cpp +++ b/src/npair_full_bin.cpp @@ -51,7 +51,7 @@ void NPairFullBin::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -94,7 +94,7 @@ void NPairFullBin::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_bin_ghost.cpp b/src/npair_full_bin_ghost.cpp index 61b27dd99d..6ea7e018dc 100644 --- a/src/npair_full_bin_ghost.cpp +++ b/src/npair_full_bin_ghost.cpp @@ -53,7 +53,7 @@ void NPairFullBinGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -100,7 +100,7 @@ void NPairFullBinGhost::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_multi.cpp b/src/npair_full_multi.cpp index 40ed2275be..316e61afbb 100644 --- a/src/npair_full_multi.cpp +++ b/src/npair_full_multi.cpp @@ -53,7 +53,7 @@ void NPairFullMulti::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -101,7 +101,7 @@ void NPairFullMulti::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_nsq.cpp b/src/npair_full_nsq.cpp index 76b66fd004..9ce3885eaf 100644 --- a/src/npair_full_nsq.cpp +++ b/src/npair_full_nsq.cpp @@ -56,7 +56,7 @@ void NPairFullNsq::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -95,7 +95,7 @@ void NPairFullNsq::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_nsq_ghost.cpp b/src/npair_full_nsq_ghost.cpp index b20fa9b8ce..3b42b73ece 100644 --- a/src/npair_full_nsq_ghost.cpp +++ b/src/npair_full_nsq_ghost.cpp @@ -52,7 +52,7 @@ void NPairFullNsqGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -94,7 +94,7 @@ void NPairFullNsqGhost::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newtoff.cpp b/src/npair_half_bin_newtoff.cpp index 65768918c9..4670d9c1d0 100644 --- a/src/npair_half_bin_newtoff.cpp +++ b/src/npair_half_bin_newtoff.cpp @@ -53,7 +53,7 @@ void NPairHalfBinNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -98,7 +98,7 @@ void NPairHalfBinNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newtoff_ghost.cpp b/src/npair_half_bin_newtoff_ghost.cpp index 91fbf049cb..003b083cb4 100644 --- a/src/npair_half_bin_newtoff_ghost.cpp +++ b/src/npair_half_bin_newtoff_ghost.cpp @@ -57,7 +57,7 @@ void NPairHalfBinNewtoffGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -106,7 +106,7 @@ void NPairHalfBinNewtoffGhost::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newton.cpp b/src/npair_half_bin_newton.cpp index fe388e1144..d8ced569ae 100644 --- a/src/npair_half_bin_newton.cpp +++ b/src/npair_half_bin_newton.cpp @@ -52,7 +52,7 @@ void NPairHalfBinNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -99,7 +99,7 @@ void NPairHalfBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -130,7 +130,7 @@ void NPairHalfBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newton_tri.cpp b/src/npair_half_bin_newton_tri.cpp index 1f0e3c1187..7745b99e39 100644 --- a/src/npair_half_bin_newton_tri.cpp +++ b/src/npair_half_bin_newton_tri.cpp @@ -52,7 +52,7 @@ void NPairHalfBinNewtonTri::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -104,7 +104,7 @@ void NPairHalfBinNewtonTri::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_multi_newtoff.cpp b/src/npair_half_multi_newtoff.cpp index 57dcf29cc7..d9db19d5f6 100644 --- a/src/npair_half_multi_newtoff.cpp +++ b/src/npair_half_multi_newtoff.cpp @@ -55,7 +55,7 @@ void NPairHalfMultiNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -105,7 +105,7 @@ void NPairHalfMultiNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_multi_newton.cpp b/src/npair_half_multi_newton.cpp index a9293d3d64..8d6adce3e1 100644 --- a/src/npair_half_multi_newton.cpp +++ b/src/npair_half_multi_newton.cpp @@ -54,7 +54,7 @@ void NPairHalfMultiNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -101,7 +101,7 @@ void NPairHalfMultiNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -138,7 +138,7 @@ void NPairHalfMultiNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_multi_newton_tri.cpp b/src/npair_half_multi_newton_tri.cpp index c1d845cb38..ac7372466d 100644 --- a/src/npair_half_multi_newton_tri.cpp +++ b/src/npair_half_multi_newton_tri.cpp @@ -54,7 +54,7 @@ void NPairHalfMultiNewtonTri::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -113,7 +113,7 @@ void NPairHalfMultiNewtonTri::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_nsq_newtoff.cpp b/src/npair_half_nsq_newtoff.cpp index db369687d0..f278ebe78b 100644 --- a/src/npair_half_nsq_newtoff.cpp +++ b/src/npair_half_nsq_newtoff.cpp @@ -57,7 +57,7 @@ void NPairHalfNsqNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -96,7 +96,7 @@ void NPairHalfNsqNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_nsq_newtoff_ghost.cpp b/src/npair_half_nsq_newtoff_ghost.cpp index 0a9b6d0f45..a8f907608b 100644 --- a/src/npair_half_nsq_newtoff_ghost.cpp +++ b/src/npair_half_nsq_newtoff_ghost.cpp @@ -59,7 +59,7 @@ void NPairHalfNsqNewtoffGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -105,7 +105,7 @@ void NPairHalfNsqNewtoffGhost::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_nsq_newton.cpp b/src/npair_half_nsq_newton.cpp index 69489915b2..98a4fd8108 100644 --- a/src/npair_half_nsq_newton.cpp +++ b/src/npair_half_nsq_newton.cpp @@ -57,7 +57,7 @@ void NPairHalfNsqNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -113,7 +113,7 @@ void NPairHalfNsqNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_bin_newtoff.cpp b/src/npair_half_respa_bin_newtoff.cpp index 8c1d8d684f..699ea015c3 100644 --- a/src/npair_half_respa_bin_newtoff.cpp +++ b/src/npair_half_respa_bin_newtoff.cpp @@ -54,7 +54,7 @@ void NPairHalfRespaBinNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -122,7 +122,7 @@ void NPairHalfRespaBinNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_bin_newton.cpp b/src/npair_half_respa_bin_newton.cpp index d2598fa1a4..b86e9acb98 100644 --- a/src/npair_half_respa_bin_newton.cpp +++ b/src/npair_half_respa_bin_newton.cpp @@ -53,7 +53,7 @@ void NPairHalfRespaBinNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -124,7 +124,7 @@ void NPairHalfRespaBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -168,7 +168,7 @@ void NPairHalfRespaBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_bin_newton_tri.cpp b/src/npair_half_respa_bin_newton_tri.cpp index efe48d48e1..a8cb061d36 100644 --- a/src/npair_half_respa_bin_newton_tri.cpp +++ b/src/npair_half_respa_bin_newton_tri.cpp @@ -54,7 +54,7 @@ void NPairHalfRespaBinNewtonTri::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -130,7 +130,7 @@ void NPairHalfRespaBinNewtonTri::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_nsq_newtoff.cpp b/src/npair_half_respa_nsq_newtoff.cpp index 334ebb5ca8..e888ca5496 100644 --- a/src/npair_half_respa_nsq_newtoff.cpp +++ b/src/npair_half_respa_nsq_newtoff.cpp @@ -58,7 +58,7 @@ void NPairHalfRespaNsqNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -120,7 +120,7 @@ void NPairHalfRespaNsqNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_nsq_newton.cpp b/src/npair_half_respa_nsq_newton.cpp index 7ecd02b0c5..bbb434b59c 100644 --- a/src/npair_half_respa_nsq_newton.cpp +++ b/src/npair_half_respa_nsq_newton.cpp @@ -60,7 +60,7 @@ void NPairHalfRespaNsqNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -139,7 +139,7 @@ void NPairHalfRespaNsqNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/read_data.cpp b/src/read_data.cpp index 2a6801b3a5..4f3770aca4 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -773,14 +773,14 @@ void ReadData::command(int narg, char **arg) // create special bond lists for molecular systems - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } // for atom style template systems, count total bonds,angles,etc - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { Molecule **onemols = atom->avec->onemols; int *molindex = atom->molindex; int *molatom = atom->molatom; @@ -831,7 +831,7 @@ void ReadData::command(int narg, char **arg) // insure nbondtypes,etc are still consistent with template molecules, // in case data file re-defined them - if (atom->molecular == 2) atom->avec->onemols[0]->check_attributes(1); + if (atom->molecular == Atom::TEMPLATE) atom->avec->onemols[0]->check_attributes(1); // if adding atoms, migrate atoms to new processors // use irregular() b/c box size could have changed dramaticaly @@ -1183,7 +1183,7 @@ void ReadData::header(int firstpass) if (atom->nimpropers > 0 && atom->nimpropertypes <= 0) error->all(FLERR,"Impropers defined but no improper types"); - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { if (atom->nbonds || atom->nangles || atom->ndihedrals || atom->nimpropers) error->all(FLERR,"No molecule topology allowed with atom style template"); } @@ -1231,7 +1231,7 @@ void ReadData::atoms() // create global mapping of atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -1249,7 +1249,7 @@ void ReadData::velocities() if (me == 0) utils::logmesg(lmp," reading velocities ...\n"); int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -1267,7 +1267,7 @@ void ReadData::velocities() if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } if (me == 0) utils::logmesg(lmp,fmt::format(" {} velocities\n",natoms)); @@ -1579,7 +1579,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) int nchunk,eof; int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -1598,7 +1598,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } if (me == 0) @@ -1618,7 +1618,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) char *eof; int mapflag = 0; - if (atom->map_style == 0 && firstpass) { + if (atom->map_style == Atom::MAP_NONE && firstpass) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -1702,7 +1702,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) if (mapflag && firstpass) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } if (me == 0 && firstpass) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 10218fe617..8a4cbf0586 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -597,7 +597,7 @@ void ReadDump::atoms() // if purgeflag set, delete all current atoms if (purgeflag) { - if (atom->map_style) atom->map_clear(); + if (atom->map_style != Atom::MAP_NONE) atom->map_clear(); npurge = atom->nlocal; atom->nlocal = atom->nghost = 0; atom->natoms = 0; @@ -622,7 +622,7 @@ void ReadDump::atoms() // this will be needed to match new atoms to old atoms int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -643,7 +643,7 @@ void ReadDump::atoms() if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } else { atom->nghost = 0; atom->map_init(); diff --git a/src/read_restart.cpp b/src/read_restart.cpp index dcab9f834c..d321352332 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -431,7 +431,7 @@ void ReadRestart::command(int narg, char **arg) // in case read by different proc than wrote restart file // first do map_init() since irregular->migrate_atoms() will do map_clear() - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -493,14 +493,14 @@ void ReadRestart::command(int narg, char **arg) // create global mapping of atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } // create special bond lists for molecular systems - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } diff --git a/src/replicate.cpp b/src/replicate.cpp index 374d7113b2..19f3fd0bc9 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -591,7 +591,7 @@ void Replicate::command(int narg, char **arg) if (atom->molecular) { if (atom->molecule[i] > 0) atom->molecule[i] += mol_offset; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow) for (j = 0; j < atom->num_bond[i]; j++) atom->bond_atom[i][j] += atom_offset; @@ -693,7 +693,7 @@ void Replicate::command(int narg, char **arg) if (atom->molecular) { if (atom->molecule[i] > 0) atom->molecule[i] += mol_offset; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow) for (j = 0; j < atom->num_bond[i]; j++) atom->bond_atom[i][j] += atom_offset; @@ -766,14 +766,14 @@ void Replicate::command(int narg, char **arg) // create global mapping of atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } // create special bond lists for molecular systems - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } diff --git a/src/reset_atom_ids.cpp b/src/reset_atom_ids.cpp index 406df7e608..bf642533d5 100644 --- a/src/reset_atom_ids.cpp +++ b/src/reset_atom_ids.cpp @@ -78,7 +78,7 @@ void ResetIDs::command(int narg, char **arg) // create an atom map if one doesn't exist already int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->nghost = 0; atom->map_init(); @@ -138,12 +138,12 @@ void ResetIDs::command(int narg, char **arg) comm->forward_comm_array(1,newIDs); // loop over bonds, angles, etc and reset IDs in stored topology arrays - // only necessary for molecular = 1, not molecular = 2 + // only necessary for molecular = Atom::MOLECULAR, not molecular = Atom::TEMPLATE // badcount = atom IDs that could not be found int badcount = 0; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { int j,m; tagint oldID; @@ -266,7 +266,7 @@ void ResetIDs::command(int narg, char **arg) // need to update exclusions with new atom IDs - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } @@ -275,7 +275,7 @@ void ResetIDs::command(int narg, char **arg) if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } // clean up diff --git a/src/set.cpp b/src/set.cpp index 3b2cd44ad0..83bfb99968 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -1254,7 +1254,7 @@ void Set::topology(int keyword) // error check - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Cannot set bond topology types for atom style template"); // border swap to acquire ghost atom info diff --git a/src/variable.cpp b/src/variable.cpp index 8d4416dfa7..b935516ff1 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -4525,7 +4525,7 @@ void Variable::peratom2global(int flag, char *word, // error check for ID larger than any atom // int_between_brackets() already checked for ID <= 0 - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR, "Indexed per-atom vector in variable formula without atom map"); @@ -5087,7 +5087,7 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : buffer = NULL; if (style == ATOMFILE) { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use atomfile-style " "variable unless an atom map exists"); diff --git a/src/velocity.cpp b/src/velocity.cpp index eafa98cb7c..94a5081e39 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -252,7 +252,7 @@ void Velocity::create(double t_desired, int seed) // create an atom map if one doesn't exist already int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->nghost = 0; atom->map_init(); @@ -304,7 +304,7 @@ void Velocity::create(double t_desired, int seed) if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } } else if (loop_flag == LOCAL) { diff --git a/src/write_data.cpp b/src/write_data.cpp index 53d277b723..34d45ccde6 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -152,21 +152,21 @@ void WriteData::write(const std::string &file) // sum up bond,angle,dihedral,improper counts // may be different than atom->nbonds,nangles, etc. if broken/turned-off - if (atom->molecular == 1 && (atom->nbonds || atom->nbondtypes)) { + if (atom->molecular == Atom::MOLECULAR && (atom->nbonds || atom->nbondtypes)) { nbonds_local = atom->avec->pack_bond(NULL); MPI_Allreduce(&nbonds_local,&nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world); } - if (atom->molecular == 1 && (atom->nangles || atom->nangletypes)) { + if (atom->molecular == Atom::MOLECULAR && (atom->nangles || atom->nangletypes)) { nangles_local = atom->avec->pack_angle(NULL); MPI_Allreduce(&nangles_local,&nangles,1,MPI_LMP_BIGINT,MPI_SUM,world); } - if (atom->molecular == 1 && (atom->ndihedrals || atom->ndihedraltypes)) { + if (atom->molecular == Atom::MOLECULAR && (atom->ndihedrals || atom->ndihedraltypes)) { ndihedrals_local = atom->avec->pack_dihedral(NULL); MPI_Allreduce(&ndihedrals_local,&ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world); } - if (atom->molecular == 1 && (atom->nimpropers || atom->nimpropertypes)) { + if (atom->molecular == Atom::MOLECULAR && (atom->nimpropers || atom->nimpropertypes)) { nimpropers_local = atom->avec->pack_improper(NULL); MPI_Allreduce(&nimpropers_local,&nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); } @@ -196,7 +196,7 @@ void WriteData::write(const std::string &file) // molecular topology info if defined // do not write molecular topology for atom_style template - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->nbonds && nbonds) bonds(); if (atom->nangles && nangles) angles(); if (atom->ndihedrals) dihedrals(); @@ -235,7 +235,7 @@ void WriteData::header() // do not write molecular topology info for atom_style template - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->nbonds || atom->nbondtypes) fmt::print(fp,"{} bonds\n{} bond types\n", nbonds,atom->nbondtypes);