| 1 |
|
/* |
| 2 |
< |
* Copyright (c) 2008 The University of Notre Dame. All Rights Reserved. |
| 2 |
> |
* Copyright (c) 2008, 2009 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
* |
| 4 |
|
* The University of Notre Dame grants you ("Licensee") a |
| 5 |
|
* non-exclusive, royalty free, license to use, modify and |
| 146 |
|
|
| 147 |
|
// Get total area and number of surface stunt doubles |
| 148 |
|
RealType area = surfaceMesh_->getArea(); |
| 149 |
– |
int nSurfaceSDs = surfaceMesh_->getNs(); |
| 149 |
|
std::vector<Triangle> sMesh = surfaceMesh_->getMesh(); |
| 150 |
|
int nTriangles = sMesh.size(); |
| 151 |
|
|
| 181 |
|
Vector3d langevinForce = (extPressure + randomForce + dragForce) * |
| 182 |
|
unitNormal; |
| 183 |
|
|
| 184 |
< |
// Apply triangle force to stuntdouble vertices |
| 184 |
> |
// Apply triangle force to stuntdouble vertices |
| 185 |
|
for (vertex = vertexSDs.begin(); vertex != vertexSDs.end(); ++vertex){ |
| 186 |
< |
if ((*vertex) != NULL){ |
| 186 |
> |
if ((*vertex) != NULL){ |
| 187 |
|
Vector3d vertexForce = langevinForce / 3.0; |
| 188 |
+ |
// std::cout << "Adding force: " << facetVel << " to global id: " << (*vertex)->getGlobalIndex() << std::endl; |
| 189 |
|
(*vertex)->addFrc(vertexForce); |
| 190 |
– |
if ((*vertex)->isDirectional()){ |
| 191 |
– |
Vector3d vertexPos = (*vertex)->getPos(); |
| 192 |
– |
Vector3d vertexCentroidVector = vertexPos - centroid; |
| 193 |
– |
(*vertex)->addTrq(cross(vertexCentroidVector,vertexForce)); |
| 194 |
– |
} |
| 190 |
|
} |
| 191 |
|
} |
| 192 |
|
} |