GlobalMaster Class Reference

#include <GlobalMaster.h>

Inheritance diagram for GlobalMaster:
colvarproxy_namd GlobalMasterEasy GlobalMasterFreeEnergy GlobalMasterIMD GlobalMasterSMD GlobalMasterSymmetry GlobalMasterTcl GlobalMasterTest GlobalMasterTMD

List of all members.

Public Member Functions

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, 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 requestedTotalForces ()
void clearChanged ()
virtual ~GlobalMaster ()
void check () const
void setLattice (const Lattice *lat)

Public Attributes

int step
int old_num_groups_requested

Protected Member Functions

 GlobalMaster ()
virtual void calculate ()
AtomIDListmodifyRequestedAtoms ()
AtomIDListmodifyForcedAtoms ()
ForceListmodifyAppliedForces ()
ResizeArray< AtomIDList > & modifyRequestedGroups ()
ForceListmodifyGroupForces ()
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 ()
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

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
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

Detailed Description

Definition at line 30 of file GlobalMaster.h.


Constructor & Destructor Documentation

virtual GlobalMaster::~GlobalMaster (  )  [inline, virtual]

Definition at line 66 of file GlobalMaster.h.

00066 {}; // necessary for abstract classes '-P

GlobalMaster::GlobalMaster (  )  [protected]

Member Function Documentation

const ForceList & GlobalMaster::appliedForces (  ) 

Definition at line 124 of file GlobalMaster.C.

References appForces.

Referenced by GlobalMasterTest::calculate().

00124                                              {
00125   return appForces;
00126 }

void GlobalMaster::calculate (  )  [protected, virtual]

Reimplemented in colvarproxy_namd, GlobalMasterIMD, GlobalMasterTcl, and GlobalMasterTest.

Definition at line 74 of file GlobalMaster.C.

References NAMD_die().

Referenced by processData().

00074                              {
00075   NAMD_die("Internal error: pure virtual function called");
00076 }

bool GlobalMaster::changedAtoms (  ) 

Definition at line 99 of file GlobalMaster.C.

References reqAtomsChanged.

00099                                 {
00100   return reqAtomsChanged;
00101 }

bool GlobalMaster::changedForces (  ) 

Definition at line 103 of file GlobalMaster.C.

References appForcesChanged.

00103                                  {
00104   return appForcesChanged;
00105 }

bool GlobalMaster::changedGroups (  ) 

Definition at line 107 of file GlobalMaster.C.

References reqGroupsChanged.

00107                                  {
00108   return reqGroupsChanged;
00109 }

void GlobalMaster::check (  )  const

Definition at line 60 of file GlobalMaster.C.

References appForces, fAtoms, groupMassBegin, groupMassEnd, grpForces, NAMD_die(), and ResizeArray< Elem >::size().

00060                                {
00061   /* check to make sure the force arrays still match */
00062   if(fAtoms.size() != appForces.size())
00063     NAMD_die("# of atoms forced != # of forces given");
00064   if(grpForces.size() != groupMassEnd - groupMassBegin)
00065     NAMD_die("# of groups forced != # of groups requested");
00066 }

void GlobalMaster::clearChanged (  ) 

Definition at line 68 of file GlobalMaster.C.

References appForcesChanged, reqAtomsChanged, and reqGroupsChanged.

Referenced by GlobalMaster().

00068                                 {
00069   reqAtomsChanged = false;
00070   appForcesChanged = false;
00071   reqGroupsChanged = false;
00072 }

const AtomIDList & GlobalMaster::forcedAtoms (  ) 

Definition at line 120 of file GlobalMaster.C.

References fAtoms.

00120                                             {
00121   return fAtoms;
00122 }

AtomIDList::const_iterator GlobalMaster::getAtomIdBegin (  )  [protected]
AtomIDList::const_iterator GlobalMaster::getAtomIdEnd (  )  [protected]
PositionList::const_iterator GlobalMaster::getAtomPositionBegin (  )  [protected]
AtomIDList::const_iterator GlobalMaster::getForceIdBegin (  )  [protected]

Definition at line 207 of file GlobalMaster.C.

References forceIdBegin.

Referenced by colvarproxy_namd::calculate().

00208 {
00209   return forceIdBegin;
00210 }

AtomIDList::const_iterator GlobalMaster::getForceIdEnd (  )  [protected]

Definition at line 212 of file GlobalMaster.C.

References forceIdEnd.

Referenced by colvarproxy_namd::calculate().

00213 {
00214   return forceIdEnd;
00215 }

BigRealList::const_iterator GlobalMaster::getGroupMassBegin (  )  [protected]

Definition at line 186 of file GlobalMaster.C.

References groupMassBegin.

Referenced by GlobalMasterTcl::calculate().

00187 {
00188   return groupMassBegin;
00189 }

BigRealList::const_iterator GlobalMaster::getGroupMassEnd (  )  [protected]

Definition at line 191 of file GlobalMaster.C.

References groupMassEnd.

Referenced by GlobalMasterTcl::calculate().

00191                                                         {
00192   return groupMassEnd;
00193 }

