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

Comparing branches/new_design/OOPSE-3.0/src/integrators/NVE.cpp (file contents):
Revision 1756 by tim, Thu Nov 18 23:26:27 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) {
42 +    return new NVE(info);
43 + }
44 +
45   //register the creator to IntegratorFactory
46 < REGISTER_CREATOR(IntegratorFactory, "NVE", NVE);
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 <    std::vector<StuntDouble*>::iterator j;
53 >    SimInfo::MoleculeIterator i;
54 >    Molecule::IntegrableObjectIterator  j;
55      Molecule* mol;
56      StuntDouble* integrableObject;
57      Vector3d vel;
# Line 63 | Line 71 | void NVE::moveA(){
71                  mass = integrableObject->getMass();
72                  
73                  // velocity half step
74 <                vel += (halfStep /mass * UnitConstant::eConvert) * frc;
74 >                vel += (dt2 /mass * OOPSEConstant::energyConvert) * frc;
75  
76                  // position whole step
77 <                pos += fullStep * vel;
77 >                pos += dt * vel;
78  
79                  integrableObject->setVel(vel);
80                  integrableObject->setPos(pos);
# Line 81 | Line 89 | void NVE::moveA(){
89  
90                      ji = integrableObject->getJ();
91  
92 <                    ji += (halfStep  * 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 92 | Line 100 | void NVE::moveA(){
100          }
101      } //end for(mol = info_->beginMolecule(i))
102      
103 <    constraintAlgorithm->doConstrainA();
103 >    //constraintAlgorithm->doConstrainA();
104      
105   }    
106  
107   void NVE::moveB(){
108 <    typename SimInfo::MoleculeIterator i;
109 <    std::vector<StuntDouble*>::iterator j;
108 >    SimInfo::MoleculeIterator i;
109 >    Molecule::IntegrableObjectIterator  j;
110      Molecule* mol;
111      StuntDouble* integrableObject;
112      Vector3d vel;
# Line 116 | Line 124 | void NVE::moveB(){
124                  mass = integrableObject->getMass();
125                  
126                  // velocity half step
127 <                vel += (halfStep /mass * UnitConstant::eConvert) * frc;
127 >                vel += (dt2 /mass * OOPSEConstant::energyConvert) * frc;
128                  
129                  integrableObject->setVel(vel);
130  
# Line 130 | Line 138 | void NVE::moveB(){
138  
139                      ji = integrableObject->getJ();
140  
141 <                    ji += (halfStep  * UnitConstant::eConvert) * Tb;
141 >                    ji += (dt2  * OOPSEConstant::energyConvert) * Tb;
142  
143                      integrableObject->setJ(ji);
144                  }
# Line 140 | Line 148 | void NVE::moveB(){
148      } //end for(mol = info_->beginMolecule(i))
149    
150  
151 <    constraintAlgorithm->doConstrainB();
151 >    //constraintAlgorithm->doConstrainB();
152  
153   }
154  
155  
156 < void NVE::calcConservedQuantity() {
157 <
156 > double NVE::calcConservedQuantity() {
157 >    return thermo.getTotalE();
158   }
159  
160   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines