--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/11/10 21:50:36 859 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/01/13 23:01:43 941 @@ -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; @@ -477,7 +481,7 @@ void SimInfo::refreshSim(){ fInfo.dielect = 0.0; - if( useDipole ){ + if( useDipoles ){ if( useReactionField )fInfo.dielect = dielectric; } @@ -486,7 +490,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 +544,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 +567,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 +583,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(); }