| 50 |
|
SMIPDForceManager::SMIPDForceManager(SimInfo* info) : ForceManager(info) { |
| 51 |
|
|
| 52 |
|
simParams = info->getSimParams(); |
| 53 |
– |
thermo = new Thermo(info); |
| 53 |
|
veloMunge = new Velocitizer(info); |
| 54 |
|
|
| 55 |
|
// Create Hull, Convex Hull for now, other options later. |
| 62 |
|
if (!simParams->haveTargetTemp()) { |
| 63 |
|
sprintf(painCave.errMsg, |
| 64 |
|
"SMIPDynamics error: You can't use the SMIPD integrator\n" |
| 65 |
< |
" without a targetTemp (K)!\n"); |
| 65 |
> |
"\twithout a targetTemp (K)!\n"); |
| 66 |
|
painCave.isFatal = 1; |
| 67 |
|
painCave.severity = OOPSE_ERROR; |
| 68 |
|
simError(); |
| 73 |
|
if (!simParams->haveTargetPressure()) { |
| 74 |
|
sprintf(painCave.errMsg, |
| 75 |
|
"SMIPDynamics error: You can't use the SMIPD integrator\n" |
| 76 |
< |
" without a targetPressure (atm)!\n"); |
| 76 |
> |
"\twithout a targetPressure (atm)!\n"); |
| 77 |
|
painCave.isFatal = 1; |
| 78 |
|
simError(); |
| 79 |
|
} else { |
| 85 |
|
if (simParams->getUsePeriodicBoundaryConditions()) { |
| 86 |
|
sprintf(painCave.errMsg, |
| 87 |
|
"SMIPDynamics error: You can't use the SMIPD integrator\n" |
| 88 |
< |
" with periodic boundary conditions!\n"); |
| 88 |
> |
"\twith periodic boundary conditions!\n"); |
| 89 |
|
painCave.isFatal = 1; |
| 90 |
|
simError(); |
| 91 |
|
} |
| 93 |
|
if (!simParams->haveThermalConductivity()) { |
| 94 |
|
sprintf(painCave.errMsg, |
| 95 |
|
"SMIPDynamics error: You can't use the SMIPD integrator\n" |
| 96 |
< |
" without a thermalConductivity (W m^-1 K^-1)!\n"); |
| 96 |
> |
"\twithout a thermalConductivity (W m^-1 K^-1)!\n"); |
| 97 |
|
painCave.isFatal = 1; |
| 98 |
|
painCave.severity = OOPSE_ERROR; |
| 99 |
|
simError(); |
| 105 |
|
if (!simParams->haveThermalLength()) { |
| 106 |
|
sprintf(painCave.errMsg, |
| 107 |
|
"SMIPDynamics error: You can't use the SMIPD integrator\n" |
| 108 |
< |
" without a thermalLength (Angstroms)!\n"); |
| 108 |
> |
"\twithout a thermalLength (Angstroms)!\n"); |
| 109 |
|
painCave.isFatal = 1; |
| 110 |
|
painCave.severity = OOPSE_ERROR; |
| 111 |
|
simError(); |
| 141 |
|
StuntDouble* integrableObject; |
| 142 |
|
|
| 143 |
|
// Compute surface Mesh |
| 144 |
+ |
|
| 145 |
|
surfaceMesh_->computeHull(localSites_); |
| 146 |
|
|
| 147 |
|
// Get total area and number of surface stunt doubles |
| 153 |
|
// Generate all of the necessary random forces |
| 154 |
|
std::vector<RealType> randNums = genTriangleForces(nTriangles, variance_); |
| 155 |
|
|
| 156 |
– |
RealType instaTemp = thermo->getTemperature(); |
| 157 |
– |
|
| 156 |
|
// Loop over the mesh faces and apply external pressure to each |
| 157 |
|
// of the faces |
| 158 |
|
std::vector<Triangle>::iterator face; |
| 170 |
|
RealType thisMass = thisTriangle.getFacetMass(); |
| 171 |
|
|
| 172 |
|
// gamma is the drag coefficient normal to the face of the triangle |
| 173 |
< |
RealType gamma = thermalConductivity_ * thisMass * thisArea |
| 173 |
> |
RealType gamma = thermalConductivity_ * thisMass * thisArea |
| 174 |
|
/ (2.0 * thermalLength_ * OOPSEConstant::kB); |
| 175 |
|
|
| 178 |
– |
gamma *= fabs(1.0 - targetTemp_/instaTemp); |
| 179 |
– |
|
| 176 |
|
RealType extPressure = - (targetPressure_ * thisArea) / |
| 177 |
|
OOPSEConstant::energyConvert; |
| 178 |
|
|