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

int step
int old_num_groups_requested

Protected Member Functions

 GlobalMaster ()
virtual void calculate ()
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

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

Detailed Description

Definition at line 30 of file GlobalMaster.h.


Constructor & Destructor Documentation

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

Definition at line 73 of file GlobalMaster.h.

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

GlobalMaster::GlobalMaster (  )  [protected]

Member Function Documentation

const ForceList & GlobalMaster::appliedForces (  ) 

Definition at line 137 of file GlobalMaster.C.

References appForces.

Referenced by GlobalMasterTest::calculate().

00137                                              {
00138   return appForces;
00139 }

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

Reimplemented in colvarproxy_namd, GlobalMasterIMD, GlobalMasterTcl, and GlobalMasterTest.

Definition at line 80 of file GlobalMaster.C.

References NAMD_die().

Referenced by processData().

00080                              {
00081   NAMD_die("Internal error: pure virtual function called");
00082 }

bool GlobalMaster::changedAtoms (  ) 

Definition at line 107 of file GlobalMaster.C.

References reqAtomsChanged.

00107                                 {
00108   return reqAtomsChanged;
00109 }

bool GlobalMaster::changedForces (  ) 

Definition at line 111 of file GlobalMaster.C.

References appForcesChanged.

00111                                  {
00112   return appForcesChanged;
00113 }

bool GlobalMaster::changedGridObjs (  ) 

Definition at line 119 of file GlobalMaster.C.

References reqGridObjsChanged.

00119                                    {
00120   return reqGridObjsChanged;
00121 }

bool GlobalMaster::changedGroups (  ) 

Definition at line 115 of file GlobalMaster.C.

References reqGroupsChanged.

00115                                  {
00116   return reqGroupsChanged;
00117 }

void GlobalMaster::check (  )  const

Definition at line 63 of file GlobalMaster.C.

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

Referenced by processData().

00063                                {
00064   /* check to make sure the force arrays still match */
00065   if(fAtoms.size() != appForces.size())
00066     NAMD_die("# of atoms forced != # of forces given");
00067   if(grpForces.size() != groupMassEnd - groupMassBegin)
00068     NAMD_die("# of groups forced != # of groups requested");
00069   if(gridobjForces.size() != reqGridObjs.size())
00070     NAMD_die("# of grid objects forced != # of grid objects requested");
00071 }

void GlobalMaster::clearChanged (  ) 

Definition at line 73 of file GlobalMaster.C.

References appForcesChanged, reqAtomsChanged, reqGridObjsChanged, and reqGroupsChanged.

Referenced by GlobalMaster().

00073                                 {
00074   reqAtomsChanged = false;
00075   appForcesChanged = false;
00076   reqGroupsChanged = false;
00077   reqGridObjsChanged = false;
00078 }

const AtomIDList & GlobalMaster::forcedAtoms (  ) 

Definition at line 133 of file GlobalMaster.C.

References fAtoms.

00133                                             {
00134   return fAtoms;
00135 }

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 255 of file GlobalMaster.C.

References forceIdBegin.

Referenced by colvarproxy_namd::calculate().

00256 {
00257   return forceIdBegin;
00258 }

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

Definition at line 260 of file GlobalMaster.C.

References forceIdEnd.

Referenced by colvarproxy_namd::calculate().

00261 {
00262   return forceIdEnd;
00263 }

IntList::const_iterator GlobalMaster::getGridObjIndexBegin (  )  [protected]

Definition at line 218 of file GlobalMaster.C.

References gridObjIndexBegin.

Referenced by colvarproxy_namd::calculate().

00218                                                          {
00219   return gridObjIndexBegin;
00220 }

IntList::const_iterator GlobalMaster::getGridObjIndexEnd (  )  [protected]

Definition at line 222 of file GlobalMaster.C.

References gridObjIndexEnd.

Referenced by colvarproxy_namd::calculate().

00222                                                        {
00223   return gridObjIndexEnd;
00224 }

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

Definition at line 226 of file GlobalMaster.C.

References gridObjValueBegin.

Referenced by colvarproxy_namd::calculate().

00226                                                              {
00227   return gridObjValueBegin;
00228 }

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

Definition at line 230 of file GlobalMaster.C.

References gridObjValueEnd.

Referenced by colvarproxy_namd::calculate().

00230                                                            {
00231   return gridObjValueEnd;
00232 }

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

Definition at line 234 of file GlobalMaster.C.

References groupMassBegin.

Referenced by GlobalMasterTcl::calculate().

00235 {
00236   return groupMassBegin;
00237 }

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

Definition at line 239 of file GlobalMaster.C.

References groupMassEnd.

