ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/integrators/LangevinHullForceManager.cpp
(Generate patch)

Comparing branches/development/src/integrators/LangevinHullForceManager.cpp (file contents):
Revision 1668 by gezelter, Fri Jan 6 19:03:05 2012 UTC vs.
Revision 1855 by gezelter, Tue Apr 2 18:31:51 2013 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39   * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40   * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
# Line 131 | Line 131 | namespace OpenMD {
131        viscosity_ = simParams->getViscosity();
132      }
133      
134 +    doThermalCoupling_ = true;
135 +    if ( fabs(viscosity_) < 1e-6 ) {
136 +      sprintf(painCave.errMsg,
137 +              "LangevinHullDynamics: The bath viscosity was set lower than\n"
138 +              "\t1e-6 poise.  OpenMD is turning off the thermal coupling to\n"
139 +              "\t the bath.\n");
140 +      painCave.isFatal = 0;
141 +      painCave.severity = OPENMD_INFO;
142 +      simError();
143 +      doThermalCoupling_ = false;
144 +    }
145 +
146      dt_ = simParams->getDt();
147    
148      variance_ = 2.0 * PhysicalConstants::kb * targetTemp_ / dt_;
# Line 138 | Line 150 | namespace OpenMD {
150      // Build a vector of integrable objects to determine if the are
151      // surface atoms
152      Molecule* mol;
153 <    StuntDouble* integrableObject;
153 >    StuntDouble* sd;
154      SimInfo::MoleculeIterator i;
155      Molecule::IntegrableObjectIterator  j;
156  
157      for (mol = info_->beginMolecule(i); mol != NULL;
158           mol = info_->nextMolecule(i)) {          
159 <      for (integrableObject = mol->beginIntegrableObject(j);
160 <           integrableObject != NULL;
161 <           integrableObject = mol->nextIntegrableObject(j)) {  
162 <        localSites_.push_back(integrableObject);
159 >      for (sd = mol->beginIntegrableObject(j);
160 >           sd != NULL;
161 >           sd = mol->nextIntegrableObject(j)) {
162 >        localSites_.push_back(sd);
163        }
164      }  
165    }  
166    
167    void LangevinHullForceManager::postCalculation(){
156    SimInfo::MoleculeIterator i;
157    Molecule::IntegrableObjectIterator  j;
158    Molecule* mol;
159    StuntDouble* integrableObject;
168    
169      // Compute surface Mesh
170      surfaceMesh_->computeHull(localSites_);
# Line 188 | Line 196 | namespace OpenMD {
196        hydroTensor *= PhysicalConstants::viscoConvert;
197        Mat3x3d S;
198        CholeskyDecomposition(hydroTensor, S);
199 <      
199 >
200        Vector3d extPressure = -unitNormal * (targetPressure_ * thisArea) /
201          PhysicalConstants::energyConvert;
202  
203 <      Vector3d randomForce = S * randNums[thisFacet++];
204 <      Vector3d dragForce = -hydroTensor * facetVel;
203 >      Vector3d randomForce(V3Zero);
204 >      Vector3d dragForce(V3Zero);
205 >      if (doThermalCoupling_) {
206 >        randomForce = S * randNums[thisFacet++];
207 >        dragForce = -hydroTensor * facetVel;
208 >      }
209  
210        Vector3d langevinForce = (extPressure + randomForce + dragForce);
211        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines