ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/integrators/SMIPDForceManager.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/integrators/SMIPDForceManager.cpp (file contents):
Revision 3460 by chuckv, Tue Oct 7 17:12:48 2008 UTC vs.
Revision 3461 by chuckv, Wed Oct 15 18:26:01 2008 UTC

# Line 290 | Line 290 | namespace oopse {
290  
291       /* Compute variance for random forces */
292      
293 <     variance_ = sqrt(2.0*NumericConstant::PI)*((targetPressure_/OOPSEConstant::pressureConvert)*area/nSurfaceSDs);
293 >     variance_ = sqrt(2.0*NumericConstant::PI)*((targetPressure_/OOPSEConstant::pressureConvert)*area/nSurfaceSDs)
294 >       /OOPSEConstant::energyConvert;
295      
296      std::vector<Triangle*> sMesh = surfaceMesh_->getMesh();
297      std::vector<RealType>  randNums = genTriangleForces(sMesh.size(),variance_);
# Line 310 | Line 311 | namespace oopse {
311        Vector3d unitNormal = thisTriangle->getNormal();
312        unitNormal.normalize();
313        Vector3d randomForce = -randNums[thisNumber] * unitNormal;
314 <      
314 >      Vector3d centroid = thisTriangle->getCentroid();
315 >
316        for (vertex = vertexSDs.begin(); vertex != vertexSDs.end(); ++vertex){
317  
318           // mass = integrableObject->getMass();
319 <
320 <                    (*vertex)->addFrc(randomForce/3.0);          
319 >        Vector3d vertexForce = randomForce/3.0;
320 >        (*vertex)->addFrc(vertexForce);
321 >        if (integrableObject->isDirectional()){
322 >          Vector3d vertexPos = (*vertex)->getPos();
323 >          Vector3d vertexCentroidVector = vertexPos - centroid;
324 >          (*vertex)->addTrq(cross(vertexCentroidVector,vertexForce));
325 >        }
326 >          
327        }
328      }
329  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines