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 globalMasterStep
 
int old_num_groups_requested
 

Detailed Description

Definition at line 19 of file GlobalMasterEasy.h.

Constructor & Destructor Documentation

◆ GlobalMasterEasy()

GlobalMasterEasy::GlobalMasterEasy ( const char *  the_config_name)
protected

Definition at line 33 of file GlobalMasterEasy.C.

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

33  {
34  DebugM(1,"Here\n");
35 
36  molecule = Node::Object()->molecule;
37  int len = strlen(the_config_name);
38  configName = new char[len+1];
39  strcpy(configName,the_config_name);
40 
42 
43  initialize();
44 }
static Node * Object()
Definition: Node.h:86
#define DebugM(x, y)
Definition: Debug.h:75
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:366
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:279
Molecule * molecule
Definition: Node.h:179

◆ ~GlobalMasterEasy()

GlobalMasterEasy::~GlobalMasterEasy ( )
protectedvirtual

Definition at line 46 of file GlobalMasterEasy.C.

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

Member Function Documentation

◆ addEnergy()

void GlobalMasterEasy::addEnergy ( BigReal  e)
protected

Definition at line 105 of file GlobalMasterEasy.C.

Referenced by GlobalMasterMisc::easy_calc().

105  {
106  energy += e;
107 }

◆ addForce()

int GlobalMasterEasy::addForce ( int  atomid,
Force  force 
)
protected

Definition at line 97 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_calc().

98 {
99  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1; // failure
100  modifyForcedAtoms().add(atomid);
101  modifyAppliedForces().add(force);
102  return 0; // success
103 }
ForceList & modifyAppliedForces()
Definition: GlobalMaster.C:163
int add(const Elem &elem)
Definition: ResizeArray.h:101
AtomIDList & modifyForcedAtoms()
Definition: GlobalMaster.C:158
int numAtoms
Definition: Molecule.h:585

◆ easy_calc()

void GlobalMasterEasy::easy_calc ( void  )
protectedvirtual

Reimplemented in GlobalMasterMisc.

Definition at line 180 of file GlobalMasterEasy.C.

180  {
181  CkPrintf("Default GlobalMasterEasy::easy_calc() called.\n");
182 }

◆ easy_init()

void GlobalMasterEasy::easy_init ( const char *  )
protectedvirtual

Reimplemented in GlobalMasterMisc.

Definition at line 176 of file GlobalMasterEasy.C.

176  {
177  CkPrintf("Default GlobalMasterEasy::easy_init() called.\n");
178 }

◆ getAtomID() [1/2]

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

Definition at line 52 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_name().

53 {
54  return molecule->get_atom_from_name(segid,resid,aname);
55 }
int get_atom_from_name(const char *segid, int resid, const char *aname) const
Definition: Molecule.C:126

◆ getAtomID() [2/2]

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

Definition at line 64 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_index_in_residue().

65 {
66  return molecule->get_atom_from_index_in_residue(segid,resid,index);
67 }
int get_atom_from_index_in_residue(const char *segid, int resid, int index) const
Definition: Molecule.C:163

◆ getMass()

double GlobalMasterEasy::getMass ( int  atomid)
protected

Definition at line 69 of file GlobalMasterEasy.C.

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

70 {
71  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1.; // failure
72  return molecule->atommass(atomid);
73 }
int numAtoms
Definition: Molecule.h:585
Real atommass(int anum) const
Definition: Molecule.h:1107

◆ getNumAtoms()

int GlobalMasterEasy::getNumAtoms ( const char *  segid,
int  resid 
)
protected

Definition at line 58 of file GlobalMasterEasy.C.

References Molecule::get_residue_size().

59 {
60  return molecule->get_residue_size(segid,resid);
61 }
int get_residue_size(const char *segid, int resid) const
Definition: Molecule.C:149

◆ getPosition()

int GlobalMasterEasy::getPosition ( int  atomid,
Position position 
)
protected

Definition at line 83 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_calc().

84 {
88  for ( ; a_i != a_e; ++a_i, ++p_i ) {
89  if ( *a_i == atomid ) {
90  position = *p_i;
91  return 0; // success
92  }
93  }
94  return -1; // failure
95 }
AtomIDList::const_iterator getAtomIdBegin()
Definition: GlobalMaster.C:191
PositionList::const_iterator getAtomPositionBegin()
Definition: GlobalMaster.C:199
const Elem * const_iterator
Definition: ResizeArray.h:38
AtomIDList::const_iterator getAtomIdEnd()
Definition: GlobalMaster.C:195

◆ requestAtom()

int GlobalMasterEasy::requestAtom ( int  atomid)
protected

Definition at line 76 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_init().

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

Member Data Documentation

◆ config

char* GlobalMasterEasy::config
protected

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