Referenced by GlobalMasterTcl::calculate().

00239                                                         {
00240   return groupMassEnd;
00241 }

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

Definition at line 202 of file GlobalMaster.C.

References groupPositionBegin.

Referenced by colvarproxy_namd::calculate().

00202                                                                {
00203   return groupPositionBegin;
00204 }

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

Definition at line 206 of file GlobalMaster.C.

References groupPositionEnd.

Referenced by colvarproxy_namd::calculate().

00206                                                              {
00207   return groupPositionEnd;
00208 }

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

Definition at line 210 of file GlobalMaster.C.

References groupTotalForceBegin.

Referenced by colvarproxy_namd::calculate().

00210                                                               {
00211   return groupTotalForceBegin;
00212 }

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

Definition at line 214 of file GlobalMaster.C.

References groupTotalForceEnd.

Referenced by colvarproxy_namd::calculate().

00214                                                             {
00215   return groupTotalForceEnd;
00216 }

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

Definition at line 243 of file GlobalMaster.C.

References lastAtomsForcedBegin.

00243                                                                {
00244   return lastAtomsForcedBegin;
00245 }

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

Definition at line 247 of file GlobalMaster.C.

References lastAtomsForcedEnd.

00247                                                              {
00248   return lastAtomsForcedEnd;
00249 }

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

Definition at line 251 of file GlobalMaster.C.

References lastForcesBegin.

00251                                                          {
00252   return lastForcesBegin;
00253 }

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

Definition at line 265 of file GlobalMaster.C.

References totalForceBegin.

Referenced by colvarproxy_namd::calculate().

00266 {
00267   return totalForceBegin;
00268 }

const BigRealList & GlobalMaster::gridObjForces (  ) 

Definition at line 145 of file GlobalMaster.C.

References gridobjForces.

00145                                                {
00146   return gridobjForces;
00147 }

const ForceList & GlobalMaster::groupForces (  ) 

Definition at line 141 of file GlobalMaster.C.

References grpForces.

00141                                            {
00142   return grpForces;
00143 }

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

Definition at line 179 of file GlobalMaster.C.

References appForcesChanged, and gridobjForces.

Referenced by colvarproxy_namd::calculate(), and colvarproxy_namd::setup().

00179                                                {
00180   appForcesChanged = true;
00181   return gridobjForces;
00182 }

ForceList & GlobalMaster::modifyGroupForces (  )  [protected]

Definition at line 167 of file GlobalMaster.C.

References appForcesChanged, and grpForces.

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

00167                                            {
00168   // XXX should we mark something else here?
00169   appForcesChanged = true;
00170   return grpForces;
00171 }

AtomIDList & GlobalMaster::modifyRequestedAtoms (  )  [protected]

Definition at line 127 of file GlobalMaster.C.

References DebugM, endi(), reqAtoms, and reqAtomsChanged.

Referenced by GlobalMasterTest::calculate(), colvarproxy_namd::init_atom(), GlobalMasterFreeEnergy::requestAtom(), GlobalMasterEasy::requestAtom(), and colvarproxy_namd::reset().

00127                                                {
00128   reqAtomsChanged = true;
00129   DebugM(3,"modifyRequestedAtoms()\n" << endi);
00130   return reqAtoms;
00131 }

IntList & GlobalMaster::modifyRequestedGridObjects (  )  [protected]

Definition at line 173 of file GlobalMaster.C.

References DebugM, endi(), reqGridObjs, and reqGridObjsChanged.

Referenced by colvarproxy_namd::reset().

00173                                                   {
00174   reqGridObjsChanged = true;
00175   DebugM(3,"modifyRequestedGridObjects()\n" << endi);
00176   return reqGridObjs;
00177 }

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

Definition at line 184 of file GlobalMaster.C.

References DebugM, reqGroups, and reqGroupsChanged.

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

00184                                                              {
00185   reqGroupsChanged = true;
00186   DebugM(1,"Groups have changed.\n");
00187   return reqGroups;
00188 }

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,
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  forceid_i,
AtomIDList::iterator  forceid_e,
ForceList::iterator  totalforce_i 
)

Definition at line 16 of file GlobalMaster.C.

References appForcesChanged, atomIdBegin, atomIdEnd, atomPositionBegin, calculate(), check(), forceIdBegin, forceIdEnd, gridObjIndexBegin, gridObjIndexEnd, gridObjValueBegin, gridObjValueEnd, groupMassBegin, groupMassEnd, groupPositionBegin, groupPositionEnd, groupTotalForceBegin, groupTotalForceEnd, lastAtomsForcedBegin, lastAtomsForcedEnd, lastForcesBegin, and totalForceBegin.

