NAMD
Public Member Functions | List of all members
ABoundPosRestraint Class Reference

#include <FreeEnergyRestrain.h>

Inheritance diagram for ABoundPosRestraint:
APosRestraint ARestraint

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 ()
 
- Public Member Functions inherited from APosRestraint
 APosRestraint ()
 
void PrintInfo ()
 
- Public Member Functions inherited from ARestraint
 ARestraint ()
 
virtual ~ARestraint ()
 
int GetNumGroups ()
 
void SetKf (double Kf)
 
double GetKf ()
 
void SetLambdaKf (double LambdaKf)
 
void SetLambdaRef (double LambdaRef)
 
double GetLambdaKf ()
 
double GetLambdaRef ()
 
void SetGroup (AGroup &Group, int GroupIndex)
 
void SetGroups (AGroup &Group1)
 
void SetGroups (AGroup &Group1, AGroup &Group2)
 
void SetGroups (AGroup &Group1, AGroup &Group2, AGroup &Group3)
 
void SetGroups (AGroup &Group1, AGroup &Group2, AGroup &Group3, AGroup &Group4)
 
void UpdateCOMs (GlobalMasterFreeEnergy &CFE)
 
void DistributeForce (int WhichGroup, AVector Force, GlobalMasterFreeEnergy &CFE)
 
virtual Bool_t IsForcing ()
 
virtual double Get_dU_dLambda ()
 
virtual void SetRefAngle (double)
 
virtual void SetLowerAngle (double)
 
virtual void SetUpperAngle (double)
 
virtual void SetIntervalAngle (double)
 
virtual void SetStartPos (AVector)
 
virtual void SetStopPos (AVector)
 
virtual void SetStartDist (double)
 
virtual void SetStopDist (double)
 
virtual void SetStartAngle (double)
 
virtual void SetStopAngle (double)
 

Additional Inherited Members

- Protected Member Functions inherited from APosRestraint
double GetE (AVector RefPos, double LambdaKf=1.0)
 
AVector GetGrad (int WhichGroup, AVector RefPos, double LambdaKf=1.0)
 
- Protected Member Functions inherited from ARestraint
double GetAngle (AVector &A, AVector &B, AVector &C)
 
double GetDihe (AVector &A, AVector &B, AVector &C, AVector &D)
 
void EarlyExit (const char *Str, int AtomID)
 
- Protected Attributes inherited from ARestraint
double m_Kf
 
int m_NumGroups
 
AGroupm_pGroups
 
AVectorm_pCOMs
 
- Static Protected Attributes inherited from ARestraint
static double m_LambdaKf = 1.0
 
static double m_LambdaRef = 0.0
 

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.

201 {return(m_Bound);}
double ABoundPosRestraint::GetDistance ( )
inlinevirtual

Implements APosRestraint.

Definition at line 208 of file FreeEnergyRestrain.h.

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

208 {return(m_RefPos.Dist(m_pCOMs[0]));}
double Dist()
AVector * m_pCOMs
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.

747  {
748 //--------------------------------------------------------------------
749 // calculate and return the Energy for this bound position restraint.
750 //
751 // Note: This is an exception because the form for the E term is
752 // different from the other postion restraints.
753 //--------------------------------------------------------------------
754  double E, Dist, Diff;
755 
756  E = 0.0;
757  Dist = m_pCOMs[0].Dist(m_RefPos);
758  if (((m_Bound==kUpper) && (Dist>m_RefDist)) ||
759  ((m_Bound==kLower) && (Dist<m_RefDist))) {
760  Diff = Dist - m_RefDist;
761  E = (m_Kf/2.0) * (Diff*Diff);
762  }
763  return(E);
764 }
double Dist()
AVector * m_pCOMs
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().

767  {
768 //---------------------------------------------------------------------------
769 // calculate and return the gradient for this bound position restraint.
770 //
771 // Note: This is an exception because the form for the E term is
772 // different from the other postion restraints.
773 //---------------------------------------------------------------------------
774  double Dist;
775  AVector Vec; // Vec is initialized to (0,0,0)
776 
777  // WhichGroup = 0; // don't care -- there's only 1 atom restrained
778  Dist = m_pCOMs[0].Dist(m_RefPos);
779  if (((m_Bound==kUpper) && (Dist>m_RefDist)) ||
780  ((m_Bound==kLower) && (Dist<m_RefDist))) {
781  Vec.Set(m_pCOMs[0][0] - m_RefPos[0],
782  m_pCOMs[0][1] - m_RefPos[1],
783  m_pCOMs[0][2] - m_RefPos[2]);
784  Vec *= m_Kf * (Dist - m_RefDist) / Dist;
785  }
786  return(Vec);
787 }
Bool_t Set(double x, double y, double z)
double Dist()
AVector * m_pCOMs
AVector ABoundPosRestraint::GetPosTarget ( )
inlinevirtual

Implements APosRestraint.

Definition at line 207 of file FreeEnergyRestrain.h.

207 {return(m_RefPos);}
double ABoundPosRestraint::GetRefDist ( )
inline

Definition at line 200 of file FreeEnergyRestrain.h.

200 {return(m_RefDist);}
AVector ABoundPosRestraint::GetRefPos ( )
inline

Definition at line 199 of file FreeEnergyRestrain.h.

199 {return(m_RefPos);}
void ABoundPosRestraint::GetStr ( char *  Str)
inlinevirtual

Implements ARestraint.

Definition at line 204 of file FreeEnergyRestrain.h.

204  {
205  strcpy(Str, "Bound Position Restraint");
206  }
void ABoundPosRestraint::SetBound ( Bound_t  Bound)
inlinevirtual

Reimplemented from ARestraint.

Definition at line 198 of file FreeEnergyRestrain.h.

198 {m_Bound=Bound;}
void ABoundPosRestraint::SetRefDist ( double  Dist)
inlinevirtual

Reimplemented from ARestraint.

Definition at line 197 of file FreeEnergyRestrain.h.

197 {m_RefDist=Dist;}
void ABoundPosRestraint::SetRefPos ( AVector  Pos)
inlinevirtual

Reimplemented from ARestraint.

Definition at line 196 of file FreeEnergyRestrain.h.

196 {m_RefPos=Pos;}

The documentation for this class was generated from the following files: