ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/integrators/NVE.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/integrators/NVE.cpp (file contents):
Revision 1774 by tim, Tue Nov 23 23:12:23 2004 UTC vs.
Revision 1820 by tim, Thu Dec 2 00:09:35 2004 UTC

# Line 30 | Line 30
30    * @time 15:13am
31    * @version 1.0
32    */
33 <
33 >  
34 > #include "integrators/IntegratorFactory.hpp"
35   #include "integrators/NVE.hpp"
36 + #include "primitives/Molecule.hpp"
37 + #include "utils/OOPSEConstant.hpp"
38 +
39   namespace oopse {
40  
41   Integrator* createNVE(SimInfo* info) {
# Line 39 | Line 43 | IntegratorFactory::getInstance()->registerIntegrator("
43   }
44  
45   //register the creator to IntegratorFactory
46 < IntegratorFactory::getInstance()->registerIntegrator("NVE", createNVE);
46 > bool registerNVEStatus = IntegratorFactory::getInstance()->registerIntegrator("NVE", createNVE);
47  
48   NVE::NVE(SimInfo* info) : VelocityVerletIntegrator(info){
49  
50   }
51  
52   void NVE::moveA(){
53 <    typename SimInfo::MoleculeIterator i;
54 <    typename Molecule::IntegrableObjectIterator  j;
53 >    SimInfo::MoleculeIterator i;
54 >    Molecule::IntegrableObjectIterator  j;
55      Molecule* mol;
56      StuntDouble* integrableObject;
57      Vector3d vel;
# Line 67 | Line 71 | void NVE::moveA(){
71                  mass = integrableObject->getMass();
72                  
73                  // velocity half step
74 <                vel += (dt2 /mass * UnitConstant::eConvert) * frc;
74 >                vel += (dt2 /mass * OOPSEConstant::energyConvert) * frc;
75  
76                  // position whole step
77                  pos += dt * vel;
# Line 85 | Line 89 | void NVE::moveA(){
89  
90                      ji = integrableObject->getJ();
91  
92 <                    ji += (dt2  * UnitConstant::eConvert) * Tb;
92 >                    ji += (dt2  * OOPSEConstant::energyConvert) * Tb;
93  
94 <                    this->rotationPropagation( integrableObject, ji );
94 >                    rotAlgo->rotate(integrableObject, ji, dt);
95  
96                      integrableObject->setJ(ji);
97                  }
# Line 101 | Line 105 | void NVE::moveB(){
105   }    
106  
107   void NVE::moveB(){
108 <    typename SimInfo::MoleculeIterator i;
109 <    typename Molecule::IntegrableObjectIterator  j;
108 >    SimInfo::MoleculeIterator i;
109 >    Molecule::IntegrableObjectIterator  j;
110      Molecule* mol;
111      StuntDouble* integrableObject;
112      Vector3d vel;
# Line 120 | Line 124 | void NVE::moveB(){
124                  mass = integrableObject->getMass();
125                  
126                  // velocity half step
127 <                vel += (dt2 /mass * UnitConstant::eConvert) * frc;
127 >                vel += (dt2 /mass * OOPSEConstant::energyConvert) * frc;
128                  
129                  integrableObject->setVel(vel);
130  
# Line 134 | Line 138 | void NVE::moveB(){
138  
139                      ji = integrableObject->getJ();
140  
141 <                    ji += (dt2  * UnitConstant::eConvert) * Tb;
141 >                    ji += (dt2  * OOPSEConstant::energyConvert) * Tb;
142  
143                      integrableObject->setJ(ji);
144                  }
# Line 150 | Line 154 | double NVE::calcConservedQuantity() {
154  
155  
156   double NVE::calcConservedQuantity() {
157 <
157 >    return thermo.getTotalE();
158   }
159  
160   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines