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 ()
 
void addReductionEnergy (int reductionTag, BigReal energy)
 
SubmitReductiongetCurrentReduction ()
 
void submitReduction ()
 

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, and Node::Object().

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 
41  initialize();
42 }
static Node * Object()
Definition: Node.h:86
#define DebugM(x, y)
Definition: Debug.h:75
Molecule * molecule
Definition: Node.h:179

◆ ~GlobalMasterEasy()

GlobalMasterEasy::~GlobalMasterEasy ( )
protectedvirtual

Definition at line 44 of file GlobalMasterEasy.C.

44  {
45  delete [] configName;
46 }

Member Function Documentation

◆ addEnergy()

void GlobalMasterEasy::addEnergy ( BigReal  e)
protected

Definition at line 102 of file GlobalMasterEasy.C.

Referenced by GlobalMasterMisc::easy_calc().

102  {
103  energy += e;
104 }

◆ addForce()

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

Definition at line 94 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_calc().

95 {
96  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1; // failure
97  modifyForcedAtoms().add(atomid);
98  modifyAppliedForces().add(force);
99  return 0; // success
100 }
ForceList & modifyAppliedForces()
Definition: GlobalMaster.C:202
int add(const Elem &elem)
Definition: ResizeArray.h:101
AtomIDList & modifyForcedAtoms()
Definition: GlobalMaster.C:197
int numAtoms
Definition: Molecule.h:586

◆ easy_calc()

void GlobalMasterEasy::easy_calc ( void  )
protectedvirtual

Reimplemented in GlobalMasterMisc.

Definition at line 176 of file GlobalMasterEasy.C.

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

◆ easy_init()

void GlobalMasterEasy::easy_init ( const char *  )
protectedvirtual

Reimplemented in GlobalMasterMisc.

Definition at line 172 of file GlobalMasterEasy.C.

172  {
173  CkPrintf("Default GlobalMasterEasy::easy_init() called.\n");
174 }

◆ getAtomID() [1/2]

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

Definition at line 49 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_name().

50 {
51  return molecule->get_atom_from_name(segid,resid,aname);
52 }
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 61 of file GlobalMasterEasy.C.

References Molecule::get_atom_from_index_in_residue().

62 {
63  return molecule->get_atom_from_index_in_residue(segid,resid,index);
64 }
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 66 of file GlobalMasterEasy.C.

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

67 {
68  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1.; // failure
69  return molecule->atommass(atomid);
70 }
int numAtoms
Definition: Molecule.h:586
Real atommass(int anum) const
Definition: Molecule.h:1114

◆ getNumAtoms()

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

Definition at line 55 of file GlobalMasterEasy.C.

References Molecule::get_residue_size().

56 {
57  return molecule->get_residue_size(segid,resid);
58 }
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 80 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_calc().

81 {
85  for ( ; a_i != a_e; ++a_i, ++p_i ) {
86  if ( *a_i == atomid ) {
87  position = *p_i;
88  return 0; // success
89  }
90  }
91  return -1; // failure
92 }
AtomIDList::const_iterator getAtomIdBegin()
Definition: GlobalMaster.C:230
PositionList::const_iterator getAtomPositionBegin()
Definition: GlobalMaster.C:238
const Elem * const_iterator
Definition: ResizeArray.h:38
AtomIDList::const_iterator getAtomIdEnd()
Definition: GlobalMaster.C:234

◆ requestAtom()

int GlobalMasterEasy::requestAtom ( int  atomid)
protected

Definition at line 73 of file GlobalMasterEasy.C.

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

Referenced by GlobalMasterMisc::easy_init().

74 {
75  if ( atomid < 0 || atomid >= molecule->numAtoms ) return -1; // failure
76  modifyRequestedAtoms().add(atomid);
77  return 0; // success
78 }
AtomIDList & modifyRequestedAtoms()
Definition: GlobalMaster.C:167
int add(const Elem &elem)
Definition: ResizeArray.h:101
int numAtoms
Definition: Molecule.h:586

Member Data Documentation

◆ config

char* GlobalMasterEasy::config
protected

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