--- trunk/SHAPES/GridBuilder.cpp 2004/06/21 15:10:29 1282 +++ trunk/SHAPES/GridBuilder.cpp 2004/06/21 15:54:27 1283 @@ -9,22 +9,13 @@ 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"); @@ -43,26 +34,29 @@ 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); - - phiVal += phiStep; - rotBody(phiVal, thetaVal); + } - phiVal = 0.0; - thetaVal += thetaStep; - rotBody(phiVal, thetaVal); - printf("step theta %i\n",k); } } @@ -78,8 +72,7 @@ void GridBuilder::releaseProbe(double farPos){ tooClose = 0; epsVal = 0; rhoStep = 0.1; //the distance the probe atom moves between steps - - + while (!tooClose){ calcEnergy(); potProgress.push_back(potEnergy); @@ -149,6 +142,12 @@ void GridBuilder::calcEnergy(){ } potEnergy = 0.0; + + rbMol->getAtomPos(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); @@ -216,28 +215,6 @@ void GridBuilder::calcEnergy(){ } } -void GridBuilder::rotBody(double pValue, double tValue){ - //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] = pValue; - //the second euler angle is for rotation about the x-axis (we use the zxz convention) - angles[1] = tValue; - - //obtain the rotation matrix through the rigid body class - rbMol->doEulerToRotMat(angles, rotX); - - //start from the reference position - identityMat3(rbMatrix); - rbMol->setA(rbMatrix); - - //rotate the rigid body - matMul3(rotX, rbMatrix, rotatedMat); - rbMol->setA(rotatedMat); -} - void GridBuilder::printGridFiles(){ ofstream sigmaOut("sigma.grid"); ofstream sOut("s.grid"); @@ -248,4 +225,4 @@ void GridBuilder::printGridFiles(){ sOut << sList[k] << "\n0\n"; epsOut << epsList[k] << "\n0\n"; } -} \ No newline at end of file +}