ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/libmdtools/ForceFields.cpp
(Generate patch)

Comparing trunk/OOPSE-1.0/libmdtools/ForceFields.cpp (file contents):
Revision 1334 by gezelter, Fri Jul 16 18:58:03 2004 UTC vs.
Revision 1450 by chrisfen, Fri Aug 6 15:52:36 2004 UTC

# Line 193 | Line 193 | void ForceFields::doForces( int calcPot, int calcStres
193      simError();
194    }
195  
196 <  if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) {
197 <    
198 <    factor = pow(entry_plug->thermIntLambda, entry_plug->thermIntK);
199 <    for (i=0; i < entry_plug->n_atoms; i++) {
200 <      for (j=0; j< 3; j++)
201 <        frc[3*i + j] *= factor;
202 <      if (entry_plug->atoms[i]->isDirectional()) {
203 <        for (j=0; j< 3; j++)
204 <          trq[3*i + j] *= factor;
205 <      }
206 <    }
207 <    entry_plug->vRaw = entry_plug->lrPot;
208 <    entry_plug->lrPot *= factor;
209 <    entry_plug->lrPot += entry_plug->restraint->Calc_Restraint_Forces(entry_plug->integrableObjects);
210 <    entry_plug->vHarm = entry_plug->restraint->getVharm();
211 <  }
212 <  
213 <  if (entry_plug->useLiquidThermInt) {
214 <    
196 >  // scale forces if thermodynamic integration is used
197 >  if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) {
198      factor = pow(entry_plug->thermIntLambda, entry_plug->thermIntK);
199      for (i=0; i < entry_plug->n_atoms; i++) {
200        for (j=0; j< 3; j++)
# Line 225 | Line 208 | void ForceFields::doForces( int calcPot, int calcStres
208      entry_plug->lrPot *= factor;
209    }
210  
211 +  // collect the atomic forces onto rigid bodies
212    for(i=0; i<entry_plug->n_mol; i++ ){
213      entry_plug->molecules[i].atoms2rigidBodies();
214    }
215  
216 +  // do crystal restraint forces for thermodynamic integration
217 +  if (entry_plug->useSolidThermInt){
218 +    entry_plug->lrPot += entry_plug->restraint->Calc_Restraint_Forces(entry_plug->integrableObjects);
219 +    entry_plug->vHarm = entry_plug->restraint->getVharm();
220 +  }
221 +  
222  
223   #ifdef IS_MPI
224    sprintf( checkPointMsg,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines