ABoundPosRestraint Class Reference

#include <FreeEnergyRestrain.h>

Inheritance diagram for ABoundPosRestraint:

APosRestraint ARestraint List of all members.

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 ()

Detailed Description

Definition at line 187 of file FreeEnergyRestrain.h.


Member Function Documentation

Bound_t ABoundPosRestraint::GetBound (  )  [inline]

Definition at line 201 of file FreeEnergyRestrain.h.

00201 {return(m_Bound);}

double ABoundPosRestraint::GetDistance (  )  [inline, virtual]

Implements APosRestraint.

Definition at line 208 of file FreeEnergyRestrain.h.

References AVector::Dist(), and ARestraint::m_pCOMs.

00208 {return(m_RefPos.Dist(m_pCOMs[0]));}

double ABoundPosRestraint::GetEnergy (  )  [virtual]

Implements ARestraint.

Definition at line 751 of file FreeEnergyRestrain.C.

References AVector::Dist(), kLower, kUpper, ARestraint::m_Kf, and ARestraint::m_pCOMs.

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 }

AVector ABoundPosRestraint::GetGradient ( int  WhichGroup  )  [virtual]

Implements ARestraint.

Definition at line 771 of file FreeEnergyRestrain.C.

References AVector::Dist(), kLower, kUpper, ARestraint::m_Kf, ARestraint::m_pCOMs, 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 }

AVector ABoundPosRestraint::GetPosTarget (  )  [inline, virtual]

Implements APosRestraint.

Definition at line 207 of file FreeEnergyRestrain.h.

00207 {return(m_RefPos);}

double ABoundPosRestraint::GetRefDist (  )  [inline]

Definition at line 200 of file FreeEnergyRestrain.h.

00200 {return(m_RefDist);}

AVector ABoundPosRestraint::GetRefPos (  )  [inline]

Definition at line 199 of file FreeEnergyRestrain.h.

00199 {return(m_RefPos);}

void ABoundPosRestraint::GetStr ( char *  Str  )  [inline, virtual]

Implements ARestraint.

Definition at line 204 of file FreeEnergyRestrain.h.

00204                             {
00205     strcpy(Str, "Bound   Position Restraint");
00206   }

void ABoundPosRestraint::SetBound ( Bound_t  Bound  )  [inline, virtual]

Reimplemented from ARestraint.

Definition at line 198 of file FreeEnergyRestrain.h.

00198 {m_Bound=Bound;}

void ABoundPosRestraint::SetRefDist ( double  Dist  )  [inline, virtual]

Reimplemented from ARestraint.

Definition at line 197 of file FreeEnergyRestrain.h.

00197 {m_RefDist=Dist;}

void ABoundPosRestraint::SetRefPos ( AVector  Pos  )  [inline, virtual]

Reimplemented from ARestraint.

Definition at line 196 of file FreeEnergyRestrain.h.

00196 {m_RefPos=Pos;}


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 01:17:17 2017 for NAMD by  doxygen 1.4.7