PositionList::const_iterator GlobalMaster::getGroupPositionBegin (  )  [protected]

Definition at line 170 of file GlobalMaster.C.

References groupPositionBegin.

Referenced by colvarproxy_namd::calculate().

00170                                                                {
00171   return groupPositionBegin;
00172 }

PositionList::const_iterator GlobalMaster::getGroupPositionEnd (  )  [protected]

Definition at line 174 of file GlobalMaster.C.

References groupPositionEnd.

Referenced by colvarproxy_namd::calculate().

00174                                                              {
00175   return groupPositionEnd;
00176 }

ForceList::const_iterator GlobalMaster::getGroupTotalForceBegin (  )  [protected]

Definition at line 178 of file GlobalMaster.C.

References groupTotalForceBegin.

Referenced by colvarproxy_namd::calculate().

00178                                                               {
00179   return groupTotalForceBegin;
00180 }

ForceList::const_iterator GlobalMaster::getGroupTotalForceEnd (  )  [protected]

Definition at line 182 of file GlobalMaster.C.

References groupTotalForceEnd.

Referenced by colvarproxy_namd::calculate().

00182                                                             {
00183   return groupTotalForceEnd;
00184 }

AtomIDList::const_iterator GlobalMaster::getLastAtomsForcedBegin (  )  [protected]

Definition at line 195 of file GlobalMaster.C.

References lastAtomsForcedBegin.

00195                                                                {
00196   return lastAtomsForcedBegin;
00197 }

AtomIDList::const_iterator GlobalMaster::getLastAtomsForcedEnd (  )  [protected]

Definition at line 199 of file GlobalMaster.C.

References lastAtomsForcedEnd.

00199                                                              {
00200   return lastAtomsForcedEnd;
00201 }

ForceList::const_iterator GlobalMaster::getLastForcesBegin (  )  [protected]

Definition at line 203 of file GlobalMaster.C.

References lastForcesBegin.

00203                                                          {
00204   return lastForcesBegin;
00205 }

ForceList::const_iterator GlobalMaster::getTotalForce (  )  [protected]

Definition at line 217 of file GlobalMaster.C.

References totalForceBegin.

Referenced by colvarproxy_namd::calculate().

00218 {
00219   return totalForceBegin;
00220 }

const ForceList & GlobalMaster::groupForces (  ) 

Definition at line 128 of file GlobalMaster.C.

References grpForces.

00128                                            {
00129   return grpForces;
00130 }

ForceList & GlobalMaster::modifyAppliedForces (  )  [protected]
AtomIDList & GlobalMaster::modifyForcedAtoms (  )  [protected]
ForceList & GlobalMaster::modifyGroupForces (  )  [protected]

Definition at line 146 of file GlobalMaster.C.

References appForcesChanged, and grpForces.

Referenced by GlobalMasterTcl::calculate(), GlobalMasterIMD::calculate(), colvarproxy_namd::calculate(), and colvarproxy_namd::init_atom_group().

00146                                            {
00147   // XXX should we mark something else here?
00148   appForcesChanged = true;
00149   return grpForces;
00150 }

AtomIDList & GlobalMaster::modifyRequestedAtoms (  )  [protected]
ResizeArray< AtomIDList > & GlobalMaster::modifyRequestedGroups (  )  [protected]

Definition at line 152 of file GlobalMaster.C.

References DebugM, reqGroups, and reqGroupsChanged.

Referenced by colvarproxy_namd::calculate(), colvarproxy_namd::init_atom_group(), colvarproxy_namd::reset(), colvarproxy_namd::setup(), and colvarproxy_namd::update_group_properties().

00152                                                              {
00153   reqGroupsChanged = true;
00154   DebugM(1,"Groups have changed.\n");
00155   return reqGroups;
00156 }

void GlobalMaster::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,
AtomIDList::iterator  last_atoms_forced_i,
AtomIDList::iterator  last_atoms_forced_e,
ForceList::iterator  last_forces_i,
AtomIDList::iterator  forceid_i,
AtomIDList::iterator  forceid_e,
ForceList::iterator  totalforce_i 
)

Definition at line 16 of file GlobalMaster.C.

References appForces, appForcesChanged, atomIdBegin, atomIdEnd, atomPositionBegin, calculate(), fAtoms, forceIdBegin, forceIdEnd, groupMassBegin, groupMassEnd, groupPositionBegin, groupPositionEnd, groupTotalForceBegin, groupTotalForceEnd, grpForces, lastAtomsForcedBegin, lastAtomsForcedEnd, lastForcesBegin, NAMD_die(), ResizeArray< Elem >::size(), and totalForceBegin.