00034                                                                {
00035   atomIdBegin = a_i;
00036   atomIdEnd = a_e;
00037   atomPositionBegin = p_i;
00038   groupPositionBegin = g_i;
00039   groupPositionEnd = g_e;
00040   groupMassBegin = gm_i;
00041   groupMassEnd = gm_e;
00042   groupTotalForceBegin = gtf_i;
00043   groupTotalForceEnd = gtf_e;
00044   gridObjIndexBegin = goi_i;
00045   gridObjIndexEnd = goi_e;
00046   gridObjValueBegin = gov_i;
00047   gridObjValueEnd = gov_e;
00048   lastAtomsForcedBegin = last_atoms_forced_i;
00049   lastAtomsForcedEnd = last_atoms_forced_e;
00050   lastForcesBegin = last_forces_i;
00051   forceIdBegin = forceid_i;
00052   forceIdEnd = forceid_e;
00053   totalForceBegin = totalforce_i;
00054 
00055   calculate();
00056 
00057   /* check to make sure the force arrays still match */
00058   if(appForcesChanged) {
00059     check();
00060   }
00061 }

const AtomIDList & GlobalMaster::requestedAtoms (  ) 

Definition at line 123 of file GlobalMaster.C.

References reqAtoms.

Referenced by GlobalMasterTest::calculate().

00123                                                {
00124   return reqAtoms;
00125 }

const IntList & GlobalMaster::requestedGridObjs (  ) 

Definition at line 153 of file GlobalMaster.C.

References reqGridObjs.

Referenced by colvarproxy_namd::calculate().

00153                                                {
00154   return reqGridObjs;
00155 }

const ResizeArray< AtomIDList > & GlobalMaster::requestedGroups (  ) 
bool GlobalMaster::requestedTotalForces (  )  [inline]

Definition at line 69 of file GlobalMaster.h.

References totalForceRequested.

00069 { return totalForceRequested; }

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

Definition at line 77 of file GlobalMaster.h.

References lattice.

Referenced by GlobalMasterServer::addClient().

00077 { lattice = lat; }


Member Data Documentation

Definition at line 179 of file GlobalMaster.h.

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

Definition at line 148 of file GlobalMaster.h.

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

Definition at line 149 of file GlobalMaster.h.

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

Definition at line 150 of file GlobalMaster.h.

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

Definition at line 178 of file GlobalMaster.h.

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

Definition at line 168 of file GlobalMaster.h.

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

Definition at line 169 of file GlobalMaster.h.

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

Definition at line 187 of file GlobalMaster.h.

Referenced by check(), gridObjForces(), and modifyGridObjForces().

Definition at line 157 of file GlobalMaster.h.

Referenced by getGridObjIndexBegin(), and processData().

Definition at line 158 of file GlobalMaster.h.

Referenced by getGridObjIndexEnd(), and processData().

Definition at line 159 of file GlobalMaster.h.

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

Definition at line 160 of file GlobalMaster.h.

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

Definition at line 153 of file GlobalMaster.h.

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

Definition at line 154 of file GlobalMaster.h.

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

Definition at line 151 of file GlobalMaster.h.

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

Definition at line 152 of file GlobalMaster.h.

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

Definition at line 155 of file GlobalMaster.h.

Referenced by getGroupTotalForceBegin(), and processData().

Definition at line 156 of file GlobalMaster.h.

Referenced by getGroupTotalForceEnd(), and processData().

Definition at line 183 of file GlobalMaster.h.

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

Definition at line 163 of file GlobalMaster.h.

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

Definition at line 165 of file GlobalMaster.h.

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

Definition at line 164 of file GlobalMaster.h.

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

const Lattice* GlobalMaster::lattice [protected]

Definition at line 56 of file GlobalMaster.h.

Referenced by GlobalMaster().

Definition at line 175 of file GlobalMaster.h.

Referenced by modifyRequestedAtoms(), and requestedAtoms().

Definition at line 174 of file GlobalMaster.h.

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

Definition at line 186 of file GlobalMaster.h.

Referenced by check(), modifyRequestedGridObjects(), and requestedGridObjs().

Definition at line 185 of file GlobalMaster.h.

Referenced by changedGridObjs(), clearChanged(), and modifyRequestedGridObjects().

Definition at line 182 of file GlobalMaster.h.

Referenced by modifyRequestedGroups(), and requestedGroups().

Definition at line 181 of file GlobalMaster.h.

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

Definition at line 170 of file GlobalMaster.h.

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

Definition at line 132 of file GlobalMaster.h.

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


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

Generated on 13 Aug 2020 for NAMD by  doxygen 1.6.1