--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/07/08 20:56:10 574 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2003/07/09 22:14:06 586 @@ -47,65 +47,18 @@ void SimInfo::setBox(double newBox[3]) { } void SimInfo::setBox(double newBox[3]) { - - double smallestBoxL, maxCutoff; - int status; + int i; + double tempMat[9]; - for(i=0; i<9; i++) Hmat[i] = 0.0;; + for(i=0; i<9; i++) tempMat[i] = 0.0;; - Hmat[0] = newBox[0]; - Hmat[4] = newBox[1]; - Hmat[8] = newBox[2]; - - calcHmatI(); - calcBoxL(); - - setFortranBoxSize(Hmat, HmatI, &orthoRhombic); - - smallestBoxL = boxLx; - if (boxLy < smallestBoxL) smallestBoxL = boxLy; - if (boxLz < smallestBoxL) smallestBoxL = boxLz; - - maxCutoff = smallestBoxL / 2.0; - - if (rList > maxCutoff) { - sprintf( painCave.errMsg, - "New Box size is forcing neighborlist radius down to %lf\n", - 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(); + tempMat[0] = newBox[0]; + tempMat[4] = newBox[1]; + tempMat[8] = newBox[2]; - rCut = rList - 1.0; + setBoxM( tempMat ); - // list radius changed so we have to refresh the simulation structure. - refreshSim(); - } - - if (rCut > maxCutoff) { - sprintf( painCave.errMsg, - "New Box size is forcing cutoff radius down to %lf\n", - maxCutoff ); - painCave.isFatal = 0; - simError(); - - status = 0; - LJ_new_rcut(&rCut, &status); - if (status != 0) { - sprintf( painCave.errMsg, - "Error in recomputing LJ shifts based on new rcut\n"); - painCave.isFatal = 1; - simError(); - } - } } void SimInfo::setBoxM( double theBox[9] ){ @@ -114,8 +67,17 @@ void SimInfo::setBoxM( double theBox[9] ){ double smallestBoxL, maxCutoff; for(i=0; i<9; i++) Hmat[i] = theBox[i]; + + cerr + << "setting Hmat ->\n" + << "[ " << Hmat[0] << ", " << Hmat[3] << ", " << Hmat[6] << " ]\n" + << "[ " << Hmat[1] << ", " << Hmat[4] << ", " << Hmat[7] << " ]\n" + << "[ " << Hmat[2] << ", " << Hmat[5] << ", " << Hmat[8] << " ]\n"; + calcHmatI(); calcBoxL(); + + setFortranBoxSize(Hmat, HmatI, &orthoRhombic); @@ -175,6 +137,8 @@ void SimInfo::scaleBox(double scale) { void SimInfo::scaleBox(double scale) { double theBox[9]; int i; + + cerr << "Scaling box by " << scale << "\n"; for(i=0; i<9; i++) theBox[i] = Hmat[i]*scale;