--- trunk/SHAPES/GridBuilder.cpp 2004/06/21 13:38:55 1281 +++ trunk/SHAPES/GridBuilder.cpp 2004/06/21 15:54:27 1283 @@ -9,26 +9,19 @@ GridBuilder::GridBuilder(RigidBody* rb, int bandWidth) thetaStep = PI / bandwidth; thetaMin = thetaStep / 2.0; phiStep = thetaStep * 2.0; - - //zero out the rot mats - for (i=0; i<3; i++) { - for (j=0; j<3; j++) { - rotX[i][j] = 0.0; - rotZ[i][j] = 0.0; - rbMatrix[i][j] = 0.0; - } - } } GridBuilder::~GridBuilder() { } -void GridBuilder::launchProbe(int forceField, vector sigmaGrid, vector sGrid, - vector epsGrid){ +void GridBuilder::launchProbe(int forceField, vector sigmaGrid, + vector sGrid, vector epsGrid){ ofstream sigmaOut("sigma.grid"); ofstream sOut("s.grid"); ofstream epsOut("eps.grid"); double startDist; + double phiVal; + double thetaVal; double minDist = 10.0; //minimum start distance sList = sGrid; @@ -41,36 +34,32 @@ void GridBuilder::launchProbe(int forceField, vectorsetEuler(0.0, thetaVal, phiVal); + releaseProbe(startDist); + printf("found sigDist = %lf\t sDist = %lf \t epsVal = %lf\n", + sigDist, sDist, epsVal); + sigList.push_back(sigDist); sList.push_back(sDist); epsList.push_back(epsVal); - - stepPhi(phiStep); + } - stepTheta(thetaStep); } - /* - //write out the grid files - printf("the grid size is %d\n",sigmaGrid.size()); - for (k=0; kgetAtomPos(rbAtomPos, 0); + + printf("atom0 pos = %lf\t%lf\t%lf\n", rbAtomPos[0], rbAtomPos[1], rbAtomPos[2]); + + for(i=0; igetNumAtoms(); i++){ rbMol->getAtomPos(rbAtomPos, i); @@ -197,7 +191,6 @@ void GridBuilder::calcEnergy(){ potEnergy += 4*sqrt(epsHe*atomEps)*(rValPowerSix * (rValPowerSix - 1.0)); }; break; - case 4:{ //we are using the OPLS force field @@ -222,40 +215,6 @@ void GridBuilder::calcEnergy(){ } } -void GridBuilder::stepTheta(double increment){ - //zero out the euler angles - for (l=0; l<3; l++) - angles[i] = 0.0; - - //the second euler angle is for rotation about the x-axis (we use the zxz convention) - angles[1] = increment; - - //obtain the rotation matrix through the rigid body class - rbMol->doEulerToRotMat(angles, rotX); - - //rotate the rigid body - rbMol->getA(rbMatrix); - matMul3(rotX, rbMatrix, rotatedMat); - rbMol->setA(rotatedMat); -} - -void GridBuilder::stepPhi(double increment){ - //zero out the euler angles - for (l=0; l<3; l++) - angles[i] = 0.0; - - //the phi euler angle is for rotation about the z-axis (we use the zxz convention) - angles[0] = increment; - - //obtain the rotation matrix through the rigid body class - rbMol->doEulerToRotMat(angles, rotZ); - - //rotate the rigid body - rbMol->getA(rbMatrix); - matMul3(rotZ, rbMatrix, rotatedMat); - rbMol->setA(rotatedMat); -} - void GridBuilder::printGridFiles(){ ofstream sigmaOut("sigma.grid"); ofstream sOut("s.grid"); @@ -266,4 +225,4 @@ void GridBuilder::printGridFiles(){ sOut << sList[k] << "\n0\n"; epsOut << epsList[k] << "\n0\n"; } -} \ No newline at end of file +}