more thorough checks on valid numbers when computing box/virial related properties
This commit is contained in:
@ -232,18 +232,27 @@ void Ewald::setup()
|
||||
kzmax = 1;
|
||||
|
||||
err = rms(kxmax,xprd,natoms,q2);
|
||||
if (!ISFINITE(err))
|
||||
error->all(FLERR,"Non-numeric box dimensions - simulation unstable");
|
||||
|
||||
while (err > accuracy) {
|
||||
kxmax++;
|
||||
err = rms(kxmax,xprd,natoms,q2);
|
||||
}
|
||||
|
||||
err = rms(kymax,yprd,natoms,q2);
|
||||
if (!ISFINITE(err))
|
||||
error->all(FLERR,"Non-numeric box dimensions - simulation unstable");
|
||||
|
||||
while (err > accuracy) {
|
||||
kymax++;
|
||||
err = rms(kymax,yprd,natoms,q2);
|
||||
}
|
||||
|
||||
err = rms(kzmax,zprd_slab,natoms,q2);
|
||||
if (!ISFINITE(err))
|
||||
error->all(FLERR,"Non-numeric box dimensions - simulation unstable");
|
||||
|
||||
while (err > accuracy) {
|
||||
kzmax++;
|
||||
err = rms(kzmax,zprd_slab,natoms,q2);
|
||||
|
||||
@ -247,21 +247,33 @@ void EwaldDisp::setup()
|
||||
int kxmax = 1;
|
||||
int kymax = 1;
|
||||
int kzmax = 1;
|
||||
|
||||
err = rms(kxmax,domain->h[0],natoms,q2,b2,M2);
|
||||
if (!ISFINITE(err))
|
||||
error->all(FLERR,"Non-numeric box dimensions - simulation unstable");
|
||||
|
||||
while (err > accuracy) {
|
||||
kxmax++;
|
||||
err = rms(kxmax,domain->h[0],natoms,q2,b2,M2);
|
||||
}
|
||||
|
||||
err = rms(kymax,domain->h[1],natoms,q2,b2,M2);
|
||||
if (!ISFINITE(err))
|
||||
error->all(FLERR,"Non-numeric box dimensions - simulation unstable");
|
||||
while (err > accuracy) {
|
||||
kymax++;
|
||||
err = rms(kymax,domain->h[1],natoms,q2,b2,M2);
|
||||
}
|
||||
|
||||
err = rms(kzmax,domain->h[2]*slab_volfactor,natoms,q2,b2,M2);
|
||||
if (!ISFINITE(err))
|
||||
error->all(FLERR,"Non-numeric box dimensions - simulation unstable");
|
||||
|
||||
while (err > accuracy) {
|
||||
kzmax++;
|
||||
err = rms(kzmax,domain->h[2]*slab_volfactor,natoms,q2,b2,M2);
|
||||
}
|
||||
|
||||
nbox = MAX(kxmax,kymax);
|
||||
nbox = MAX(nbox,kzmax);
|
||||
double gsqxmx = unit[0]*unit[0]*kxmax*kxmax;
|
||||
|
||||
@ -1013,12 +1013,18 @@ void FixNH::couple()
|
||||
p_current[2] = tensor[2];
|
||||
}
|
||||
|
||||
if (!ISFINITE(p_current[0]) || !ISFINITE(p_current[1]) || !ISFINITE(p_current[2]))
|
||||
error->all(FLERR,"Non-numeric pressure - simulation unstable");
|
||||
|
||||
// switch order from xy-xz-yz to Voigt
|
||||
|
||||
if (pstyle == TRICLINIC) {
|
||||
p_current[3] = tensor[5];
|
||||
p_current[4] = tensor[4];
|
||||
p_current[5] = tensor[3];
|
||||
|
||||
if (!ISFINITE(p_current[3]) || !ISFINITE(p_current[4]) || !ISFINITE(p_current[5]))
|
||||
error->all(FLERR,"Non-numeric pressure - simulation unstable");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user