00030                                                                {
00031   atomIdBegin = a_i;
00032   atomIdEnd = a_e;
00033   atomPositionBegin = p_i;
00034   groupPositionBegin = g_i;
00035   groupPositionEnd = g_e;
00036   groupMassBegin = gm_i;
00037   groupMassEnd = gm_e;
00038   groupTotalForceBegin = gtf_i;
00039   groupTotalForceEnd = gtf_e;
00040   lastAtomsForcedBegin = last_atoms_forced_i;
00041   lastAtomsForcedEnd = last_atoms_forced_e;
00042   lastForcesBegin = last_forces_i;
00043   forceIdBegin = forceid_i;
00044   forceIdEnd = forceid_e;
00045   totalForceBegin = totalforce_i;
00046 
00047   calculate();
00048 
00049   /* check to make sure the force arrays still match */
00050   if(appForcesChanged) {
00051     if(fAtoms.size() != appForces.size())
00052       NAMD_die("# of atoms forced != # of forces given");
00053   }
00054   if(appForcesChanged) {
00055     if(grpForces.size() != gm_e - gm_i)
00056       NAMD_die("# of groups forced != # of groups requested");
00057   }
00058 }

const AtomIDList & GlobalMaster::requestedAtoms (  ) 

Definition at line 111 of file GlobalMaster.C.

References reqAtoms.

Referenced by GlobalMasterTest::calculate().

00111                                                {
00112   return reqAtoms;
00113 }

const ResizeArray< AtomIDList > & GlobalMaster::requestedGroups (  ) 

Definition at line 132 of file GlobalMaster.C.

References reqGroups.

Referenced by GlobalMasterIMD::GlobalMasterIMD(), GlobalMasterSMD::GlobalMasterSMD(), and GlobalMasterTcl::GlobalMasterTcl().

00132                                                              {
00133   return reqGroups;
00134 }

bool GlobalMaster::requestedTotalForces (  )  [inline]

Definition at line 62 of file GlobalMaster.h.

References totalForceRequested.

00062 { return totalForceRequested; }

void GlobalMaster::requestTotalForce ( bool  yesno = true  )  [inline, protected]
void GlobalMaster::setLattice ( const Lattice lat  )  [inline]

Definition at line 70 of file GlobalMaster.h.

References lattice.

Referenced by GlobalMasterServer::addClient().

00070 { lattice = lat; }


Member Data Documentation

Definition at line 160 of file GlobalMaster.h.

Referenced by appliedForces(), check(), modifyAppliedForces(), and processData().

Definition at line 133 of file GlobalMaster.h.

Referenced by getAtomIdBegin(), GlobalMaster(), and processData().

Definition at line 134 of file GlobalMaster.h.

Referenced by getAtomIdEnd(), GlobalMaster(), and processData().

Definition at line 135 of file GlobalMaster.h.

Referenced by getAtomPositionBegin(), GlobalMaster(), and processData().

Definition at line 159 of file GlobalMaster.h.

Referenced by check(), forcedAtoms(), modifyForcedAtoms(), and processData().

Definition at line 149 of file GlobalMaster.h.

Referenced by getForceIdBegin(), GlobalMaster(), and processData().

Definition at line 150 of file GlobalMaster.h.

Referenced by getForceIdEnd(), GlobalMaster(), and processData().

Definition at line 138 of file GlobalMaster.h.

Referenced by check(), getGroupMassBegin(), GlobalMaster(), and processData().

Definition at line 139 of file GlobalMaster.h.

Referenced by check(), getGroupMassEnd(), GlobalMaster(), and processData().

Definition at line 136 of file GlobalMaster.h.

Referenced by getGroupPositionBegin(), GlobalMaster(), and processData().

Definition at line 137 of file GlobalMaster.h.

Referenced by getGroupPositionEnd(), GlobalMaster(), and processData().

Definition at line 140 of file GlobalMaster.h.

Referenced by getGroupTotalForceBegin(), and processData().

Definition at line 141 of file GlobalMaster.h.

Referenced by getGroupTotalForceEnd(), and processData().

Definition at line 164 of file GlobalMaster.h.

Referenced by check(), groupForces(), modifyGroupForces(), and processData().

Definition at line 144 of file GlobalMaster.h.

Referenced by getLastAtomsForcedBegin(), GlobalMaster(), and processData().

Definition at line 146 of file GlobalMaster.h.

Referenced by getLastAtomsForcedEnd(), GlobalMaster(), and processData().

Definition at line 145 of file GlobalMaster.h.

Referenced by getLastForcesBegin(), GlobalMaster(), and processData().

const Lattice* GlobalMaster::lattice [protected]

Definition at line 52 of file GlobalMaster.h.

Referenced by GlobalMaster().

Definition at line 156 of file GlobalMaster.h.

Referenced by modifyRequestedAtoms(), and requestedAtoms().

Definition at line 155 of file GlobalMaster.h.

Referenced by changedAtoms(), clearChanged(), and modifyRequestedAtoms().

Definition at line 163 of file GlobalMaster.h.

Referenced by modifyRequestedGroups(), and requestedGroups().

Definition at line 162 of file GlobalMaster.h.

Referenced by changedGroups(), clearChanged(), and modifyRequestedGroups().

Definition at line 151 of file GlobalMaster.h.

Referenced by getTotalForce(), GlobalMaster(), and processData().

Definition at line 117 of file GlobalMaster.h.

Referenced by GlobalMaster(), requestedTotalForces(), and requestTotalForce().


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

Generated on 8 Dec 2019 for NAMD by  doxygen 1.6.1