consistently check for all per-atom-type masses being set only when per-atom masses are not set
rather than placing an if statement around every incidence of calling atom->check_mass() to ensure it is only called when per atom masses are not set, we place that check _inside_ Atom::check_mass(). This avoids unexpected error messages.
This commit is contained in:
@ -219,7 +219,7 @@ void Molecule::compute_mass()
|
||||
if (massflag) return;
|
||||
massflag = 1;
|
||||
|
||||
if (!rmassflag) atom->check_mass(FLERR);
|
||||
atom->check_mass(FLERR);
|
||||
|
||||
masstotal = 0.0;
|
||||
for (int i = 0; i < natoms; i++) {
|
||||
@ -243,7 +243,7 @@ void Molecule::compute_com()
|
||||
if (!comflag) {
|
||||
comflag = 1;
|
||||
|
||||
if (!rmassflag) atom->check_mass(FLERR);
|
||||
atom->check_mass(FLERR);
|
||||
|
||||
double onemass;
|
||||
com[0] = com[1] = com[2] = 0.0;
|
||||
@ -308,7 +308,7 @@ void Molecule::compute_inertia()
|
||||
if (!inertiaflag) {
|
||||
inertiaflag = 1;
|
||||
|
||||
if (!rmassflag) atom->check_mass(FLERR);
|
||||
atom->check_mass(FLERR);
|
||||
|
||||
double onemass,dx,dy,dz;
|
||||
for (int i = 0; i < 6; i++) itensor[i] = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user