| 15 |
|
class SimInfo; |
| 16 |
|
|
| 17 |
|
enum ConsAlgoStatus{ |
| 18 |
< |
consPairHandlerFail = -3, |
| 19 |
< |
consElemHandlerFail = -2, |
| 20 |
< |
consFail = -1, |
| 21 |
< |
consSuccess = 0, |
| 22 |
< |
consAlready = 1}; |
| 18 |
> |
consExceedMaxIter = -4, //can not constrain the bond within maximum iteration |
| 19 |
> |
consPairHandlerFail = -3, //can not found call back functor for constraint pair |
| 20 |
> |
consElemHandlerFail = -2, //can not found callback functor for constraint element |
| 21 |
> |
consFail = -1, //Constraint Fail |
| 22 |
> |
consSuccess = 0, //constrain the pair by moving two elements |
| 23 |
> |
consAlready = 1}; //current pair is already constrained, do not need to move the elements |
| 24 |
|
|
| 25 |
|
//////////////////////////////////////////////////////////////////////////////// |
| 26 |
|
//Declaration of ConstraintAlgorithm |
| 32 |
|
class ConstraintAlgorithm{ |
| 33 |
|
|
| 34 |
|
public: |
| 35 |
< |
~ConstraintAlgorithm(); |
| 36 |
< |
virtual void doConstrain(); |
| 35 |
> |
virtual ~ConstraintAlgorithm(); |
| 36 |
> |
virtual void doConstrain(); |
| 37 |
|
|
| 38 |
|
//using RTTI (Run Time Type Information) to dispatch |
| 39 |
|
int doConstrainPair(ConstraintPair* consPair); |
| 69 |
|
|
| 70 |
|
}; |
| 71 |
|
|
| 72 |
+ |
//Velocity Verlet constraint algorithm frame work |
| 73 |
+ |
class VelVerletConsFramework : public ConsAlgoFramework{ |
| 74 |
+ |
public: |
| 75 |
+ |
virtual int doConstrainA() = 0; |
| 76 |
+ |
virtual int doConstrainB() = 0; |
| 77 |
+ |
protected: |
| 78 |
+ |
VelVerletConsFramework(SimInfo* rhs) : ConsAlgoFramework(rhs){} |
| 79 |
+ |
}; |
| 80 |
+ |
|
| 81 |
|
#endif //endif _CONSTRAINTALGORITHM_H_ |