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

#include <FreeEnergyRestrain.h>

Inheritance diagram for AForcingPosRestraint:
APosRestraint ARestraint

Public Member Functions

void SetStartPos (AVector Pos)
 
void SetStopPos (AVector Pos)
 
AVector GetStartPos ()
 
AVector GetStopPos ()
 
double GetEnergy ()
 
AVector GetGradient (int WhichGroup)
 
double Get_dU_dLambda ()
 
Bool_t IsForcing ()
 
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 void SetRefPos (AVector)
 
virtual void SetRefDist (double)
 
virtual void SetRefAngle (double)
 
virtual void SetBound (Bound_t)
 
virtual void SetLowerAngle (double)
 
virtual void SetUpperAngle (double)
 
virtual void SetIntervalAngle (double)
 
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 211 of file FreeEnergyRestrain.h.

Member Function Documentation

double AForcingPosRestraint::Get_dU_dLambda ( )
virtual

Reimplemented from ARestraint.

Definition at line 818 of file FreeEnergyRestrain.C.

References ARestraint::m_Kf, ARestraint::m_LambdaKf, ARestraint::m_LambdaRef, and ARestraint::m_pCOMs.

818  {
819 //---------------------------------------------------------------------------
820 // return dU/dLambda for this forcing position restraint
821 //---------------------------------------------------------------------------
822  AVector RefPos;
823  double T1, T2, T3;
824 
825  RefPos = m_StopPos*m_LambdaRef + m_StartPos*(1.0-m_LambdaRef);
826  T1 = (m_pCOMs[0][0] - RefPos[0]) * (m_StartPos[0] - m_StopPos[0]);
827  T2 = (m_pCOMs[0][1] - RefPos[1]) * (m_StartPos[1] - m_StopPos[1]);
828  T3 = (m_pCOMs[0][2] - RefPos[2]) * (m_StartPos[2] - m_StopPos[2]);
829  return( m_Kf * m_LambdaKf * (T1+T2+T3) );
830 }
static double m_LambdaRef
static double m_LambdaKf
AVector * m_pCOMs
double AForcingPosRestraint::GetDistance ( )
inlinevirtual

Implements APosRestraint.

Definition at line 233 of file FreeEnergyRestrain.h.

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

233  {
234  AVector RefPos = m_StopPos*m_LambdaRef + m_StartPos*(1.0-m_LambdaRef);
235  return(RefPos.Dist(m_pCOMs[0]));
236  }
static double m_LambdaRef
double Dist()
AVector * m_pCOMs
double AForcingPosRestraint::GetEnergy ( )
virtual

Implements ARestraint.

Definition at line 790 of file FreeEnergyRestrain.C.

References APosRestraint::GetE(), ARestraint::m_LambdaKf, and ARestraint::m_LambdaRef.

790  {
791 //--------------------------------------------------------------------
792 // return the Energy for this forcing position restraint.
793 //
794 // rref = lambda*r1 + (1-lambda)*r0.
795 // where r0 is the starting position and r1 is the final position
796 //--------------------------------------------------------------------
797  AVector RefPos;
798 
799  RefPos = m_StopPos*m_LambdaRef + m_StartPos*(1.0-m_LambdaRef);
800  return(GetE(RefPos, m_LambdaKf));
801 }
double GetE(AVector RefPos, double LambdaKf=1.0)
static double m_LambdaRef
static double m_LambdaKf
AVector AForcingPosRestraint::GetGradient ( int  WhichGroup)
virtual

Implements ARestraint.

Definition at line 804 of file FreeEnergyRestrain.C.

References APosRestraint::GetGrad(), ARestraint::m_LambdaKf, and ARestraint::m_LambdaRef.

804  {
805 //---------------------------------------------------------------------------
806 // return the gradient for this forcing position restraint.
807 //
808 // rref = lambda*r1 + (1-lambda)*r0.
809 // where r0 is the starting position and r1 is the final position
810 //---------------------------------------------------------------------------
811  AVector RefPos;
812 
813  RefPos = m_StopPos*m_LambdaRef + m_StartPos*(1.0-m_LambdaRef);
814  return(GetGrad(WhichGroup, RefPos, m_LambdaKf));
815 }
static double m_LambdaRef
AVector GetGrad(int WhichGroup, AVector RefPos, double LambdaKf=1.0)
static double m_LambdaKf
AVector AForcingPosRestraint::GetPosTarget ( )
inlinevirtual

Implements APosRestraint.

Definition at line 230 of file FreeEnergyRestrain.h.

References ARestraint::m_LambdaRef.

230  {
231  return(m_StopPos*m_LambdaRef + m_StartPos*(1.0-m_LambdaRef));
232  }
static double m_LambdaRef
AVector AForcingPosRestraint::GetStartPos ( )
inline

Definition at line 221 of file FreeEnergyRestrain.h.

221 {return(m_StartPos);}
AVector AForcingPosRestraint::GetStopPos ( )
inline

Definition at line 222 of file FreeEnergyRestrain.h.

222 {return(m_StopPos);}
void AForcingPosRestraint::GetStr ( char *  Str)
inlinevirtual

Implements ARestraint.

Definition at line 227 of file FreeEnergyRestrain.h.

227  {
228  strcpy(Str, "Forcing Position Restraint");
229  }
Bool_t AForcingPosRestraint::IsForcing ( )
inlinevirtual

Reimplemented from ARestraint.

Definition at line 226 of file FreeEnergyRestrain.h.

References kTrue.

226 {return(kTrue);}
void AForcingPosRestraint::SetStartPos ( AVector  Pos)
inlinevirtual

Reimplemented from ARestraint.

Definition at line 219 of file FreeEnergyRestrain.h.

219 {m_StartPos=Pos;}
void AForcingPosRestraint::SetStopPos ( AVector  Pos)
inlinevirtual

Reimplemented from ARestraint.

Definition at line 220 of file FreeEnergyRestrain.h.

220 {m_StopPos=Pos;}

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