GlobalMasterFreeEnergy Class Reference

#include <GlobalMasterFreeEnergy.h>

Inheritance diagram for GlobalMasterFreeEnergy:

GlobalMaster List of all members.

Public Member Functions

 GlobalMasterFreeEnergy ()
 ~GlobalMasterFreeEnergy ()
int getAtomID (const char *segid, int resid, const char *aname)
int getNumAtoms (const char *segid, int resid)
int getAtomID (const char *segid, int resid, int index)
double getMass (int atomid)
int requestAtom (int atomid)
int getPosition (int atomid, Position &position)
int addForce (int atomid, Force force)

Detailed Description

Definition at line 17 of file GlobalMasterFreeEnergy.h.


Constructor & Destructor Documentation

GlobalMasterFreeEnergy::GlobalMasterFreeEnergy (  ) 

Definition at line 188 of file GlobalMasterFreeEnergy.C.

References DebugM, Node::molecule, Node::Object(), and Node::simParameters.

00189 : GlobalMaster() {
00190   DebugM(3,"Constructing GlobalMasterFreeEnergy\n");
00191   molecule = Node::Object()->molecule;
00192   simParams = Node::Object()->simParameters;
00193 
00194   // now set up the free energy stuff
00195   initialize();
00196 }

GlobalMasterFreeEnergy::~GlobalMasterFreeEnergy (  ) 

Definition at line 198 of file GlobalMasterFreeEnergy.C.

References DebugM.

00198                                                 {
00199   DebugM(3,"Destructing GlobalMasterFreeEnergy\n");
00200   delete config;
00201 }


Member Function Documentation

int GlobalMasterFreeEnergy::addForce ( int  atomid,
Force  force 
)

Definition at line 178 of file GlobalMasterFreeEnergy.C.

References ResizeArray< Elem >::add(), DebugM, GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), and Molecule::numAtoms.

Referenced by ARestraint::DistributeForce().

00179 {
00180   DebugM(2,"Forcing "<<atomid<<" with "<<force<<"\n");
00181   if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1;  // failure
00182   modifyForcedAtoms().add(atomid);
00183   modifyAppliedForces().add(force);
00184   return 0;  // success
00185 }

int GlobalMasterFreeEnergy::getAtomID ( const char *  segid,
int  resid,
int  index 
)

Definition at line 145 of file GlobalMasterFreeEnergy.C.

References Molecule::get_atom_from_index_in_residue().

00146 {
00147   return molecule->get_atom_from_index_in_residue(segid,resid,index);
00148 }

int GlobalMasterFreeEnergy::getAtomID ( const char *  segid,
int  resid,
const char *  aname 
)

Definition at line 133 of file GlobalMasterFreeEnergy.C.

References Molecule::get_atom_from_name().

Referenced by AddAtom(), and AddResidues().

00134 {
00135   return molecule->get_atom_from_name(segid,resid,aname);
00136 }

double GlobalMasterFreeEnergy::getMass ( int  atomid  ) 

Definition at line 150 of file GlobalMasterFreeEnergy.C.

References Molecule::atommass(), and Molecule::numAtoms.

Referenced by ARestraint::DistributeForce(), and ARestraint::UpdateCOMs().

00151 {
00152   if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1.;  // failure
00153   return molecule->atommass(atomid);
00154 }

int GlobalMasterFreeEnergy::getNumAtoms ( const char *  segid,
int  resid 
)

Definition at line 139 of file GlobalMasterFreeEnergy.C.

References Molecule::get_residue_size().

Referenced by AddResidues().

00140 {
00141   return molecule->get_residue_size(segid,resid);
00142 }

int GlobalMasterFreeEnergy::getPosition ( int  atomid,
Position position 
)

Definition at line 164 of file GlobalMasterFreeEnergy.C.

References GlobalMaster::getAtomIdBegin(), GlobalMaster::getAtomIdEnd(), and GlobalMaster::getAtomPositionBegin().

Referenced by ARestraint::UpdateCOMs().

00165 {
00166   AtomIDList::const_iterator a_i = getAtomIdBegin();
00167   AtomIDList::const_iterator a_e = getAtomIdEnd();
00168   PositionList::const_iterator p_i = getAtomPositionBegin();
00169   for ( ; a_i != a_e; ++a_i, ++p_i ) {
00170     if ( *a_i == atomid ) {
00171       position = *p_i;
00172       return 0;  // success
00173     }
00174   }
00175   return -1;  // failure
00176 }

int GlobalMasterFreeEnergy::requestAtom ( int  atomid  ) 

Definition at line 157 of file GlobalMasterFreeEnergy.C.

References ResizeArray< Elem >::add(), GlobalMaster::modifyRequestedAtoms(), and Molecule::numAtoms.

Referenced by AddAtom(), and AddResidues().

00158 {
00159   if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1;  // failure
00160   modifyRequestedAtoms().add(atomid);
00161   return 0;  // success
00162 }


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