--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/07/15 22:22:41 619 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2003/07/16 02:11:02 621 @@ -97,9 +97,9 @@ void SimInfo::setBoxM( double theBox[3][3] ){ setFortranBoxSize(FortranHmat, FortranHmatInv, &orthoRhombic); - smallestBoxL = boxLx; - if (boxLy < smallestBoxL) smallestBoxL = boxLy; - if (boxLz < smallestBoxL) smallestBoxL = boxLz; + smallestBoxL = boxL[0]; + if (boxL[1] < smallestBoxL) smallestBoxL = boxL[1]; + if (boxL[2] > smallestBoxL) smallestBoxL = boxL[2]; maxCutoff = smallestBoxL / 2.0; @@ -109,36 +109,32 @@ void SimInfo::setBoxM( double theBox[3][3] ){ maxCutoff ); painCave.isFatal = 0; simError(); - rList = maxCutoff; - sprintf( painCave.errMsg, - "New Box size is forcing cutoff radius down to %lf\n", - maxCutoff - 1.0 ); - painCave.isFatal = 0; - simError(); - - rCut = rList - 1.0; - - // list radius changed so we have to refresh the simulation structure. - refreshSim(); - } - - if( ecr > maxCutoff ){ - - sprintf( painCave.errMsg, - "New Box size is forcing electrostatic cutoff radius " - "down to %lf\n", - maxCutoff ); - painCave.isFatal = 0; - simError(); + if (rCut > (rList - 1.0)) { + sprintf( painCave.errMsg, + "New Box size is forcing LJ cutoff radius down to %lf\n", + rList - 1.0 ); + painCave.isFatal = 0; + simError(); + rCut = rList - 1.0; + } - ecr = maxCutoff; - est = 0.05 * ecr; + if( ecr > (rList - 1.0) ){ + sprintf( painCave.errMsg, + "New Box size is forcing electrostaticCutoffRadius " + "down to %lf\n" + "electrostaticSkinThickness is now %lf\n", + rList - 1.0, 0.05*(rList-1.0) ); + painCave.isFatal = 0; + simError(); + ecr = maxCutoff; + est = 0.05 * ecr; + } + // At least one of the radii changed, so we need a refresh: refreshSim(); - } - + } } @@ -313,19 +309,19 @@ void SimInfo::calcBoxL( void ){ dx = Hmat[0][0]; dy = Hmat[1][0]; dz = Hmat[2][0]; dsq = dx*dx + dy*dy + dz*dz; - boxLx = sqrt( dsq ); + boxL[0] = sqrt( dsq ); // boxLy dx = Hmat[0][1]; dy = Hmat[1][1]; dz = Hmat[2][1]; dsq = dx*dx + dy*dy + dz*dz; - boxLy = sqrt( dsq ); + boxL[1] = sqrt( dsq ); // boxLz dx = Hmat[0][2]; dy = Hmat[1][2]; dz = Hmat[2][2]; dsq = dx*dx + dy*dy + dz*dz; - boxLz = sqrt( dsq ); + boxL[2] = sqrt( dsq ); }