#include <FreeEnergyRestrain.h>
Inheritance diagram for ABoundPosRestraint:

Public Member Functions | |
| void | SetRefPos (AVector Pos) |
| void | SetRefDist (double Dist) |
| void | SetBound (Bound_t Bound) |
| AVector | GetRefPos () |
| double | GetRefDist () |
| Bound_t | GetBound () |
| double | GetEnergy () |
| AVector | GetGradient (int WhichGroup) |
| void | GetStr (char *Str) |
| AVector | GetPosTarget () |
| double | GetDistance () |
|
|
Definition at line 201 of file FreeEnergyRestrain.h. References Bound_t. 00201 {return(m_Bound);}
|
|
|
Implements APosRestraint. Definition at line 208 of file FreeEnergyRestrain.h. References AVector::Dist(). 00208 {return(m_RefPos.Dist(m_pCOMs[0]));}
|
|
|
Implements ARestraint. Definition at line 751 of file FreeEnergyRestrain.C. References AVector::Dist(). 00751 {
00752 //--------------------------------------------------------------------
00753 // calculate and return the Energy for this bound position restraint.
00754 //
00755 // Note: This is an exception because the form for the E term is
00756 // different from the other postion restraints.
00757 //--------------------------------------------------------------------
00758 double E, Dist, Diff;
00759
00760 E = 0.0;
00761 Dist = m_pCOMs[0].Dist(m_RefPos);
00762 if (((m_Bound==kUpper) && (Dist>m_RefDist)) ||
00763 ((m_Bound==kLower) && (Dist<m_RefDist))) {
00764 Diff = Dist - m_RefDist;
00765 E = (m_Kf/2.0) * (Diff*Diff);
00766 }
00767 return(E);
00768 }
|
|
|
Implements ARestraint. Definition at line 771 of file FreeEnergyRestrain.C. References AVector::Dist(), and AVector::Set(). 00771 {
00772 //---------------------------------------------------------------------------
00773 // calculate and return the gradient for this bound position restraint.
00774 //
00775 // Note: This is an exception because the form for the E term is
00776 // different from the other postion restraints.
00777 //---------------------------------------------------------------------------
00778 double Dist;
00779 AVector Vec; // Vec is initialized to (0,0,0)
00780
00781 // WhichGroup = 0; // don't care -- there's only 1 atom restrained
00782 Dist = m_pCOMs[0].Dist(m_RefPos);
00783 if (((m_Bound==kUpper) && (Dist>m_RefDist)) ||
00784 ((m_Bound==kLower) && (Dist<m_RefDist))) {
00785 Vec.Set(m_pCOMs[0][0] - m_RefPos[0],
00786 m_pCOMs[0][1] - m_RefPos[1],
00787 m_pCOMs[0][2] - m_RefPos[2]);
00788 Vec *= m_Kf * (Dist - m_RefDist) / Dist;
00789 }
00790 return(Vec);
00791 }
|
|
|
Implements APosRestraint. Definition at line 207 of file FreeEnergyRestrain.h. 00207 {return(m_RefPos);}
|
|
|
Definition at line 200 of file FreeEnergyRestrain.h. 00200 {return(m_RefDist);}
|
|
|
Definition at line 199 of file FreeEnergyRestrain.h. 00199 {return(m_RefPos);}
|
|
|
Implements ARestraint. Definition at line 204 of file FreeEnergyRestrain.h. 00204 {
00205 strcpy(Str, "Bound Position Restraint");
00206 }
|
|
|
Reimplemented from ARestraint. Definition at line 198 of file FreeEnergyRestrain.h. 00198 {m_Bound=Bound;}
|
|
|
Reimplemented from ARestraint. Definition at line 197 of file FreeEnergyRestrain.h. 00197 {m_RefDist=Dist;}
|
|
|
Reimplemented from ARestraint. Definition at line 196 of file FreeEnergyRestrain.h. 00196 {m_RefPos=Pos;}
|
1.3.9.1