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 747 of file FreeEnergyRestrain.C.

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

00747                                      {
00748 //--------------------------------------------------------------------
00749 // calculate and return the Energy for this bound position restraint.
00750 //
00751 // Note:  This is an exception because the form for the E term is
00752 //        different from the other postion restraints.
00753 //--------------------------------------------------------------------
00754   double  E, Dist, Diff;
00755 
00756   E = 0.0;
00757   Dist = m_pCOMs[0].Dist(m_RefPos);
00758   if (((m_Bound==kUpper) && (Dist>m_RefDist)) ||
00759       ((m_Bound==kLower) && (Dist<m_RefDist))) {
00760     Diff = Dist - m_RefDist;
00761     E = (m_Kf/2.0) * (Diff*Diff);
00762   }
00763   return(E);
00764 }

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

Implements ARestraint.

Definition at line 767 of file FreeEnergyRestrain.C.

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

00767                                                             {
00768 //---------------------------------------------------------------------------
00769 // calculate and return the gradient for this bound position restraint.
00770 //
00771 // Note:  This is an exception because the form for the E term is
00772 //        different from the other postion restraints.
00773 //---------------------------------------------------------------------------
00774   double  Dist;
00775   AVector Vec;   // Vec is initialized to (0,0,0)
00776 
00777   // WhichGroup = 0;  // don't care -- there's only 1 atom restrained
00778   Dist = m_pCOMs[0].Dist(m_RefPos);
00779   if (((m_Bound==kUpper) && (Dist>m_RefDist)) ||
00780       ((m_Bound==kLower) && (Dist<m_RefDist))) {
00781     Vec.Set(m_pCOMs[0][0] - m_RefPos[0],
00782             m_pCOMs[0][1] - m_RefPos[1],
00783             m_pCOMs[0][2] - m_RefPos[2]);
00784     Vec *= m_Kf * (Dist - m_RefDist) / Dist;
00785   }
00786   return(Vec);
00787 }

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 Wed Jun 20 01:17:17 2018 for NAMD by  doxygen 1.4.7