--- trunk/SHAPES/GridBuilder.cpp 2004/06/21 18:52:21 1284 +++ trunk/SHAPES/GridBuilder.cpp 2004/06/22 18:04:58 1285 @@ -3,10 +3,10 @@ GridBuilder::GridBuilder(RigidBody* rb, int bandWidth) #define PI 3.14159265359 -GridBuilder::GridBuilder(RigidBody* rb, int bandWidth) { +GridBuilder::GridBuilder(RigidBody* rb, int gridWidth) { rbMol = rb; - bandwidth = bandWidth; - thetaStep = PI / bandwidth; + gridwidth = gridWidth; + thetaStep = PI / gridwidth; thetaMin = thetaStep / 2.0; phiStep = thetaStep * 2.0; } @@ -22,40 +22,68 @@ void GridBuilder::launchProbe(int forceField, vectorfindMaxExtent() + minDist; if (startDist < minDist) startDist = minDist; - printf("startDist = %lf\n", startDist); - //set the initial orientation of the body and loop over theta values - for (k =0; k < bandwidth; k++) { + for (k =0; k < gridwidth; k++) { thetaVal = thetaMin + k*thetaStep; - for (j=0; j < bandwidth; j++) { + printf("Theta step %i\n", k); + for (j=0; j < gridwidth; j++) { phiVal = j*phiStep; - printf("setting Euler, phi = %lf\ttheta = %lf\n", phiVal, thetaVal); - rbMol->setEuler(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); - + //translate the values to sigma, s, and epsilon of the rigid body + sigTemp = 2*sigDist - sigProbe; + sTemp = (2*(sDist - sigDist))/(0.122462048309) - sigProbe; + epsTemp = pow(epsVal, 2)/fabs(epsHe); + + sigList.push_back(sigTemp); + sList.push_back(sTemp); + epsList.push_back(epsTemp); } } } @@ -113,42 +141,11 @@ void GridBuilder::calcEnergy(){ double rXij, rYij, rZij; double rijSquared; double rValSquared, rValPowerSix; - double rparHe, epsHe; double atomRpar, atomEps; double rbAtomPos[3]; - - //first get the probe atom parameters - switch(forcefield){ - case 1:{ - rparHe = 1.4800; - epsHe = -0.021270; - }; break; - case 2:{ - rparHe = 1.14; - epsHe = 0.0203; - }; break; - case 3:{ - rparHe = 2.28; - epsHe = 0.020269601874; - }; break; - case 4:{ - rparHe = 2.5560; - epsHe = 0.0200; - }; break; - case 5:{ - rparHe = 1.14; - epsHe = 0.0203; - }; break; - } - + 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); @@ -158,8 +155,8 @@ void GridBuilder::calcEnergy(){ rijSquared = rXij * rXij + rYij * rYij + rZij * rZij; - //in the interest of keeping the code more compact, we are being less efficient by placing - //a switch statement in the calculation loop + //in the interest of keeping the code more compact, we are being less + //efficient by placing a switch statement in the calculation loop switch(forcefield){ case 1:{ //we are using the CHARMm force field