--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/11/10 21:50:36 859 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2003/11/21 20:10:02 874 @@ -20,6 +20,9 @@ inline double roundMe( double x ){ return ( x >= 0 ) ? floor( x + 0.5 ) : ceil( x - 0.5 ); } +inline double min( double a, double b ){ + return (a < b ) ? a : b; +} SimInfo* currentInfo; @@ -539,11 +542,10 @@ void SimInfo::setDefaultEcr( double theEcr ){ void SimInfo::setDefaultEcr( double theEcr ){ haveEcr = 1; + ecr = theEcr; ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; - ecr = theEcr; - notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); } @@ -563,8 +565,14 @@ void SimInfo::checkCutOffs( void ){ if( rCut > maxCutoff ){ sprintf( painCave.errMsg, "Box size is too small for the long range cutoff radius, " - "%lf, at time %lf\n", - rCut, currentTime ); + "%G, at time %G\n" + " [ %G %G %G ]\n" + " [ %G %G %G ]\n" + " [ %G %G %G ]\n", + rCut, currentTime, + Hmat[0][0], Hmat[0][1], Hmat[0][2], + Hmat[1][0], Hmat[1][1], Hmat[1][2], + Hmat[2][0], Hmat[2][1], Hmat[2][2]); painCave.isFatal = 1; simError(); } @@ -573,8 +581,14 @@ void SimInfo::checkCutOffs( void ){ if( ecr > maxCutoff ){ sprintf( painCave.errMsg, "Box size is too small for the electrostatic cutoff radius, " - "%lf, at time %lf\n", - ecr, currentTime ); + "%G, at time %G\n" + " [ %G %G %G ]\n" + " [ %G %G %G ]\n" + " [ %G %G %G ]\n", + ecr, currentTime, + Hmat[0][0], Hmat[0][1], Hmat[0][2], + Hmat[1][0], Hmat[1][1], Hmat[1][2], + Hmat[2][0], Hmat[2][1], Hmat[2][2]); painCave.isFatal = 1; simError(); }