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]

Definition at line 78 of file GlobalMaster.C.

References atomIdBegin, atomIdEnd, atomPositionBegin, clearChanged(), forceIdBegin, forceIdEnd, groupMassBegin, groupMassEnd, groupPositionBegin, groupPositionEnd, lastAtomsForcedBegin, lastAtomsForcedEnd, lastForcesBegin, lattice, old_num_groups_requested, step, totalForceBegin, and totalForceRequested.

00078                            {
00079   step = -1;
00080   old_num_groups_requested = 0;
00081   clearChanged();
00082   atomIdBegin = 0;
00083   atomIdEnd = 0;
00084   atomPositionBegin = 0;
00085   groupPositionBegin = 0;
00086   groupPositionEnd = 0;
00087   groupMassBegin = 0;
00088   groupMassEnd = 0;
00089   lastAtomsForcedBegin = 0;
00090   lastAtomsForcedEnd = 0;
00091   lastForcesBegin = 0;
00092   forceIdBegin = 0;
00093   forceIdEnd = 0;
00094   totalForceBegin = 0;
00095   lattice = 0;
00096   totalForceRequested = false;
00097 }


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]

Definition at line 158 of file GlobalMaster.C.

References atomIdBegin.

Referenced by GlobalMasterTest::calculate(), colvarproxy_namd::calculate(), GlobalMasterFreeEnergy::getPosition(), and GlobalMasterEasy::getPosition().

00158                                                       {
00159   return atomIdBegin;
00160 }

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

Definition at line 162 of file GlobalMaster.C.

References atomIdEnd.

Referenced by GlobalMasterTest::calculate(), colvarproxy_namd::calculate(), GlobalMasterFreeEnergy::getPosition(), and GlobalMasterEasy::getPosition().

00162                                                     {
00163   return atomIdEnd;
00164 }

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

Definition at line 166 of file GlobalMaster.C.

References atomPositionBegin.

Referenced by GlobalMasterTest::calculate(), colvarproxy_namd::calculate(), GlobalMasterFreeEnergy::getPosition(), and GlobalMasterEasy::getPosition().

00166                                                               {
00167   return atomPositionBegin;
00168 }

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]

Definition at line 141 of file GlobalMaster.C.

References appForces, and appForcesChanged.

Referenced by GlobalMasterFreeEnergy::addForce(), GlobalMasterEasy::addForce(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMasterIMD::calculate(), and colvarproxy_namd::calculate().

00141                                              {
00142   appForcesChanged = true;
00143   return appForces;
00144 }

AtomIDList & GlobalMaster::modifyForcedAtoms (  )  [protected]

Definition at line 136 of file GlobalMaster.C.

References appForcesChanged, and fAtoms.

Referenced by GlobalMasterFreeEnergy::addForce(), GlobalMasterEasy::addForce(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMasterIMD::calculate(), and colvarproxy_namd::calculate().

00136                                             {
00137   appForcesChanged = true;
00138   return fAtoms;
00139 }

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]

Definition at line 115 of file GlobalMaster.C.

References reqAtoms, and reqAtomsChanged.

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

00115                                                {
00116   reqAtomsChanged = true;
00117   return reqAtoms;
00118 }

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

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]

Definition at line 118 of file GlobalMaster.h.

References totalForceRequested.

Referenced by colvarproxy_namd::colvarproxy_namd(), and colvarproxy_namd::request_total_force().

00118 { totalForceRequested = yesno; }

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

ForceList GlobalMaster::appForces [protected]

Definition at line 160 of file GlobalMaster.h.

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

bool GlobalMaster::appForcesChanged [protected]

Definition at line 158 of file GlobalMaster.h.

Referenced by changedForces(), clearChanged(), modifyAppliedForces(), modifyForcedAtoms(), modifyGroupForces(), and processData().

AtomIDList::iterator GlobalMaster::atomIdBegin [protected]

Definition at line 133 of file GlobalMaster.h.

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

AtomIDList::iterator GlobalMaster::atomIdEnd [protected]

Definition at line 134 of file GlobalMaster.h.

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

PositionList::iterator GlobalMaster::atomPositionBegin [protected]

Definition at line 135 of file GlobalMaster.h.

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

AtomIDList GlobalMaster::fAtoms [protected]

Definition at line 159 of file GlobalMaster.h.

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

AtomIDList::iterator GlobalMaster::forceIdBegin [protected]

Definition at line 149 of file GlobalMaster.h.

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

AtomIDList::iterator GlobalMaster::forceIdEnd [protected]

Definition at line 150 of file GlobalMaster.h.

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

BigRealList::iterator GlobalMaster::groupMassBegin [protected]

Definition at line 138 of file GlobalMaster.h.

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

BigRealList::iterator GlobalMaster::groupMassEnd [protected]

Definition at line 139 of file GlobalMaster.h.

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

PositionList::iterator GlobalMaster::groupPositionBegin [protected]

Definition at line 136 of file GlobalMaster.h.

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

PositionList::iterator GlobalMaster::groupPositionEnd [protected]

Definition at line 137 of file GlobalMaster.h.

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

ForceList::iterator GlobalMaster::groupTotalForceBegin [protected]

Definition at line 140 of file GlobalMaster.h.

Referenced by getGroupTotalForceBegin(), and processData().

ForceList::iterator GlobalMaster::groupTotalForceEnd [protected]

Definition at line 141 of file GlobalMaster.h.

Referenced by getGroupTotalForceEnd(), and processData().

ForceList GlobalMaster::grpForces [protected]

Definition at line 164 of file GlobalMaster.h.

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

AtomIDList::iterator GlobalMaster::lastAtomsForcedBegin [protected]

Definition at line 144 of file GlobalMaster.h.

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

AtomIDList::iterator GlobalMaster::lastAtomsForcedEnd [protected]

Definition at line 146 of file GlobalMaster.h.

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

ForceList::iterator GlobalMaster::lastForcesBegin [protected]

Definition at line 145 of file GlobalMaster.h.

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

const Lattice* GlobalMaster::lattice [protected]

Definition at line 126 of file GlobalMaster.h.

Referenced by GlobalMaster(), colvarproxy_namd::position_dist2(), colvarproxy_namd::position_distance(), colvarproxy_namd::select_closest_image(), setLattice(), and Sequencer::submitHalfstep().

int GlobalMaster::old_num_groups_requested

Definition at line 52 of file GlobalMaster.h.

Referenced by GlobalMaster().

AtomIDList GlobalMaster::reqAtoms [protected]

Definition at line 156 of file GlobalMaster.h.

Referenced by modifyRequestedAtoms(), and requestedAtoms().

bool GlobalMaster::reqAtomsChanged [protected]

Definition at line 155 of file GlobalMaster.h.

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

ResizeArray<AtomIDList> GlobalMaster::reqGroups [protected]

Definition at line 163 of file GlobalMaster.h.

Referenced by modifyRequestedGroups(), and requestedGroups().

bool GlobalMaster::reqGroupsChanged [protected]

Definition at line 162 of file GlobalMaster.h.

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

int GlobalMaster::step

Definition at line 51 of file GlobalMaster.h.

Referenced by colvarproxy_namd::calculate(), IMDOutput::gather_coordinates(), GlobalMaster(), Sequencer::integrate(), and Sequencer::minimize().

ForceList::iterator GlobalMaster::totalForceBegin [protected]

Definition at line 151 of file GlobalMaster.h.

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

bool GlobalMaster::totalForceRequested [protected]

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 Tue Nov 21 01:17:19 2017 for NAMD by  doxygen 1.4.7