include-what-you-use updates

This commit is contained in:
Axel Kohlmeyer
2024-02-27 23:42:24 -05:00
parent 5967865af9
commit 1359c52f30
24 changed files with 33 additions and 43 deletions

View File

@ -12,28 +12,25 @@
------------------------------------------------------------------------- */
#include "compute_erotate_sphere_atom.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "modify.h"
#include "update.h"
using namespace LAMMPS_NS;
static constexpr double INERTIA = 0.4; // moment of inertia prefactor for sphere
static constexpr double INERTIA = 0.4; // moment of inertia prefactor for sphere
/* ---------------------------------------------------------------------- */
ComputeErotateSphereAtom::
ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
erot(nullptr)
ComputeErotateSphereAtom::ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg), erot(nullptr)
{
if (narg != 3)
error->all(FLERR,"Illegal compute erotate/sphere//atom command");
if (narg != 3) error->all(FLERR, "Illegal compute erotate/sphere//atom command");
peratom_flag = 1;
size_peratom_cols = 0;
@ -41,9 +38,9 @@ ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) :
// error check
if (!atom->omega_flag)
error->all(FLERR,"Compute erotate/sphere/atom requires atom attribute omega");
error->all(FLERR, "Compute erotate/sphere/atom requires atom attribute omega");
if (!atom->radius_flag)
error->all(FLERR,"Compute erotate/sphere/atom requires atom attribute radius");
error->all(FLERR, "Compute erotate/sphere/atom requires atom attribute radius");
nmax = 0;
}
@ -76,7 +73,7 @@ void ComputeErotateSphereAtom::compute_peratom()
if (atom->nmax > nmax) {
memory->destroy(erot);
nmax = atom->nmax;
memory->create(erot,nmax,"erotate/sphere/atom:erot");
memory->create(erot, nmax, "erotate/sphere/atom:erot");
vector_atom = erot;
}
@ -91,10 +88,12 @@ void ComputeErotateSphereAtom::compute_peratom()
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
erot[i] = (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
omega[i][2]*omega[i][2]) * radius[i]*radius[i]*rmass[i];
erot[i] =
(omega[i][0] * omega[i][0] + omega[i][1] * omega[i][1] + omega[i][2] * omega[i][2]) *
radius[i] * radius[i] * rmass[i];
erot[i] *= pfactor;
} else erot[i] = 0.0;
} else
erot[i] = 0.0;
}
}
@ -104,6 +103,6 @@ void ComputeErotateSphereAtom::compute_peratom()
double ComputeErotateSphereAtom::memory_usage()
{
double bytes = (double)nmax * sizeof(double);
double bytes = (double) nmax * sizeof(double);
return bytes;
}