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

Comparing:
trunk/src/integrators/LDForceManager.cpp (file contents), Revision 1293 by chuckv, Sun Sep 14 01:32:26 2008 UTC vs.
branches/development/src/integrators/LDForceManager.cpp (file contents), Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
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).          
39 + * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 + * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42   #include <fstream>
43   #include <iostream>
44   #include "integrators/LDForceManager.hpp"
45   #include "math/CholeskyDecomposition.hpp"
46 < #include "utils/OOPSEConstant.hpp"
46 > #include "utils/PhysicalConstants.hpp"
47   #include "hydrodynamics/Sphere.hpp"
48   #include "hydrodynamics/Ellipsoid.hpp"
49   #include "utils/ElementsTable.hpp"
50  
51 < namespace oopse {
51 > namespace OpenMD {
52  
53    LDForceManager::LDForceManager(SimInfo* info) : ForceManager(info), forceTolerance_(1e-6), maxIterNum_(4) {
54      simParams = info->getSimParams();
# Line 62 | Line 63 | namespace oopse {
63          sprintf( painCave.errMsg,
64                   "langevinBufferRadius must be specified "
65                   "when useSphericalBoundaryConditions is turned on.\n");
66 <        painCave.severity = OOPSE_ERROR;
66 >        painCave.severity = OPENMD_ERROR;
67          painCave.isFatal = 1;
68          simError();  
69        }
# Line 73 | Line 74 | namespace oopse {
74          sprintf( painCave.errMsg,
75                   "frozenBufferRadius must be specified "
76                   "when useSphericalBoundaryConditions is turned on.\n");
77 <        painCave.severity = OOPSE_ERROR;
77 >        painCave.severity = OPENMD_ERROR;
78          painCave.isFatal = 1;
79          simError();  
80        }
# Line 82 | Line 83 | namespace oopse {
83          sprintf( painCave.errMsg,
84                   "frozenBufferRadius has been set smaller than the "
85                   "langevinBufferRadius.  This is probably an error.\n");
86 <        painCave.severity = OOPSE_WARNING;
86 >        painCave.severity = OPENMD_WARNING;
87          painCave.isFatal = 0;
88          simError();  
89        }
# Line 120 | Line 121 | namespace oopse {
121                   "HydroPropFile must be set to a file name if Langevin Dynamics\n"
122                   "\tis specified for rigidBodies which contain more than one atom\n"
123                   "\tTo create a HydroPropFile, run the \"Hydro\" program.\n");
124 <        painCave.severity = OOPSE_ERROR;
124 >        painCave.severity = OPENMD_ERROR;
125          painCave.isFatal = 1;
126          simError();  
127        }      
# Line 137 | Line 138 | namespace oopse {
138            } else {
139              sprintf( painCave.errMsg,
140                       "Can not find resistance tensor for atom [%s]\n", integrableObject->getType().c_str());
141 <            painCave.severity = OOPSE_ERROR;
141 >            painCave.severity = OPENMD_ERROR;
142              painCave.isFatal = 1;
143              simError();  
144            }        
# Line 171 | Line 172 | namespace oopse {
172                  } else {
173                    sprintf( painCave.errMsg,
174                             "Can not cast GenericData to GayBerneParam\n");
175 <                  painCave.severity = OOPSE_ERROR;
175 >                  painCave.severity = OPENMD_ERROR;
176                    painCave.isFatal = 1;
177                    simError();  
178                  }
179                } else {
180                  sprintf( painCave.errMsg, "Can not find Parameters for GayBerne\n");
181 <                painCave.severity = OOPSE_ERROR;
181 >                painCave.severity = OPENMD_ERROR;
182                  painCave.isFatal = 1;
183                  simError();    
184                }
# Line 192 | Line 193 | namespace oopse {
193                    } else {
194                      sprintf( painCave.errMsg,
195                               "Can not cast GenericData to LJParam\n");
196 <                    painCave.severity = OOPSE_ERROR;
196 >                    painCave.severity = OPENMD_ERROR;
197                      painCave.isFatal = 1;
198                      simError();          
199                    }      
# Line 204 | Line 205 | namespace oopse {
205                  } else {
206                    sprintf( painCave.errMsg,
207                             "Could not find atom type in default element.txt\n");
208 <                  painCave.severity = OOPSE_ERROR;
208 >                  painCave.severity = OPENMD_ERROR;
209                    painCave.isFatal = 1;
210                    simError();          
211                  }
# Line 215 | Line 216 | namespace oopse {
216            if (!simParams->haveTargetTemp()) {
217              sprintf(painCave.errMsg, "You can't use LangevinDynamics without a targetTemp!\n");
218              painCave.isFatal = 1;
219 <            painCave.severity = OOPSE_ERROR;
219 >            painCave.severity = OPENMD_ERROR;
220              simError();
221            }
222  
223            if (!simParams->haveViscosity()) {
224              sprintf(painCave.errMsg, "You can't use LangevinDynamics without a viscosity!\n");
225              painCave.isFatal = 1;
226 <            painCave.severity = OOPSE_ERROR;
226 >            painCave.severity = OPENMD_ERROR;
227              simError();
228            }
229  
# Line 239 | Line 240 | namespace oopse {
240          }
241        }
242      }
243 <    variance_ = 2.0 * OOPSEConstant::kb*simParams->getTargetTemp()/simParams->getDt();
243 >    variance_ = 2.0 * PhysicalConstants::kb*simParams->getTargetTemp()/simParams->getDt();
244    }  
245  
246    std::map<std::string, HydroProp*> LDForceManager::parseFrictionFile(const std::string& filename) {
# Line 259 | Line 260 | namespace oopse {
260      return props;
261    }
262    
263 <  void LDForceManager::postCalculation(bool needStress){
263 >  void LDForceManager::postCalculation(){
264      SimInfo::MoleculeIterator i;
265      Molecule::IntegrableObjectIterator  j;
266      Molecule* mol;
# Line 342 | Line 343 | namespace oopse {
343              //estimate velocity at full-step using everything but friction forces:          
344  
345              frc = integrableObject->getFrc();
346 <            Vector3d velStep = vel + (dt2_ /mass * OOPSEConstant::energyConvert) * frc;
346 >            Vector3d velStep = vel + (dt2_ /mass * PhysicalConstants::energyConvert) * frc;
347  
348              Tb = integrableObject->lab2Body(integrableObject->getTrq());
349 <            Vector3d angMomStep = angMom + (dt2_ * OOPSEConstant::energyConvert) * Tb;                            
349 >            Vector3d angMomStep = angMom + (dt2_ * PhysicalConstants::energyConvert) * Tb;                            
350  
351              Vector3d omegaLab;
352              Vector3d vcdLab;
# Line 391 | Line 392 | namespace oopse {
392                
393                // re-estimate velocities at full-step using friction forces:
394                
395 <              velStep = vel + (dt2_ / mass * OOPSEConstant::energyConvert) * (frc + frictionForceLab);
396 <              angMomStep = angMom + (dt2_ * OOPSEConstant::energyConvert) * (Tb + frictionTorqueBody);
395 >              velStep = vel + (dt2_ / mass * PhysicalConstants::energyConvert) * (frc + frictionForceLab);
396 >              angMomStep = angMom + (dt2_ * PhysicalConstants::energyConvert) * (Tb + frictionTorqueBody);
397  
398                // check for convergence (if the vectors have converged, fdot and tdot will both be 1.0):
399                
# Line 427 | Line 428 | namespace oopse {
428              //estimate velocity at full-step using everything but friction forces:          
429  
430              frc = integrableObject->getFrc();
431 <            Vector3d velStep = vel + (dt2_ / mass * OOPSEConstant::energyConvert) * frc;
431 >            Vector3d velStep = vel + (dt2_ / mass * PhysicalConstants::energyConvert) * frc;
432  
433              Vector3d frictionForce(0.0);
434              Vector3d oldFF;  // used to test for convergence
# Line 442 | Line 443 | namespace oopse {
443  
444                // re-estimate velocities at full-step using friction forces:
445                
446 <              velStep = vel + (dt2_ / mass * OOPSEConstant::energyConvert) * (frc + frictionForce);
446 >              velStep = vel + (dt2_ / mass * PhysicalConstants::energyConvert) * (frc + frictionForce);
447  
448                // check for convergence (if the vector has converged, fdot will be 1.0):
449                
# Line 468 | Line 469 | namespace oopse {
469      if(!simParams->getUsePeriodicBoundaryConditions())
470        veloMunge->removeAngularDrift();
471  
472 <    ForceManager::postCalculation(needStress);  
472 >    ForceManager::postCalculation();  
473    }
474  
475   void LDForceManager::genRandomForceAndTorque(Vector3d& force, Vector3d& torque, unsigned int index, RealType variance) {

Comparing:
trunk/src/integrators/LDForceManager.cpp (property svn:keywords), Revision 1293 by chuckv, Sun Sep 14 01:32:26 2008 UTC vs.
branches/development/src/integrators/LDForceManager.cpp (property svn:keywords), Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines