--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/09/22 23:07:57 781 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2003/10/30 18:59:20 845 @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include using namespace std; @@ -94,8 +94,7 @@ void SimInfo::setBoxM( double theBox[3][3] ){ void SimInfo::setBoxM( double theBox[3][3] ){ - int i, j, status; - double smallestBoxL, maxCutoff; + int i, j; double FortranHmat[9]; // to preserve compatibility with Fortran the // ordering in the array is as follows: // [ 0 3 6 ] @@ -302,7 +301,6 @@ void SimInfo::calcBoxL( void ){ void SimInfo::calcBoxL( void ){ double dx, dy, dz, dsq; - int i; // boxVol = Determinant of Hmat @@ -372,7 +370,7 @@ void SimInfo::wrapVector( double thePos[3] ){ void SimInfo::wrapVector( double thePos[3] ){ - int i, j, k; + int i; double scaled[3]; if( !orthoRhombic ){ @@ -410,7 +408,7 @@ int SimInfo::getNDF(){ int SimInfo::getNDF(){ - int ndf_local, ndf; + int ndf_local; ndf_local = 3 * n_atoms + 3 * n_oriented - n_constraints; @@ -426,7 +424,7 @@ int SimInfo::getNDFraw() { } int SimInfo::getNDFraw() { - int ndfRaw_local, ndfRaw; + int ndfRaw_local; // Raw degrees of freedom that we have to set ndfRaw_local = 3 * n_atoms + 3 * n_oriented; @@ -441,7 +439,7 @@ int SimInfo::getNDFtranslational() { } int SimInfo::getNDFtranslational() { - int ndfTrans_local, ndfTrans; + int ndfTrans_local; ndfTrans_local = 3 * n_atoms - n_constraints; @@ -517,33 +515,52 @@ void SimInfo::setRcut( double theRcut ){ void SimInfo::setRcut( double theRcut ){ - if( !haveOrigRcut ){ - haveOrigRcut = 1; - origRcut = theRcut; - } - rCut = theRcut; checkCutOffs(); } -void SimInfo::setEcr( double theEcr ){ +void SimInfo::setDefaultRcut( double theRcut ){ - if( !haveOrigEcr ){ - haveOrigEcr = 1; - origEcr = theEcr; - } + haveOrigRcut = 1; + origRcut = theRcut; + rCut = theRcut; + ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; + + notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); +} + +void SimInfo::setEcr( double theEcr ){ + ecr = theEcr; checkCutOffs(); } +void SimInfo::setDefaultEcr( double theEcr ){ + + haveOrigEcr = 1; + origEcr = theEcr; + + ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; + + ecr = theEcr; + + notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); +} + void SimInfo::setEcr( double theEcr, double theEst ){ est = theEst; setEcr( theEcr ); } +void SimInfo::setDefaultEcr( double theEcr, double theEst ){ + est = theEst; + setDefaultEcr( theEcr ); +} + + void SimInfo::checkCutOffs( void ){ int cutChanged = 0; @@ -610,7 +627,6 @@ void SimInfo::checkCutOffs( void ){ ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; if( cutChanged ){ - notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); }