| 240 |
|
|
| 241 |
|
surfaceMesh_->computeHull(localSites_); |
| 242 |
|
Area0_ = surfaceMesh_->getArea(); |
| 243 |
< |
|
| 244 |
< |
|
| 243 |
> |
//variance_ = 2.0 * OOPSEConstant::kb*simParams->getTargetTemp()/simParams->getDt(); |
| 244 |
> |
|
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
std::map<std::string, HydroProp*> SMIPDForceManager::parseFrictionFile(const std::string& filename) { |
| 277 |
|
int fdf; |
| 278 |
|
|
| 279 |
|
fdf = 0; |
| 280 |
< |
|
| 281 |
< |
|
| 280 |
> |
|
| 281 |
|
/*Compute surface Mesh*/ |
| 282 |
|
surfaceMesh_->computeHull(localSites_); |
| 283 |
|
|
| 284 |
|
/* Get area and number of surface stunt doubles and compute new variance */ |
| 285 |
< |
RealType area = surfaceMesh_->getArea(); |
| 286 |
< |
RealType nSurfaceSDs = surfaceMesh_->getNs(); |
| 287 |
< |
|
| 288 |
< |
std::cerr << "Surface Area is: " << area << " nSurfaceSDs is: " << nSurfaceSDs << std::endl; |
| 285 |
> |
//RealType area = surfaceMesh_->getArea(); |
| 286 |
> |
//RealType nSurfaceSDs = surfaceMesh_->getNs(); |
| 287 |
> |
|
| 288 |
> |
// std::cerr << "Surface Area is: " << area << " nSurfaceSDs is: " << nSurfaceSDs << std::endl; |
| 289 |
|
|
| 290 |
|
/* Compute variance for random forces */ |
| 291 |
|
|
| 292 |
< |
variance_ = sqrt(2.0*NumericConstant::PI)*(targetPressure_*area/nSurfaceSDs); |
| 293 |
< |
|
| 292 |
> |
// variance_ = sqrt(2.0*NumericConstant::PI)*(targetPressure_*area/nSurfaceSDs); |
| 293 |
> |
|
| 294 |
> |
// std::vector<Triangle*> sMesh = surfaceMesh_->getMesh(); |
| 295 |
> |
// std::vector<RealType> randNums = genTriangleForces(sMesh.size(),variance_); |
| 296 |
> |
|
| 297 |
|
/* Loop over the mesh faces and apply random force to each of the faces*/ |
| 298 |
< |
|
| 299 |
< |
std::vector<Triangle*> sMesh = surfaceMesh_->getMesh(); |
| 300 |
< |
std::vector<Triangle*>::iterator face; |
| 301 |
< |
std::vector<StuntDouble*>::iterator vertex; |
| 298 |
> |
|
| 299 |
> |
|
| 300 |
> |
// std::vector<Triangle*>::iterator face; |
| 301 |
> |
// std::vector<StuntDouble*>::iterator vertex; |
| 302 |
> |
/* |
| 303 |
|
for (face = sMesh.begin(); face != sMesh.end(); ++face){ |
| 304 |
|
|
| 305 |
|
Triangle* thisTriangle = *face; |
| 306 |
|
std::vector<StuntDouble*> vertexSDs = thisTriangle->getVertices(); |
| 307 |
|
|
| 308 |
|
for (vertex = vertexSDs.begin(); vertex != vertexSDs.end(); ++vertex){ |
| 309 |
< |
Vector3d randomForce; |
| 310 |
< |
Vector3d randomTorque; |
| 308 |
< |
genRandomForceAndTorque(randomForce, randomTorque, index, variance_); |
| 309 |
< |
mass = integrableObject->getMass(); |
| 309 |
> |
std::cout << (*vertex)->getPos() << std::endl; |
| 310 |
> |
// mass = integrableObject->getMass(); |
| 311 |
|
|
| 312 |
< |
integrableObject->addFrc(randomForce); |
| 312 |
> |
// integrableObject->addFrc(randomForce); |
| 313 |
|
} |
| 314 |
|
|
| 315 |
|
|
| 316 |
|
} |
| 317 |
< |
|
| 318 |
< |
|
| 318 |
< |
|
| 317 |
> |
*/ |
| 318 |
> |
/* |
| 319 |
|
for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { |
| 320 |
|
|
| 321 |
|
|
| 476 |
|
|
| 477 |
|
} |
| 478 |
|
} |
| 479 |
< |
|
| 480 |
< |
info_->setFdf(fdf); |
| 479 |
> |
*/ |
| 480 |
> |
// info_->setFdf(fdf); |
| 481 |
|
// veloMunge->removeComDrift(); |
| 482 |
|
// Remove angular drift if we are not using periodic boundary conditions. |
| 483 |
|
//if(!simParams->getUsePeriodicBoundaryConditions()) |
| 484 |
|
// veloMunge->removeAngularDrift(); |
| 485 |
|
|
| 486 |
< |
ForceManager::postCalculation(needStress); |
| 486 |
> |
//ForceManager::postCalculation(needStress); |
| 487 |
|
} |
| 488 |
|
|
| 489 |
|
void SMIPDForceManager::genRandomForceAndTorque(Vector3d& force, Vector3d& torque, unsigned int index, RealType variance) { |