rename fix STORE/PERATOM to STORE/ATOM
This commit is contained in:
@ -11,6 +11,7 @@ Available topics are:
|
||||
|
||||
- `Reading and parsing of text and text files`_
|
||||
- `Requesting and accessing neighbor lists`_
|
||||
- `Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM`_
|
||||
- `Fix contributions to instantaneous energy, virial, and cumulative energy`_
|
||||
- `KSpace PPPM FFT grids`_
|
||||
|
||||
@ -216,6 +217,30 @@ command:
|
||||
|
||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||
|
||||
Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
There are multiple ways to manage per-atom data within LAMMPS. Often
|
||||
the per-atom storage is only used locally and managed by the class that
|
||||
uses it. If the data has to persist between multiple time steps and
|
||||
migrate with atoms when they move from sub-domain to sub-domain or
|
||||
across periodic boundaries, then using a custom atom style, or :doc:`fix
|
||||
property/atom <fix_property_atom>`, or the internal fix STORE/ATOM are
|
||||
possible options.
|
||||
|
||||
- Using the atom style is usually the most programming effort and mostly
|
||||
needed when the per-atom data is an integral part of the model like a
|
||||
per-atom charge or diameter and thus should be part of the Atoms
|
||||
section of a :doc:`data file <read_data>`.
|
||||
|
||||
- Fix property/atom is useful if the data is optional or should be
|
||||
entered by the user, or accessed as a (named) custom property. In this
|
||||
case the fix should be entered as part of the input (and not
|
||||
internally) which allows to enter and store its content with data files.
|
||||
|
||||
- Fix STORE/ATOM should be used when the data should be accessed internally
|
||||
only and thus the fix can be created internally.
|
||||
|
||||
Fix contributions to instantaneous energy, virial, and cumulative energy
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ Available topics in mostly chronological order are:
|
||||
- `Use of "override" instead of "virtual"`_
|
||||
- `Simplified and more compact neighbor list requests`_
|
||||
- `Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM`_
|
||||
- `Rename of fix STORE/PERATOM to fix STORE/ATOM and change of arguments`_
|
||||
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
|
||||
- `Refactored grid communication using Grid3d/Grid2d classes instead of GridComm`_
|
||||
|
||||
@ -385,6 +386,34 @@ New:
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
|
||||
Rename of fix STORE/PERATOM to fix STORE/ATOM and change of arguments
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: TBD
|
||||
|
||||
The available functionality of the internal fix to store per-atom
|
||||
properties was expanded to enable storing data with ghost atoms and to
|
||||
support binary restart files. With those changes, the fix was renamed
|
||||
to fix STORE/ATOM and the number and order of (required) arguments has
|
||||
changed.
|
||||
|
||||
Old syntax: ``ID group-ID STORE/PERATOM rflag n1 n2 [n3]``
|
||||
|
||||
- *rflag* = 0/1, *no*/*yes* store per-atom values in restart file
|
||||
- :math:`n1 = 1, n2 = 1, \mathrm{no}\;n3 \to` per-atom vector, single value per atom
|
||||
- :math:`n1 = 1, n2 > 1, \mathrm{no}\;n3 \to` per-atom array, *n2* values per atom
|
||||
- :math:`n1 = 1, n2 > 0, n3 > 0 \to` per-atom tensor, *n2* x *n3* values per atom
|
||||
|
||||
New syntax: ``ID group-ID STORE/ATOM n1 n2 gflag rflag``
|
||||
|
||||
- :math:`n1 = 1, n2 = 0 \to` per-atom vector, single value per atom
|
||||
- :math:`n1 > 1, n2 = 0 \to` per-atom array, *n1* values per atom
|
||||
- :math:`n1 > 0, n2 > 0 \to` per-atom tensor, *n1* x *n2* values per atom
|
||||
- *gflag* = 0/1, *no*/*yes* communicate per-atom values with ghost atoms
|
||||
- *rflag* = 0/1, *no*/*yes* store per-atom values in restart file
|
||||
|
||||
Since this is an internal fix, there is no user visible change.
|
||||
|
||||
Use Output::get_dump_by_id() instead of Output::find_dump()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "math_const.h"
|
||||
#include "math_special.h"
|
||||
#include "my_page.h"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "neigh_list.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "group.h"
|
||||
#include "math_special.h"
|
||||
@ -861,8 +861,8 @@ void PairAmoeba::init_style()
|
||||
Fix *myfix;
|
||||
if (first_flag) {
|
||||
id_pole = utils::strdup("AMOEBA_pole");
|
||||
myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM 13 0 0 1",id_pole,group->names[0]));
|
||||
fixpole = dynamic_cast<FixStorePeratom *>(myfix);
|
||||
myfix = modify->add_fix(fmt::format("{} {} STORE/ATOM 13 0 0 1",id_pole,group->names[0]));
|
||||
fixpole = dynamic_cast<FixStoreAtom *>(myfix);
|
||||
}
|
||||
|
||||
// creation of per-atom storage
|
||||
@ -873,14 +873,14 @@ void PairAmoeba::init_style()
|
||||
|
||||
if (first_flag && use_pred) {
|
||||
id_udalt = utils::strdup("AMOEBA_udalt");
|
||||
myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM {} 3 0 1",
|
||||
myfix = modify->add_fix(fmt::format("{} {} STORE/ATOM {} 3 0 1",
|
||||
id_udalt, group->names[0], maxualt));
|
||||
fixudalt = dynamic_cast<FixStorePeratom *>(myfix);
|
||||
fixudalt = dynamic_cast<FixStoreAtom *>(myfix);
|
||||
|
||||
id_upalt = utils::strdup("AMOEBA_upalt");
|
||||
myfix = modify->add_fix(fmt::format("{} {} STORE/PERATOM {} 3 0 1",
|
||||
myfix = modify->add_fix(fmt::format("{} {} STORE/ATOM {} 3 0 1",
|
||||
id_upalt, group->names[0], maxualt));
|
||||
fixupalt = dynamic_cast<FixStorePeratom *>(myfix);
|
||||
fixupalt = dynamic_cast<FixStoreAtom *>(myfix);
|
||||
}
|
||||
|
||||
// create pages for storing pairwise data:
|
||||
@ -995,21 +995,21 @@ void PairAmoeba::init_style()
|
||||
if (id_pole) {
|
||||
myfix = modify->get_fix_by_id(id_pole);
|
||||
if (!myfix)
|
||||
error->all(FLERR,"Could not find internal pair amoeba fix STORE/PERATOM id {}", id_pole);
|
||||
fixpole = dynamic_cast<FixStorePeratom *>(myfix);
|
||||
error->all(FLERR,"Could not find internal pair amoeba fix STORE/ATOM id {}", id_pole);
|
||||
fixpole = dynamic_cast<FixStoreAtom *>(myfix);
|
||||
|
||||
}
|
||||
|
||||
if (id_udalt) {
|
||||
myfix = modify->get_fix_by_id(id_udalt);
|
||||
if (!myfix)
|
||||
error->all(FLERR,"Could not find internal pair amoeba fix STORE/PERATOM id {}", id_udalt);
|
||||
fixudalt = dynamic_cast<FixStorePeratom *>(myfix);
|
||||
error->all(FLERR,"Could not find internal pair amoeba fix STORE/ATOM id {}", id_udalt);
|
||||
fixudalt = dynamic_cast<FixStoreAtom *>(myfix);
|
||||
|
||||
myfix = modify->get_fix_by_id(id_upalt);
|
||||
if (!myfix)
|
||||
error->all(FLERR,"Could not find internal pair amoeba fix STORE/PERATOM id {}", id_upalt);
|
||||
fixupalt = dynamic_cast<FixStorePeratom *>(myfix);
|
||||
error->all(FLERR,"Could not find internal pair amoeba fix STORE/ATOM id {}", id_upalt);
|
||||
fixupalt = dynamic_cast<FixStoreAtom *>(myfix);
|
||||
}
|
||||
|
||||
// assign hydrogen neighbors (redID) to each owned atom
|
||||
|
||||
@ -166,9 +166,9 @@ class PairAmoeba : public Pair {
|
||||
int *amgroup; // AMOEBA polarization group, 1 to Ngroup
|
||||
|
||||
char *id_pole, *id_udalt, *id_upalt;
|
||||
class FixStorePeratom *fixpole; // stores pole = multipole components
|
||||
class FixStorePeratom *fixudalt; // stores udalt = induced dipole history
|
||||
class FixStorePeratom *fixupalt; // stores upalt = induced dipole history
|
||||
class FixStoreAtom *fixpole; // stores pole = multipole components
|
||||
class FixStoreAtom *fixudalt; // stores udalt = induced dipole history
|
||||
class FixStoreAtom *fixupalt; // stores upalt = induced dipole history
|
||||
|
||||
// static per-type properties defined in force-field file
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "group.h"
|
||||
#include "memory.h"
|
||||
@ -67,8 +67,8 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) :
|
||||
// id = compute-ID + COMPUTE_STORE, fix group = compute group
|
||||
|
||||
id_fix = utils::strdup(id + std::string("_COMPUTE_STORE"));
|
||||
fix = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 0", id_fix, group->names[igroup])));
|
||||
fix = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 0", id_fix, group->names[igroup])));
|
||||
|
||||
// set fix store values = 0 for now
|
||||
// fill them in via setup() once Comm::borders() has been called
|
||||
|
||||
@ -54,7 +54,7 @@ class ComputeTempCS : public Compute {
|
||||
double **vint;
|
||||
|
||||
char *id_fix;
|
||||
class FixStorePeratom *fix;
|
||||
class FixStoreAtom *fix;
|
||||
|
||||
void dof_compute();
|
||||
void vcm_pairs();
|
||||
|
||||
@ -54,7 +54,7 @@ https://doi.org/10.1103/PhysRevE.92.043303
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "group.h"
|
||||
#include "improper.h"
|
||||
@ -90,8 +90,8 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) :
|
||||
// our new fix's group = same as compute group
|
||||
|
||||
id_fix = utils::strdup(std::string(id)+"_COMPUTE_STORE");
|
||||
fix = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
fix = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
|
||||
// calculate xu,yu,zu for fix store array
|
||||
// skip if reset from restart file
|
||||
@ -196,7 +196,7 @@ void ComputeHMA::setup()
|
||||
|
||||
// set fix which stores original atom coords
|
||||
|
||||
fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix));
|
||||
fix = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix));
|
||||
if (!fix) error->all(FLERR,"Could not find hma per-atom store fix ID {}", id_fix);
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ class ComputeHMA : public Compute {
|
||||
char *id_fix;
|
||||
char *id_temp;
|
||||
double finaltemp;
|
||||
class FixStorePeratom *fix;
|
||||
class FixStoreAtom *fix;
|
||||
double boltz, nktv2p, inv_volume;
|
||||
double deltaPcap;
|
||||
double virial_compute(int);
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "group.h"
|
||||
#include "update.h"
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
@ -162,8 +162,8 @@ void BondHarmonicRestrain::init_style()
|
||||
if (natoms < 0) {
|
||||
|
||||
// create internal fix to store initial positions
|
||||
initial = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1"));
|
||||
initial = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix("BOND_RESTRAIN_X0 all STORE/ATOM 3 0 1 1"));
|
||||
if (!initial) error->all(FLERR, "Failure to create internal per-atom storage");
|
||||
|
||||
natoms = atom->natoms;
|
||||
@ -178,8 +178,8 @@ void BondHarmonicRestrain::init_style()
|
||||
// we add the fix, but do not initialize it. It will pull the data from the restart.
|
||||
|
||||
if (!initial) {
|
||||
initial = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix("BOND_RESTRAIN_X0 all STORE/PERATOM 3 0 1 1"));
|
||||
initial = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix("BOND_RESTRAIN_X0 all STORE/ATOM 3 0 1 1"));
|
||||
if (!initial) error->all(FLERR, "Failure to create internal per-atom storage");
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ class BondHarmonicRestrain : public Bond {
|
||||
protected:
|
||||
double *k;
|
||||
bigint natoms;
|
||||
class FixStorePeratom *initial;
|
||||
class FixStoreAtom *initial;
|
||||
|
||||
virtual void allocate();
|
||||
};
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#include "atom.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "group.h"
|
||||
#include "input.h"
|
||||
@ -211,8 +211,8 @@ void FixAdaptFEP::post_constructor()
|
||||
|
||||
if (diamflag) {
|
||||
id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM"));
|
||||
fix_diam = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix_diam,group->names[igroup])));
|
||||
fix_diam = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1", id_fix_diam,group->names[igroup])));
|
||||
if (fix_diam->restart_reset) fix_diam->restart_reset = 0;
|
||||
else {
|
||||
double *vec = fix_diam->vstore;
|
||||
@ -229,8 +229,8 @@ void FixAdaptFEP::post_constructor()
|
||||
|
||||
if (chgflag) {
|
||||
id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG"));
|
||||
fix_chg = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1",id_fix_chg,group->names[igroup])));
|
||||
fix_chg = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1",id_fix_chg,group->names[igroup])));
|
||||
if (fix_chg->restart_reset) fix_chg->restart_reset = 0;
|
||||
else {
|
||||
double *vec = fix_chg->vstore;
|
||||
@ -333,11 +333,11 @@ void FixAdaptFEP::init()
|
||||
// fixes that store initial per-atom values
|
||||
|
||||
if (id_fix_diam) {
|
||||
fix_diam = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix_diam));
|
||||
fix_diam = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix_diam));
|
||||
if (!fix_diam) error->all(FLERR,"Could not find fix adapt/fep storage fix ID {}", id_fix_diam);
|
||||
}
|
||||
if (id_fix_chg) {
|
||||
fix_chg = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix_chg));
|
||||
fix_chg = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix_chg));
|
||||
if (!fix_chg) error->all(FLERR,"Could not find fix adapt/fep storage fix ID {}", id_fix_chg);
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ class FixAdaptFEP : public Fix {
|
||||
int anypair;
|
||||
int nlevels_respa;
|
||||
char *id_fix_diam, *id_fix_chg;
|
||||
class FixStorePeratom *fix_diam, *fix_chg;
|
||||
class FixStoreAtom *fix_diam, *fix_chg;
|
||||
|
||||
struct Adapt {
|
||||
int which, ivar;
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "gpu_extra.h"
|
||||
#include "info.h"
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "gpu_extra.h"
|
||||
#include "info.h"
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "error.h"
|
||||
#include "finish.h"
|
||||
#include "fix_event_tad.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "integrate.h"
|
||||
#include "memory.h"
|
||||
@ -133,9 +133,9 @@ void TAD::command(int narg, char **arg)
|
||||
|
||||
fix_event = dynamic_cast<FixEventTAD *>(modify->add_fix("tad_event all EVENT/TAD"));
|
||||
|
||||
// create FixStorePeratom object to store revert state
|
||||
// create FixStoreAtom object to store revert state
|
||||
|
||||
fix_revert = dynamic_cast<FixStorePeratom *>(modify->add_fix("tad_revert all STORE/PERATOM 7 0 0 0"));
|
||||
fix_revert = dynamic_cast<FixStoreAtom *>(modify->add_fix("tad_revert all STORE/ATOM 7 0 0 0"));
|
||||
|
||||
// create Finish for timing output
|
||||
|
||||
|
||||
@ -48,15 +48,15 @@ class TAD : public Command {
|
||||
double time_dynamics, time_quench, time_neb, time_comm, time_output;
|
||||
double time_start;
|
||||
|
||||
class NEB *neb; // NEB object
|
||||
class Fix *fix_neb; // FixNEB object
|
||||
class Compute *compute_event; // compute to detect event
|
||||
class FixEventTAD *fix_event; // current event/state
|
||||
class FixStorePeratom *fix_revert; // revert state
|
||||
FixEventTAD **fix_event_list; // list of possible events
|
||||
int n_event_list; // number of events
|
||||
int nmax_event_list; // allocated events
|
||||
int nmin_event_list; // minimum allocation
|
||||
class NEB *neb; // NEB object
|
||||
class Fix *fix_neb; // FixNEB object
|
||||
class Compute *compute_event; // compute to detect event
|
||||
class FixEventTAD *fix_event; // current event/state
|
||||
class FixStoreAtom *fix_revert; // revert state
|
||||
FixEventTAD **fix_event_list; // list of possible events
|
||||
int n_event_list; // number of events
|
||||
int nmax_event_list; // allocated events
|
||||
int nmin_event_list; // minimum allocation
|
||||
|
||||
char *neb_logfilename; // filename for ulogfile_neb
|
||||
FILE *uscreen_neb; // neb universe screen output
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "group.h"
|
||||
#include "input.h"
|
||||
@ -2357,16 +2357,16 @@ int DumpVTK::modify_param(int narg, char **arg)
|
||||
thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp);
|
||||
thresh_last[nthresh] = -1;
|
||||
} else {
|
||||
thresh_fix = (FixStorePeratom **)
|
||||
memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStorePeratom *),"dump:thresh_fix");
|
||||
thresh_fix = (FixStoreAtom **)
|
||||
memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStoreAtom *),"dump:thresh_fix");
|
||||
thresh_fixID = (char **)
|
||||
memory->srealloc(thresh_fixID,(nthreshlast+1)*sizeof(char *),"dump:thresh_fixID");
|
||||
memory->grow(thresh_first,(nthreshlast+1),"dump:thresh_first");
|
||||
|
||||
std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast);
|
||||
thresh_fixID[nthreshlast] = utils::strdup(threshid);
|
||||
threshid += fmt::format(" {} STORE/PERATOM 1 0 0 1", group->names[igroup]);
|
||||
thresh_fix[nthreshlast] = dynamic_cast<FixStorePeratom *>(modify->add_fix(threshid));
|
||||
threshid += fmt::format(" {} STORE/ATOM 1 0 0 1", group->names[igroup]);
|
||||
thresh_fix[nthreshlast] = dynamic_cast<FixStoreAtom *>(modify->add_fix(threshid));
|
||||
|
||||
thresh_last[nthreshlast] = nthreshlast;
|
||||
thresh_first[nthreshlast] = 1;
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#include "neighbor.h"
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "imbalance.h"
|
||||
#include "imbalance_group.h"
|
||||
@ -513,9 +513,9 @@ void Balance::weight_storage(char *prefix)
|
||||
if (prefix) cmd = prefix;
|
||||
cmd += "IMBALANCE_WEIGHTS";
|
||||
|
||||
fixstore = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(cmd));
|
||||
fixstore = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(cmd));
|
||||
if (!fixstore)
|
||||
fixstore = dynamic_cast<FixStorePeratom *>(modify->add_fix(cmd + " all STORE/PERATOM 1 0 0 0"));
|
||||
fixstore = dynamic_cast<FixStoreAtom *>(modify->add_fix(cmd + " all STORE/ATOM 1 0 0 0"));
|
||||
|
||||
// do not carry weights with atoms during normal atom migration
|
||||
|
||||
|
||||
@ -27,11 +27,11 @@ namespace LAMMPS_NS {
|
||||
class Balance : public Command {
|
||||
public:
|
||||
class RCB *rcb;
|
||||
class FixStorePeratom *fixstore; // per-atom weights stored in FixStorePeratom
|
||||
int wtflag; // 1 if particle weighting is used
|
||||
int varflag; // 1 if weight style var(iable) is used
|
||||
int sortflag; // 1 if sorting of comm messages is done
|
||||
int outflag; // 1 for output of balance results to file
|
||||
class FixStoreAtom *fixstore; // per-atom weights stored in FixStorePeratom
|
||||
int wtflag; // 1 if particle weighting is used
|
||||
int varflag; // 1 if weight style var(iable) is used
|
||||
int sortflag; // 1 if sorting of comm messages is done
|
||||
int outflag; // 1 for output of balance results to file
|
||||
|
||||
Balance(class LAMMPS *);
|
||||
~Balance() override;
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "group.h"
|
||||
#include "input.h"
|
||||
#include "lattice.h"
|
||||
@ -571,8 +571,8 @@ void ComputeChunkAtom::init()
|
||||
|
||||
if ((idsflag == ONCE || lockcount) && !fixstore) {
|
||||
id_fix = utils::strdup(id + std::string("_COMPUTE_STORE"));
|
||||
fixstore = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix, group->names[igroup])));
|
||||
fixstore = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1", id_fix, group->names[igroup])));
|
||||
}
|
||||
|
||||
if ((idsflag != ONCE && !lockcount) && fixstore) {
|
||||
|
||||
@ -93,7 +93,7 @@ class ComputeChunkAtom : public Compute {
|
||||
double *varatom;
|
||||
|
||||
char *id_fix;
|
||||
class FixStorePeratom *fixstore;
|
||||
class FixStoreAtom *fixstore;
|
||||
|
||||
class Fix *lockfix; // ptr to FixAveChunk that is locking out setups
|
||||
// null pointer if no lock currently in place
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "group.h"
|
||||
#include "input.h"
|
||||
#include "memory.h"
|
||||
@ -74,8 +74,8 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// id = compute-ID + COMPUTE_STORE, fix group = compute group
|
||||
|
||||
id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE");
|
||||
fix = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
fix = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
|
||||
// calculate xu,yu,zu for fix store array
|
||||
// skip if reset from restart file
|
||||
@ -120,7 +120,7 @@ void ComputeDisplaceAtom::init()
|
||||
{
|
||||
// set fix which stores original atom coords
|
||||
|
||||
fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix));
|
||||
fix = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix));
|
||||
if (!fix) error->all(FLERR,"Could not find compute displace/atom fix with ID {}", id_fix);
|
||||
|
||||
if (refreshflag) {
|
||||
|
||||
@ -38,7 +38,7 @@ class ComputeDisplaceAtom : public Compute {
|
||||
int nmax;
|
||||
double **displace;
|
||||
char *id_fix;
|
||||
class FixStorePeratom *fix;
|
||||
class FixStoreAtom *fix;
|
||||
|
||||
int refreshflag, ivar, nvmax; // refresh option is enabled
|
||||
char *rvar; // for incremental dumps
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "group.h"
|
||||
#include "modify.h"
|
||||
#include "update.h"
|
||||
@ -63,8 +63,8 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, a
|
||||
// id = compute-ID + COMPUTE_STORE, fix group = compute group
|
||||
|
||||
id_fix = utils::strdup(id + std::string("_COMPUTE_STORE"));
|
||||
fix = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
fix = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
|
||||
// calculate xu,yu,zu for fix store array
|
||||
// skip if reset from restart file
|
||||
@ -127,7 +127,7 @@ void ComputeMSD::init()
|
||||
{
|
||||
// set fix which stores reference atom coords
|
||||
|
||||
fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix));
|
||||
fix = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix));
|
||||
if (!fix) error->all(FLERR, "Could not find compute msd fix with ID {}", id_fix);
|
||||
|
||||
// nmsd = # of atoms in group
|
||||
|
||||
@ -39,7 +39,7 @@ class ComputeMSD : public Compute {
|
||||
bigint nmsd;
|
||||
double masstotal;
|
||||
char *id_fix;
|
||||
class FixStorePeratom *fix;
|
||||
class FixStoreAtom *fix;
|
||||
};
|
||||
|
||||
} // namespace LAMMPS_NS
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#include "update.h"
|
||||
#include "group.h"
|
||||
#include "modify.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
@ -39,8 +39,8 @@ ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) :
|
||||
// id = compute-ID + COMPUTE_STORE, fix group = compute group
|
||||
|
||||
id_fix = utils::strdup(id + std::string("_COMPUTE_STORE"));
|
||||
fix = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
fix = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 3 0 0 1", id_fix, group->names[igroup])));
|
||||
|
||||
// store current velocities in fix store array
|
||||
// skip if reset from restart file
|
||||
@ -84,7 +84,7 @@ void ComputeVACF::init()
|
||||
{
|
||||
// set fix which stores original atom velocities
|
||||
|
||||
fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix));
|
||||
fix = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix));
|
||||
if (!fix) error->all(FLERR,"Could not find compute vacf fix ID {}", id_fix);
|
||||
|
||||
// nvacf = # of atoms in group
|
||||
|
||||
@ -35,7 +35,7 @@ class ComputeVACF : public Compute {
|
||||
protected:
|
||||
bigint nvacf;
|
||||
char *id_fix;
|
||||
class FixStorePeratom *fix;
|
||||
class FixStoreAtom *fix;
|
||||
};
|
||||
|
||||
} // namespace LAMMPS_NS
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "group.h"
|
||||
#include "input.h"
|
||||
#include "memory.h"
|
||||
@ -2005,16 +2005,16 @@ int DumpCustom::modify_param(int narg, char **arg)
|
||||
thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp);
|
||||
thresh_last[nthresh] = -1;
|
||||
} else {
|
||||
thresh_fix = (FixStorePeratom **)
|
||||
memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStorePeratom *),"dump:thresh_fix");
|
||||
thresh_fix = (FixStoreAtom **)
|
||||
memory->srealloc(thresh_fix,(nthreshlast+1)*sizeof(FixStoreAtom *),"dump:thresh_fix");
|
||||
thresh_fixID = (char **)
|
||||
memory->srealloc(thresh_fixID,(nthreshlast+1)*sizeof(char *),"dump:thresh_fixID");
|
||||
memory->grow(thresh_first,(nthreshlast+1),"dump:thresh_first");
|
||||
|
||||
std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast);
|
||||
thresh_fixID[nthreshlast] = utils::strdup(threshid);
|
||||
threshid += fmt::format(" {} STORE/PERATOM 1 0 0 1", group->names[igroup]);
|
||||
thresh_fix[nthreshlast] = dynamic_cast<FixStorePeratom *>(modify->add_fix(threshid));
|
||||
threshid += fmt::format(" {} STORE/ATOM 1 0 0 1", group->names[igroup]);
|
||||
thresh_fix[nthreshlast] = dynamic_cast<FixStoreAtom *>(modify->add_fix(threshid));
|
||||
|
||||
thresh_last[nthreshlast] = nthreshlast;
|
||||
thresh_first[nthreshlast] = 1;
|
||||
|
||||
@ -37,19 +37,19 @@ class DumpCustom : public Dump {
|
||||
int nevery; // dump frequency for output
|
||||
char *idregion; // region ID, nullptr if no region
|
||||
|
||||
int nthresh; // # of defined thresholds
|
||||
int nthreshlast; // # of defined thresholds with value = LAST
|
||||
//
|
||||
int *thresh_array; // array to threshold on for each nthresh
|
||||
int *thresh_op; // threshold operation for each nthresh
|
||||
double *thresh_value; // threshold value for each nthresh
|
||||
int *thresh_last; // for threshold value = LAST,
|
||||
// index into thresh_fix
|
||||
// -1 if not LAST, value is numeric
|
||||
//
|
||||
class FixStorePeratom **thresh_fix; // stores values for each threshold LAST
|
||||
char **thresh_fixID; // IDs of thresh_fixes
|
||||
int *thresh_first; // 1 the first time a FixStore values accessed
|
||||
int nthresh; // # of defined thresholds
|
||||
int nthreshlast; // # of defined thresholds with value = LAST
|
||||
//
|
||||
int *thresh_array; // array to threshold on for each nthresh
|
||||
int *thresh_op; // threshold operation for each nthresh
|
||||
double *thresh_value; // threshold value for each nthresh
|
||||
int *thresh_last; // for threshold value = LAST,
|
||||
// index into thresh_fix
|
||||
// -1 if not LAST, value is numeric
|
||||
//
|
||||
class FixStoreAtom **thresh_fix; // stores values for each threshold LAST
|
||||
char **thresh_fixID; // IDs of thresh_fixes
|
||||
int *thresh_first; // 1 the first time a FixStore values accessed
|
||||
|
||||
int expand; // flag for whether field args were expanded
|
||||
char **earg; // field names with wildcard expansion
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "bond.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "group.h"
|
||||
#include "input.h"
|
||||
@ -278,8 +278,8 @@ void FixAdapt::post_constructor()
|
||||
|
||||
if (diamflag && atom->radius_flag) {
|
||||
id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM"));
|
||||
fix_diam = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1", id_fix_diam,group->names[igroup])));
|
||||
fix_diam = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1", id_fix_diam,group->names[igroup])));
|
||||
if (fix_diam->restart_reset) fix_diam->restart_reset = 0;
|
||||
else {
|
||||
double *vec = fix_diam->vstore;
|
||||
@ -296,8 +296,8 @@ void FixAdapt::post_constructor()
|
||||
|
||||
if (chgflag && atom->q_flag) {
|
||||
id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG"));
|
||||
fix_chg = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 0 0 1",id_fix_chg,group->names[igroup])));
|
||||
fix_chg = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(fmt::format("{} {} STORE/ATOM 1 0 0 1",id_fix_chg,group->names[igroup])));
|
||||
if (fix_chg->restart_reset) fix_chg->restart_reset = 0;
|
||||
else {
|
||||
double *vec = fix_chg->vstore;
|
||||
@ -494,11 +494,11 @@ void FixAdapt::init()
|
||||
// fixes that store initial per-atom values
|
||||
|
||||
if (id_fix_diam) {
|
||||
fix_diam = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix_diam));
|
||||
fix_diam = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix_diam));
|
||||
if (!fix_diam) error->all(FLERR,"Could not find fix adapt storage fix ID {}", id_fix_diam);
|
||||
}
|
||||
if (id_fix_chg) {
|
||||
fix_chg = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix_chg));
|
||||
fix_chg = dynamic_cast<FixStoreAtom *>(modify->get_fix_by_id(id_fix_chg));
|
||||
if (!fix_chg) error->all(FLERR,"Could not find fix adapt storage fix ID {}", id_fix_chg);
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ class FixAdapt : public Fix {
|
||||
int anypair, anybond, anyangle;
|
||||
int nlevels_respa;
|
||||
char *id_fix_diam, *id_fix_chg;
|
||||
class FixStorePeratom *fix_diam, *fix_chg;
|
||||
class FixStoreAtom *fix_diam, *fix_chg;
|
||||
double previous_diam_scale, previous_chg_scale;
|
||||
int discflag;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "force.h"
|
||||
#include "irregular.h"
|
||||
#include "kspace.h"
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "error.h"
|
||||
@ -32,10 +32,10 @@ using namespace FixConst;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) :
|
||||
FixStoreAtom::FixStoreAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg), vstore(nullptr), astore(nullptr)
|
||||
{
|
||||
if (narg != 7) error->all(FLERR, "Illegal fix STORE/PERATOM command: number of args");
|
||||
if (narg != 7) error->all(FLERR, "Illegal fix STORE/ATOM command: number of args");
|
||||
|
||||
disable = 0;
|
||||
|
||||
@ -52,7 +52,7 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) :
|
||||
else if (n1 > 0 && n2 > 0)
|
||||
tensorflag = 1;
|
||||
else
|
||||
error->all(FLERR, "Illegal fix STORE/PERATOM dimension args: {} {}", n1, n2);
|
||||
error->all(FLERR, "Illegal fix STORE/ATOM dimension args: {} {}", n1, n2);
|
||||
|
||||
if (vecflag || arrayflag)
|
||||
nvalues = n1;
|
||||
@ -71,7 +71,7 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) :
|
||||
astore = nullptr;
|
||||
tstore = nullptr;
|
||||
|
||||
FixStorePeratom::grow_arrays(atom->nmax);
|
||||
FixStoreAtom::grow_arrays(atom->nmax);
|
||||
atom->add_callback(Atom::GROW);
|
||||
if (restartflag) atom->add_callback(Atom::RESTART);
|
||||
if (ghostflag) atom->add_callback(Atom::BORDER);
|
||||
@ -93,7 +93,7 @@ FixStorePeratom::FixStorePeratom(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixStorePeratom::~FixStorePeratom()
|
||||
FixStoreAtom::~FixStoreAtom()
|
||||
{
|
||||
// unregister callbacks to this fix from Atom class
|
||||
|
||||
@ -108,7 +108,7 @@ FixStorePeratom::~FixStorePeratom()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::setmask()
|
||||
int FixStoreAtom::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
return mask;
|
||||
@ -118,7 +118,7 @@ int FixStorePeratom::setmask()
|
||||
allocate atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixStorePeratom::grow_arrays(int nmax)
|
||||
void FixStoreAtom::grow_arrays(int nmax)
|
||||
{
|
||||
if (vecflag)
|
||||
memory->grow(vstore, nmax, "store:vstore");
|
||||
@ -132,7 +132,7 @@ void FixStorePeratom::grow_arrays(int nmax)
|
||||
copy values within local atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixStorePeratom::copy_arrays(int i, int j, int /*delflag*/)
|
||||
void FixStoreAtom::copy_arrays(int i, int j, int /*delflag*/)
|
||||
{
|
||||
if (disable) return;
|
||||
|
||||
@ -149,7 +149,7 @@ void FixStorePeratom::copy_arrays(int i, int j, int /*delflag*/)
|
||||
pack values for border communication at re-neighboring
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::pack_border(int n, int *list, double *buf)
|
||||
int FixStoreAtom::pack_border(int n, int *list, double *buf)
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
@ -179,7 +179,7 @@ int FixStorePeratom::pack_border(int n, int *list, double *buf)
|
||||
unpack values for border communication at re-neighboring
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::unpack_border(int n, int first, double *buf)
|
||||
int FixStoreAtom::unpack_border(int n, int first, double *buf)
|
||||
{
|
||||
int i, k, last;
|
||||
|
||||
@ -203,7 +203,7 @@ int FixStorePeratom::unpack_border(int n, int first, double *buf)
|
||||
pack values in local atom-based array for exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::pack_exchange(int i, double *buf)
|
||||
int FixStoreAtom::pack_exchange(int i, double *buf)
|
||||
{
|
||||
if (disable) return 0;
|
||||
|
||||
@ -222,7 +222,7 @@ int FixStorePeratom::pack_exchange(int i, double *buf)
|
||||
unpack values in local atom-based array from exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::unpack_exchange(int nlocal, double *buf)
|
||||
int FixStoreAtom::unpack_exchange(int nlocal, double *buf)
|
||||
{
|
||||
if (disable) return 0;
|
||||
|
||||
@ -241,7 +241,7 @@ int FixStorePeratom::unpack_exchange(int nlocal, double *buf)
|
||||
pack values in local atom-based arrays for restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::pack_restart(int i, double *buf)
|
||||
int FixStoreAtom::pack_restart(int i, double *buf)
|
||||
{
|
||||
if (disable) {
|
||||
buf[0] = 0;
|
||||
@ -266,7 +266,7 @@ int FixStorePeratom::pack_restart(int i, double *buf)
|
||||
unpack values from atom->extra array to restart the fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixStorePeratom::unpack_restart(int nlocal, int nth)
|
||||
void FixStoreAtom::unpack_restart(int nlocal, int nth)
|
||||
{
|
||||
if (disable) return;
|
||||
|
||||
@ -292,7 +292,7 @@ void FixStorePeratom::unpack_restart(int nlocal, int nth)
|
||||
maxsize of any atom's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::maxsize_restart()
|
||||
int FixStoreAtom::maxsize_restart()
|
||||
{
|
||||
if (disable) return 1;
|
||||
return nvalues + 1;
|
||||
@ -302,17 +302,17 @@ int FixStorePeratom::maxsize_restart()
|
||||
size of atom nlocal's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixStorePeratom::size_restart(int /*nlocal*/)
|
||||
int FixStoreAtom::size_restart(int /*nlocal*/)
|
||||
{
|
||||
if (disable) return 1;
|
||||
return nvalues + 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of global or peratom atom-based array
|
||||
memory usage of per-atom atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixStorePeratom::memory_usage()
|
||||
double FixStoreAtom::memory_usage()
|
||||
{
|
||||
return (double) atom->nmax * nvalues * sizeof(double);
|
||||
}
|
||||
@ -13,26 +13,26 @@
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
// clang-format off
|
||||
FixStyle(STORE/PERATOM,FixStorePeratom);
|
||||
FixStyle(STORE/ATOM,FixStoreAtom);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
#ifndef LMP_FIX_STORE_PERATOM_H
|
||||
#define LMP_FIX_STORE_PERATOM_H
|
||||
#ifndef LMP_FIX_STORE_ATOM_H
|
||||
#define LMP_FIX_STORE_ATOM_H
|
||||
|
||||
#include "fix.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixStorePeratom : public Fix {
|
||||
class FixStoreAtom : public Fix {
|
||||
public:
|
||||
double *vstore; // vector storage
|
||||
double **astore; // array storage
|
||||
double ***tstore; // tensor (3d array) storage
|
||||
int disable; // 1 if operations (except grow) are currently disabled
|
||||
|
||||
FixStorePeratom(class LAMMPS *, int, char **);
|
||||
~FixStorePeratom() override;
|
||||
FixStoreAtom(class LAMMPS *, int, char **);
|
||||
~FixStoreAtom() override;
|
||||
int setmask() override;
|
||||
|
||||
void grow_arrays(int) override;
|
||||
@ -182,7 +182,7 @@ void FixStoreGlobal::restart(char *buf)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of global or peratom atom-based array
|
||||
memory usage of global data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixStoreGlobal::memory_usage()
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "fix.h"
|
||||
#include "fix_store_peratom.h"
|
||||
#include "fix_store_atom.h"
|
||||
#include "group.h"
|
||||
#include "info.h"
|
||||
#include "input.h"
|
||||
@ -5027,8 +5027,8 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) :
|
||||
error->all(FLERR,"Cannot use atomfile-style variable unless an atom map exists");
|
||||
|
||||
id_fix = utils::strdup(std::string(name) + "_VARIABLE_STORE");
|
||||
fixstore = dynamic_cast<FixStorePeratom *>(
|
||||
modify->add_fix(std::string(id_fix) + " all STORE/PERATOM 1 0 0 0"));
|
||||
fixstore = dynamic_cast<FixStoreAtom *>(
|
||||
modify->add_fix(std::string(id_fix) + " all STORE/ATOM 1 0 0 0"));
|
||||
buffer = new char[CHUNK*MAXLINE];
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ class Variable : protected Pointers {
|
||||
|
||||
class VarReader : protected Pointers {
|
||||
public:
|
||||
class FixStorePeratom *fixstore;
|
||||
class FixStoreAtom *fixstore;
|
||||
char *id_fix;
|
||||
|
||||
VarReader(class LAMMPS *, char *, char *, int);
|
||||
|
||||
Reference in New Issue
Block a user