| 1 |
< |
/* |
| 1 |
> |
/* |
| 2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
* |
| 4 |
|
* The University of Notre Dame grants you ("Licensee") a |
| 39 |
|
* such damages. |
| 40 |
|
*/ |
| 41 |
|
|
| 42 |
< |
/** |
| 43 |
< |
* @file VelocityVerletIntegrator.hpp |
| 44 |
< |
* @author tlin |
| 45 |
< |
* @date 11/08/2004 |
| 46 |
< |
* @time 13:25am |
| 47 |
< |
* @version 1.0 |
| 48 |
< |
*/ |
| 42 |
> |
/** |
| 43 |
> |
* @file VelocityVerletIntegrator.hpp |
| 44 |
> |
* @author tlin |
| 45 |
> |
* @date 11/08/2004 |
| 46 |
> |
* @time 13:25am |
| 47 |
> |
* @version 1.0 |
| 48 |
> |
*/ |
| 49 |
|
|
| 50 |
|
#ifndef INTEGRATORS_VELOCITYVERLETINTEGRATOR_HPP |
| 51 |
|
#define INTEGRATORS_VELOCITYVERLETINTEGRATOR_HPP |
| 55 |
|
#include "constraints/Rattle.hpp" |
| 56 |
|
namespace oopse { |
| 57 |
|
|
| 58 |
< |
/** |
| 59 |
< |
* @class VelocityVerletIntegrator VelocityVerletIntegrator.hpp "integrators/VelocityVerletIntegrator.hpp" |
| 60 |
< |
* @brief Velocity-Verlet Family Integrator |
| 61 |
< |
* Template pattern is used in VelocityVerletIntegrator class. |
| 62 |
< |
*/ |
| 63 |
< |
class VelocityVerletIntegrator : public Integrator { |
| 64 |
< |
public: |
| 65 |
< |
virtual ~VelocityVerletIntegrator(); |
| 58 |
> |
/** |
| 59 |
> |
* @class VelocityVerletIntegrator VelocityVerletIntegrator.hpp "integrators/VelocityVerletIntegrator.hpp" |
| 60 |
> |
* @brief Velocity-Verlet Family Integrator |
| 61 |
> |
* Template pattern is used in VelocityVerletIntegrator class. |
| 62 |
> |
*/ |
| 63 |
> |
class VelocityVerletIntegrator : public Integrator { |
| 64 |
> |
public: |
| 65 |
> |
virtual ~VelocityVerletIntegrator(); |
| 66 |
|
|
| 67 |
< |
void setRotationAlgorithm(RotationAlgorithm* algo) { |
| 68 |
< |
if (algo != rotAlgo && rotAlgo != NULL){ |
| 69 |
< |
delete rotAlgo; |
| 70 |
< |
} |
| 67 |
> |
void setRotationAlgorithm(RotationAlgorithm* algo) { |
| 68 |
> |
if (algo != rotAlgo && rotAlgo != NULL){ |
| 69 |
> |
delete rotAlgo; |
| 70 |
> |
} |
| 71 |
|
|
| 72 |
< |
rotAlgo = algo; |
| 73 |
< |
} |
| 72 |
> |
rotAlgo = algo; |
| 73 |
> |
} |
| 74 |
|
|
| 75 |
< |
protected: |
| 75 |
> |
protected: |
| 76 |
|
|
| 77 |
< |
VelocityVerletIntegrator(SimInfo* info); |
| 77 |
> |
VelocityVerletIntegrator(SimInfo* info); |
| 78 |
|
|
| 79 |
< |
virtual void doIntegrate(); |
| 79 |
> |
virtual void doIntegrate(); |
| 80 |
|
|
| 81 |
< |
virtual void initialize(); |
| 81 |
> |
virtual void initialize(); |
| 82 |
|
|
| 83 |
< |
virtual void preStep(); |
| 83 |
> |
virtual void preStep(); |
| 84 |
|
|
| 85 |
< |
virtual void integrateStep(); |
| 85 |
> |
virtual void integrateStep(); |
| 86 |
|
|
| 87 |
< |
virtual void postStep(); |
| 87 |
> |
virtual void postStep(); |
| 88 |
|
|
| 89 |
< |
virtual void finalize(); |
| 89 |
> |
virtual void finalize(); |
| 90 |
|
|
| 91 |
< |
RotationAlgorithm* rotAlgo; |
| 92 |
< |
Rattle* rattle; |
| 93 |
< |
double dt2; |
| 91 |
> |
virtual void resetIntegrator() {} |
| 92 |
> |
|
| 93 |
> |
RotationAlgorithm* rotAlgo; |
| 94 |
> |
Rattle* rattle; |
| 95 |
> |
RealType dt2; |
| 96 |
|
|
| 97 |
< |
double currSample; |
| 98 |
< |
double currStatus; |
| 99 |
< |
double currThermal; |
| 97 |
> |
RealType currSample; |
| 98 |
> |
RealType currStatus; |
| 99 |
> |
RealType currThermal; |
| 100 |
> |
RealType currReset; |
| 101 |
|
|
| 102 |
< |
private: |
| 102 |
> |
private: |
| 103 |
|
|
| 104 |
< |
virtual void calcForce(bool needPotential, bool needStress); |
| 104 |
> |
virtual void calcForce(bool needPotential, bool needStress); |
| 105 |
|
|
| 106 |
< |
virtual void moveA() = 0; |
| 106 |
> |
virtual void moveA() = 0; |
| 107 |
|
|
| 108 |
< |
virtual void moveB() = 0; |
| 108 |
> |
virtual void moveB() = 0; |
| 109 |
|
|
| 110 |
< |
virtual double calcConservedQuantity() = 0; |
| 110 |
> |
virtual RealType calcConservedQuantity() = 0; |
| 111 |
|
|
| 112 |
< |
virtual DumpWriter* createDumpWriter(); |
| 110 |
< |
virtual DumpWriter* createEorWriter(); |
| 111 |
< |
virtual StatWriter* createStatWriter(); |
| 112 |
> |
virtual DumpWriter* createDumpWriter(); |
| 113 |
|
|
| 114 |
< |
}; |
| 114 |
> |
virtual StatWriter* createStatWriter(); |
| 115 |
> |
|
| 116 |
> |
virtual RestWriter* createRestWriter(); |
| 117 |
|
|
| 118 |
+ |
}; |
| 119 |
+ |
|
| 120 |
|
} //end namespace oopse |
| 121 |
|
#endif //INTEGRATORS_VELOCITYVERLETINTEGRATOR_HPP |