NAMD
Protected Member Functions | Protected Attributes | List of all members
GlobalMasterEasy Class Reference

#include <GlobalMasterEasy.h>

Inheritance diagram for GlobalMasterEasy:
GlobalMaster GlobalMasterMisc

Protected Member Functions

 GlobalMasterEasy (const char *the_config_name)
 
virtual ~GlobalMasterEasy ()
 
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)
 
void addEnergy (BigReal)
 
virtual void easy_init (const char *)
 
virtual void easy_calc (void)
 
- Protected Member Functions inherited from GlobalMaster
 GlobalMaster ()
 
AtomIDListmodifyRequestedAtoms ()
 
AtomIDListmodifyForcedAtoms ()
 
ForceListmodifyAppliedForces ()
 
ResizeArray< AtomIDList > & modifyRequestedGroups ()
 
ForceListmodifyGroupForces ()
 
IntListmodifyRequestedGridObjects ()
 
BigRealListmodifyGridObjForces ()
 
AtomIDList::const_iterator getAtomIdBegin ()
 
AtomIDList::const_iterator getAtomIdEnd ()
 
PositionList::const_iterator getAtomPositionBegin ()
 
PositionList::const_iterator getGroupPositionBegin ()
 
PositionList::const_iterator getGroupPositionEnd ()
 
ForceList::const_iterator getGroupTotalForceBegin ()
 
ForceList::const_iterator getGroupTotalForceEnd ()
 
IntList::const_iterator getGridObjIndexBegin ()
 
IntList::const_iterator getGridObjIndexEnd ()
 
BigRealList::const_iterator getGridObjValueBegin ()
 
BigRealList::const_iterator getGridObjValueEnd ()
 
AtomIDList::const_iterator getLastAtomsForcedBegin ()
 
AtomIDList::const_iterator getLastAtomsForcedEnd ()
 
ForceList::const_iterator getLastForcesBegin ()
 
AtomIDList::const_iterator getForceIdBegin ()
 
AtomIDList::const_iterator getForceIdEnd ()
 
ForceList::const_iterator getTotalForce ()
 
void requestTotalForce (bool yesno=true)
 
BigRealList::const_iterator getGroupMassBegin ()
 
BigRealList::const_iterator getGroupMassEnd ()
 

Protected Attributes

char * config
 
- Protected Attributes inherited from GlobalMaster
bool totalForceRequested
 
const Latticelattice
 
AtomIDList::iterator atomIdBegin
 
AtomIDList::iterator atomIdEnd
 
PositionList::iterator atomPositionBegin
 
PositionList::iterator groupPositionBegin
 
PositionList::iterator groupPositionEnd
 
BigRealList::iterator groupMassBegin
 
BigRealList::iterator groupMassEnd
 
ForceList::iterator groupTotalForceBegin
 
ForceList::iterator groupTotalForceEnd
 
IntList::iterator gridObjIndexBegin
 
IntList::iterator gridObjIndexEnd
 
BigRealList::iterator gridObjValueBegin
 
BigRealList::iterator gridObjValueEnd
 
AtomIDList::iterator lastAtomsForcedBegin
 
ForceList::iterator lastForcesBegin
 
AtomIDList::iterator lastAtomsForcedEnd
 
AtomIDList::iterator forceIdBegin
 
AtomIDList::iterator forceIdEnd
 
ForceList::iterator totalForceBegin
 
bool reqAtomsChanged
 
AtomIDList reqAtoms
 
bool appForcesChanged
 
AtomIDList fAtoms
 
ForceList appForces
 
bool reqGroupsChanged
 
ResizeArray< AtomIDListreqGroups
 
ForceList grpForces
 
bool reqGridObjsChanged
 
IntList reqGridObjs
 
BigRealList gridobjForces
 

Additional Inherited Members

- Public Member Functions inherited from GlobalMaster
void processData (AtomIDList::iterator a_i, AtomIDList::iterator a_e, PositionList::iterator p_i, PositionList::iterator g_i, PositionList::iterator g_e, BigRealList::iterator gm_i, BigRealList::iterator gm_e, ForceList::iterator gtf_i, ForceList::iterator gtf_e, IntList::iterator goi_i, IntList::iterator goi_e, BigRealList::iterator gov_i, BigRealList::iterator gov_e, AtomIDList::iterator last_atoms_forced_i, AtomIDList::iterator last_atoms_forced_e, ForceList::iterator last_forces_i, AtomIDList::iterator, AtomIDList::iterator, ForceList::iterator)
 
bool changedAtoms ()
 
const AtomIDListrequestedAtoms ()
 
bool changedForces ()
 
const AtomIDListforcedAtoms ()
 
const ForceListappliedForces ()
 
bool changedGroups ()
 
const ResizeArray< AtomIDList > & requestedGroups ()
 
const ForceListgroupForces ()
 
bool changedGridObjs ()
 
const IntListrequestedGridObjs ()
 
const BigRealListgridObjForces ()
 
bool requestedTotalForces ()
 
void clearChanged ()
 
virtual ~GlobalMaster ()
 
void check () const
 
void setLattice (const Lattice *lat)
 
