--- branches/new_design/OOPSE-2.0/src/integrators/NVE.cpp 2004/11/10 22:50:03 1726 +++ branches/new_design/OOPSE-2.0/src/integrators/NVE.cpp 2004/11/22 20:55:52 1765 @@ -34,16 +34,20 @@ namespace oopse { #include "integrators/NVE.hpp" namespace oopse { +Integrator* createNVE(SimInfo* info) { + return new NVE(info); +} + //register the creator to IntegratorFactory -REGISTER_CREATOR(IntegratorFactory, "NVE", NVE); +IntegratorFactory::getInstance()->registerIntegrator("NVE", createNVE); -NVE::NVE(SimInfo* info) { +NVE::NVE(SimInfo* info) : VelocityVerletIntegrator(info){ } -NVE::moveA(){ +void NVE::moveA(){ typename SimInfo::MoleculeIterator i; - std::vector::iterator j; + typename Molecule::IntegrableObjectIterator j; Molecule* mol; StuntDouble* integrableObject; Vector3d vel; @@ -52,10 +56,8 @@ NVE::moveA(){ Vector3d Tb; Vector3d ji; double mass; - - // Raw degrees of freedom that we have to set - for (mol = info->beginMolecule(i); mol != NULL; mol = info->nextMolecule(i)) { + for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL; integrableObject = mol->nextIntegrableObject(j)) { @@ -92,15 +94,15 @@ NVE::moveA(){ } - } //end for(mol = info->beginMolecule(i)) + } //end for(mol = info_->beginMolecule(i)) - constraintAlgorithm->doConstrainA(); + //constraintAlgorithm->doConstrainA(); } -NVE::moveB(){ +void NVE::moveB(){ typename SimInfo::MoleculeIterator i; - std::vector::iterator j; + typename Molecule::IntegrableObjectIterator j; Molecule* mol; StuntDouble* integrableObject; Vector3d vel; @@ -109,7 +111,7 @@ NVE::moveB(){ Vector3d ji; double mass; - for (mol = info->beginMolecule(i); mol != NULL; mol = info->nextMolecule(i)) { + for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL; integrableObject = mol->nextIntegrableObject(j)) { @@ -139,11 +141,16 @@ NVE::moveB(){ } - } //end for(mol = info->beginMolecule(i)) + } //end for(mol = info_->beginMolecule(i)) - constraintAlgorithm->doConstrainB(); + //constraintAlgorithm->doConstrainB(); } + +void NVE::calcConservedQuantity() { + +} + } //end namespace oopse