--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/11/10 21:50:36 859 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/01/19 21:17:39 965 @@ -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; @@ -52,7 +55,8 @@ SimInfo::SimInfo(){ usePBC = 0; useLJ = 0; useSticky = 0; - useDipole = 0; + useCharges = 0; + useDipoles = 0; useReactionField = 0; useGB = 0; useEAM = 0; @@ -176,15 +180,17 @@ void SimInfo::calcHmatInv( void ) { if( orthoRhombic ){ sprintf( painCave.errMsg, - "Hmat is switching from Non-Orthorhombic to OrthoRhombic\n" - " If this is a bad thing, change the orthoBoxTolerance( currently %G ).\n", + "Hmat is switching from Non-Orthorhombic to Orthorhombic Box.\n" + "\tIf this is a bad thing, change the orthoBoxTolerance\n" + "\tvariable ( currently set to %G ).\n", orthoTolerance); simError(); } else { sprintf( painCave.errMsg, - "Hmat is switching from Orthorhombic to Non-OrthoRhombic\n" - " If this is a bad thing, change the orthoBoxTolerance( currently %G ).\n", + "Hmat is switching from Orthorhombic to Non-Orthorhombic Box.\n" + "\tIf this is a bad thing, change the orthoBoxTolerance\n" + "\tvariable ( currently set to %G ).\n", orthoTolerance); simError(); } @@ -477,7 +483,7 @@ void SimInfo::refreshSim(){ fInfo.dielect = 0.0; - if( useDipole ){ + if( useDipoles ){ if( useReactionField )fInfo.dielect = dielectric; } @@ -486,7 +492,8 @@ void SimInfo::refreshSim(){ fInfo.SIM_uses_LJ = useLJ; fInfo.SIM_uses_sticky = useSticky; //fInfo.SIM_uses_sticky = 0; - fInfo.SIM_uses_dipoles = useDipole; + fInfo.SIM_uses_charges = useCharges; + fInfo.SIM_uses_dipoles = useDipoles; //fInfo.SIM_uses_dipoles = 0; //fInfo.SIM_uses_RF = useReactionField; fInfo.SIM_uses_RF = 0; @@ -539,11 +546,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 +569,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" + "\t[ %G %G %G ]\n" + "\t[ %G %G %G ]\n" + "\t[ %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 +585,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" + "\t[ %G %G %G ]\n" + "\t[ %G %G %G ]\n" + "\t[ %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(); } @@ -582,7 +600,8 @@ void SimInfo::checkCutOffs( void ){ } else { // initialize this stuff before using it, OK? sprintf( painCave.errMsg, - "Trying to check cutoffs without a box. Be smarter.\n" ); + "Trying to check cutoffs without a box.\n" + "\tOOPSE should have better programmers than that.\n" ); painCave.isFatal = 1; simError(); }