- Public Attributes inherited from GlobalMaster
int step
 
int old_num_groups_requested
 

Detailed Description

Definition at line 19 of file GlobalMasterEasy.h.

Constructor & Destructor Documentation

GlobalMasterEasy::GlobalMasterEasy ( const char *  the_config_name)
protected

Definition at line 32 of file GlobalMasterEasy.C.

References DebugM, Node::molecule, Node::Object(), ReductionMgr::Object(), REDUCTIONS_BASIC, and ReductionMgr::willSubmit().

32  {
33  DebugM(1,"Here\n");
34 
35  molecule = Node::Object()->molecule;
36  int len = strlen(the_config_name);
37  configName = new char[len+1];
38  strcpy(configName,the_config_name);
39 
41 
42  initialize();
43 }
static Node * Object()
Definition: Node.h:86
#define DebugM(x, y)
Definition: Debug.h:59
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:365
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:278
Molecule * molecule
Definition: Node.h:176
GlobalMasterEasy::~GlobalMasterEasy ( )
protectedvirtual

Definition at line 45 of file GlobalMasterEasy.C.

45  {
46  delete [] configName;
47  delete reduction;
48 }

Member Function Documentation

void GlobalMasterEasy::addEnergy ( BigReal  e)
protected

Definition at line 104 of file GlobalMasterEasy.C.

Referenced by GlobalMasterMisc::easy_calc().

104  {
105  energy += e;
106 }
int GlobalMasterEasy::addForce ( int  atomid,
Force  force 
)
protected

Definition at line 96 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_calc().

97 {
98  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1; // failure
99  modifyForcedAtoms().add(atomid);
100  modifyAppliedForces().add(force);
101  return 0; // success
102 }
ForceList & modifyAppliedForces()
Definition: GlobalMaster.C:162
AtomIDList & modifyForcedAtoms()
Definition: GlobalMaster.C:157
int numAtoms
Definition: Molecule.h:557
int add(const Elem &elem)
Definition: ResizeArray.h:97
void GlobalMasterEasy::easy_calc ( void  )
protectedvirtual

Reimplemented in GlobalMasterMisc.

Definition at line 179 of file GlobalMasterEasy.C.

179  {
180  CkPrintf("Default GlobalMasterEasy::easy_calc() called.\n");
181 }
void GlobalMasterEasy::easy_init ( const char *  )
protectedvirtual

Reimplemented in GlobalMasterMisc.

Definition at line 175 of file GlobalMasterEasy.C.

175  {
176  CkPrintf("Default GlobalMasterEasy::easy_init() called.\n");
177 }
int GlobalMasterEasy::getAtomID ( const char *  segid,
int  resid,
const char *  aname 
)
protected

Definition at line 51 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_name().

52 {
53  return molecule->get_atom_from_name(segid,resid,aname);
54 }
int get_atom_from_name(const char *segid, int resid, const char *aname) const
Definition: Molecule.C:121
int GlobalMasterEasy::getAtomID ( const char *  segid,
int  resid,
int  index 
)
protected

Definition at line 63 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_index_in_residue().

64 {
65  return molecule->get_atom_from_index_in_residue(segid,resid,index);
66 }
int get_atom_from_index_in_residue(const char *segid, int resid, int index) const
Definition: Molecule.C:158
double GlobalMasterEasy::getMass ( int  atomid)
protected

Definition at line 68 of file GlobalMasterEasy.C.

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

69 {
70  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1.; // failure
71  return molecule->atommass(atomid);
72 }
int numAtoms
Definition: Molecule.h:557
Real atommass(int anum) const
Definition: Molecule.h:1042
int GlobalMasterEasy::getNumAtoms ( const char *  segid,
int  resid 
)
protected

Definition at line 57 of file GlobalMasterEasy.C.

References Molecule::get_residue_size().

58 {
59  return molecule->get_residue_size(segid,resid);
60 }
int get_residue_size(const char *segid, int resid) const
Definition: Molecule.C:144
int GlobalMasterEasy::getPosition ( int  atomid,
Position position 
)
protected

Definition at line 82 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_calc().

83 {
87  for ( ; a_i != a_e; ++a_i, ++p_i ) {
88  if ( *a_i == atomid ) {
89  position = *p_i;
90  return 0; // success
91  }
92  }
93  return -1; // failure
94 }
const Elem * const_iterator
Definition: ResizeArray.h:38
AtomIDList::const_iterator getAtomIdBegin()
Definition: GlobalMaster.C:190
PositionList::const_iterator getAtomPositionBegin()
Definition: GlobalMaster.C:198
AtomIDList::const_iterator getAtomIdEnd()
Definition: GlobalMaster.C:194
int GlobalMasterEasy::requestAtom ( int  atomid)
protected

Definition at line 75 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_init().

76 {
77  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1; // failure
78  modifyRequestedAtoms().add(atomid);
79  return 0; // success
80 }
AtomIDList & modifyRequestedAtoms()
Definition: GlobalMaster.C:127
int numAtoms
Definition: Molecule.h:557
int add(const Elem &elem)
Definition: ResizeArray.h:97

Member Data Documentation

char* GlobalMasterEasy::config
protected

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