ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/GridBuilder.cpp
(Generate patch)

Comparing trunk/SHAPES/GridBuilder.cpp (file contents):
Revision 1284 by gezelter, Mon Jun 21 15:54:27 2004 UTC vs.
Revision 1285 by chrisfen, Tue Jun 22 18:04:58 2004 UTC

# Line 3 | Line 3 | GridBuilder::GridBuilder(RigidBody* rb, int bandWidth)
3   #define PI 3.14159265359
4  
5  
6 < GridBuilder::GridBuilder(RigidBody* rb, int bandWidth) {
6 > GridBuilder::GridBuilder(RigidBody* rb, int gridWidth) {
7    rbMol = rb;
8 <  bandwidth = bandWidth;
9 <  thetaStep = PI / bandwidth;
8 >  gridwidth = gridWidth;
9 >  thetaStep = PI / gridwidth;
10    thetaMin = thetaStep / 2.0;
11    phiStep = thetaStep * 2.0;
12   }
# Line 22 | Line 22 | void GridBuilder::launchProbe(int forceField, vector<d
22    double startDist;
23    double phiVal;
24    double thetaVal;
25 +  double sigTemp, sTemp, epsTemp, sigProbe;
26    double minDist = 10.0; //minimum start distance
27          
28    sList = sGrid;
29    sigList = sigmaGrid;
30    epsList = epsGrid;
31    forcefield = forceField;
32 +  
33 +  //load the probe atom parameters
34 +  switch(forcefield){
35 +    case 1:{
36 +      rparHe = 1.4800;
37 +      epsHe = -0.021270;
38 +    }; break;
39 +    case 2:{
40 +      rparHe = 1.14;
41 +      epsHe = 0.0203;
42 +    }; break;
43 +    case 3:{
44 +      rparHe = 2.28;
45 +      epsHe = 0.020269601874;
46 +    }; break;
47 +    case 4:{
48 +      rparHe = 2.5560;
49 +      epsHe = 0.0200;
50 +    }; break;
51 +    case 5:{
52 +      rparHe = 1.14;
53 +      epsHe = 0.0203;
54 +    }; break;
55 +  }
56      
57 <  //first determine the start distance - we always start at least minDist away
57 >  if (rparHe < 2.2)
58 >    sigProbe = 2*rparHe/1.12246204831;
59 >  else
60 >    sigProbe = rparHe;
61 >  
62 >  //determine the start distance - we always start at least minDist away
63    startDist = rbMol->findMaxExtent() + minDist;
64    if (startDist < minDist)
65      startDist = minDist;
66  
37  printf("startDist = %lf\n", startDist);
38
67    //set the initial orientation of the body and loop over theta values
68  
69 <  for (k =0; k < bandwidth; k++) {
69 >  for (k =0; k < gridwidth; k++) {
70      thetaVal = thetaMin + k*thetaStep;
71 <    for (j=0; j < bandwidth; j++) {
71 >    printf("Theta step %i\n", k);
72 >    for (j=0; j < gridwidth; j++) {
73        phiVal = j*phiStep;
74  
46      printf("setting Euler, phi = %lf\ttheta = %lf\n", phiVal, thetaVal);
47
75        rbMol->setEuler(0.0, thetaVal, phiVal);
76  
77        releaseProbe(startDist);
78  
79 <      printf("found sigDist = %lf\t sDist = %lf \t epsVal = %lf\n",
80 <             sigDist, sDist, epsVal);
81 <
82 <      sigList.push_back(sigDist);
83 <      sList.push_back(sDist);
84 <      epsList.push_back(epsVal);
85 <
79 >      //translate the values to sigma, s, and epsilon of the rigid body
80 >      sigTemp = 2*sigDist - sigProbe;
81 >      sTemp = (2*(sDist - sigDist))/(0.122462048309) - sigProbe;
82 >      epsTemp = pow(epsVal, 2)/fabs(epsHe);
83 >      
84 >      sigList.push_back(sigTemp);
85 >      sList.push_back(sTemp);
86 >      epsList.push_back(epsTemp);
87      }
88    }            
89   }
# Line 113 | Line 141 | void GridBuilder::calcEnergy(){
141    double rXij, rYij, rZij;
142    double rijSquared;
143    double rValSquared, rValPowerSix;
116  double rparHe, epsHe;
144    double atomRpar, atomEps;
145    double rbAtomPos[3];
146 <  
120 <  //first get the probe atom parameters
121 <  switch(forcefield){
122 <    case 1:{
123 <      rparHe = 1.4800;
124 <      epsHe = -0.021270;
125 <    }; break;
126 <    case 2:{
127 <      rparHe = 1.14;
128 <      epsHe = 0.0203;
129 <    }; break;
130 <    case 3:{
131 <      rparHe = 2.28;
132 <      epsHe = 0.020269601874;
133 <    }; break;
134 <    case 4:{
135 <      rparHe = 2.5560;
136 <      epsHe = 0.0200;
137 <    }; break;
138 <    case 5:{
139 <      rparHe = 1.14;
140 <      epsHe = 0.0203;
141 <    }; break;
142 <  }
143 <  
146 >    
147    potEnergy = 0.0;
148  
146  rbMol->getAtomPos(rbAtomPos, 0);
147
148  printf("atom0 pos = %lf\t%lf\t%lf\n", rbAtomPos[0], rbAtomPos[1], rbAtomPos[2]);
149
150
151  
149    for(i=0; i<rbMol->getNumAtoms(); i++){
150      rbMol->getAtomPos(rbAtomPos, i);
151      
# Line 158 | Line 155 | void GridBuilder::calcEnergy(){
155      
156      rijSquared = rXij * rXij + rYij * rYij + rZij * rZij;
157      
158 <    //in the interest of keeping the code more compact, we are being less efficient by placing
159 <    //a switch statement in the calculation loop
158 >    //in the interest of keeping the code more compact, we are being less
159 >    //efficient by placing a switch statement in the calculation loop
160      switch(forcefield){
161        case 1:{
162          //we are using the CHARMm force field

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines