enable and apply clang-format

This commit is contained in:
Axel Kohlmeyer
2022-05-22 03:29:33 -04:00
parent b407b2f239
commit 9a973e67fa
23 changed files with 196 additions and 267 deletions

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -21,22 +20,21 @@
using namespace LAMMPS_NS;
#define INERTIA 0.4 // moment of inertia prefactor for sphere
#define INERTIA 0.4 // moment of inertia prefactor for sphere
/* ---------------------------------------------------------------------- */
ComputeERotateSphere::ComputeERotateSphere(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
Compute(lmp, narg, arg)
{
if (narg != 3) error->all(FLERR,"Illegal compute erotate/sphere command");
if (narg != 3) error->all(FLERR, "Illegal compute erotate/sphere command");
scalar_flag = 1;
extscalar = 1;
// error check
if (!atom->sphere_flag)
error->all(FLERR,"Compute erotate/sphere requires atom style sphere");
if (!atom->sphere_flag) error->all(FLERR, "Compute erotate/sphere requires atom style sphere");
}
/* ---------------------------------------------------------------------- */
@ -64,10 +62,11 @@ double ComputeERotateSphere::compute_scalar()
double erotate = 0.0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
omega[i][2]*omega[i][2]) * radius[i]*radius[i]*rmass[i];
erotate +=
(omega[i][0] * omega[i][0] + omega[i][1] * omega[i][1] + omega[i][2] * omega[i][2]) *
radius[i] * radius[i] * rmass[i];
MPI_Allreduce(&erotate,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(&erotate, &scalar, 1, MPI_DOUBLE, MPI_SUM, world);
scalar *= pfactor;
return scalar;
}