DistanceConstraint.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef __RD_DISTANCECONSTRAINT_H__
00007 #define __RD_DISTANCECONSTRAINT_H__
00008 #include <iostream>
00009 #include <ForceField/Contrib.h>
00010
00011 namespace ForceFields {
00012 namespace UFF {
00013
00014
00015 class DistanceConstraintContrib : public ForceFieldContrib {
00016 public:
00017 DistanceConstraintContrib() : d_end1Idx(-1), d_end2Idx(-1) {};
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 DistanceConstraintContrib(ForceField *owner,unsigned int idx1,unsigned int idx2,
00029 double minLen,double maxLen,double forceConst);
00030
00031 ~DistanceConstraintContrib() {
00032
00033 }
00034 double getEnergy(double *pos) const;
00035
00036 void getGrad(double *pos,double *grad) const;
00037 private:
00038 int d_end1Idx,d_end2Idx;
00039 double d_minLen,d_maxLen;
00040 double d_forceConstant;
00041
00042 };
00043 }
00044 }
00045 #endif