refactor group access, enable and apply clang-format

This commit is contained in:
Axel Kohlmeyer
2022-04-14 22:01:48 -04:00
parent 4b400fb4a6
commit 69d9c5187e
187 changed files with 3016 additions and 2927 deletions

View File

@ -857,10 +857,9 @@ double Group::mass(int igroup)
use either per-type mass or per-atom rmass
------------------------------------------------------------------------- */
double Group::mass(int igroup, int iregion)
double Group::mass(int igroup, Region *region)
{
int groupbit = bitmask[igroup];
Region *region = domain->regions[iregion];
region->prematch();
double **x = atom->x;
@ -887,6 +886,16 @@ double Group::mass(int igroup, int iregion)
return all;
}
/* ----------------------------------------------------------------------
compute the total mass of group of atoms in region
use either per-type mass or per-atom rmass
------------------------------------------------------------------------- */
double Group::mass(int igroup, int iregion)
{
return mass(igroup, domain->regions[iregion]);
}
/* ----------------------------------------------------------------------
compute the total charge of group of atoms
------------------------------------------------------------------------- */
@ -1181,10 +1190,9 @@ void Group::vcm(int igroup, double masstotal, double *cm)
return center-of-mass velocity in cm[]
------------------------------------------------------------------------- */
void Group::vcm(int igroup, double masstotal, double *cm, int iregion)
void Group::vcm(int igroup, double masstotal, double *cm, Region *region)
{
int groupbit = bitmask[igroup];
Region *region = domain->regions[iregion];
region->prematch();
double **x = atom->x;
@ -1224,6 +1232,17 @@ void Group::vcm(int igroup, double masstotal, double *cm, int iregion)
}
}
/* ----------------------------------------------------------------------
compute the center-of-mass velocity of group of atoms in region
masstotal = total mass
return center-of-mass velocity in cm[]
------------------------------------------------------------------------- */
void Group::vcm(int igroup, double masstotal, double *cm, int iregion)
{
vcm(igroup, masstotal, cm, domain->regions[iregion]);
}
/* ----------------------------------------------------------------------
compute the total force on group of atoms
------------------------------------------------------------------------- */
@ -1316,10 +1335,9 @@ double Group::ke(int igroup)
compute the total kinetic energy of group of atoms in region and return it
------------------------------------------------------------------------- */
double Group::ke(int igroup, int iregion)
double Group::ke(int igroup, Region *region)
{
int groupbit = bitmask[igroup];
Region *region = domain->regions[iregion];
region->prematch();
double **x = atom->x;
@ -1350,6 +1368,15 @@ double Group::ke(int igroup, int iregion)
return all;
}
/* ----------------------------------------------------------------------
compute the total kinetic energy of group of atoms in region and return it
------------------------------------------------------------------------- */
double Group::ke(int igroup, int iregion)
{
return ke(igroup, domain->regions[iregion]);
}
/* ----------------------------------------------------------------------
compute the radius-of-gyration of group of atoms
around center-of-mass cm