Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

GlobalMaster Class Reference

#include <GlobalMaster.h>

Inheritance diagram for GlobalMaster:

GlobalMasterEasy GlobalMasterFreeEnergy GlobalMasterIMD GlobalMasterSMD GlobalMasterTcl GlobalMasterTest GlobalMasterTMD GlobalMasterMisc 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, 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 ()
void clearChanged ()
virtual ~GlobalMaster ()
void check () const

Public Attributes

int step

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 ()
AtomIDList::const_iterator getLastAtomsForcedBegin ()
AtomIDList::const_iterator getLastAtomsForcedEnd ()
ForceList::const_iterator getLastForcesBegin ()
AtomIDList::const_iterator getForceIdBegin ()
AtomIDList::const_iterator getForceIdEnd ()
ForceList::const_iterator getTotalForce ()
ResizeArray< BigReal >::const_iterator getGroupMassBegin ()
ResizeArray< BigReal >::const_iterator getGroupMassEnd ()

Detailed Description

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 29 of file GlobalMaster.h.


Constructor & Destructor Documentation

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

Definition at line 59 of file GlobalMaster.h.

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

GlobalMaster::GlobalMaster  )  [protected]
 

Definition at line 90 of file GlobalMaster.C.

References clearChanged(), and step.

00090                            {
00091   step = -1;
00092   clearChanged();
00093 }


Member Function Documentation

const ForceList & GlobalMaster::appliedForces  ) 
 

Definition at line 120 of file GlobalMaster.C.

References ForceList.

Referenced by GlobalMasterTest::calculate().

00120                                              {
00121   return appForces;
00122 }

void GlobalMaster::calculate  )  [protected, virtual]
 

Reimplemented in GlobalMasterIMD, GlobalMasterTcl, and GlobalMasterTest.

Definition at line 86 of file GlobalMaster.C.

References NAMD_die().

Referenced by processData().

00086                              {
00087   NAMD_die("Internal error: pure virtual function called");
00088 }

bool GlobalMaster::changedAtoms  ) 
 

Definition at line 95 of file GlobalMaster.C.

00095                                 {
00096   return reqAtomsChanged;
00097 }

bool GlobalMaster::changedForces  ) 
 

Definition at line 99 of file GlobalMaster.C.

00099                                  {
00100   return appForcesChanged;
00101 }

bool GlobalMaster::changedGroups  ) 
 

Definition at line 103 of file GlobalMaster.C.

00103                                  {
00104   return reqGroupsChanged;
00105 }

void GlobalMaster::check  )  const
 

Definition at line 72 of file GlobalMaster.C.

References NAMD_die(), and ResizeArray< Elem >::size().

00072                                {
00073   /* check to make sure the force arrays still match */
00074   if(fAtoms.size() != appForces.size())
00075     NAMD_die("# of atoms forced != # of forces given");
00076   if(reqGroups.size() != grpForces.size())
00077     NAMD_die("# of groups forced != # of groups requested");
00078 }

void GlobalMaster::clearChanged  ) 
 

Definition at line 80 of file GlobalMaster.C.

Referenced by GlobalMaster().

00080                                 {
00081   reqAtomsChanged = false;
00082   appForcesChanged = false;
00083   reqGroupsChanged = false;
00084 }

const AtomIDList & GlobalMaster::forcedAtoms  ) 
 

Definition at line 116 of file GlobalMaster.C.

References AtomIDList.

00116                                             {
00117   return fAtoms;
00118 }

AtomIDList::const_iterator GlobalMaster::getAtomIdBegin  )  [protected]
 

Definition at line 154 of file GlobalMaster.C.

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

00154                                                       {
00155   return atomIdBegin;
00156 }

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

Definition at line 158 of file GlobalMaster.C.

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

00158                                                     {
00159   return atomIdEnd;
00160 }

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

Definition at line 162 of file GlobalMaster.C.

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

00162                                                               {
00163   return atomPositionBegin;
00164 }

AtomIDList::const_iterator GlobalMaster::getForceIdBegin  )  [protected]
 

Definition at line 195 of file GlobalMaster.C.

00196 {
00197   return forceIdBegin;
00198 }

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

Definition at line 200 of file GlobalMaster.C.

00201 {
00202   return forceIdEnd;
00203 }

ResizeArray< BigReal >::const_iterator GlobalMaster::getGroupMassBegin  )  [protected]
 

Definition at line 174 of file GlobalMaster.C.

References ResizeArray< Elem >::begin().

00175 {
00176   return groupMasses.begin();
00177 }

ResizeArray< BigReal >::const_iterator GlobalMaster::getGroupMassEnd  )  [protected]
 

Definition at line 179 of file GlobalMaster.C.

References ResizeArray< Elem >::end().

00179                                                                  {
00180   return groupMasses.end();
00181 }

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

Definition at line 166 of file GlobalMaster.C.

00166                                                                {
00167   return groupPositionBegin;
00168 }

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

Definition at line 170 of file GlobalMaster.C.

00170                                                              {
00171   return groupPositionEnd;
00172 }

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

Definition at line 183 of file GlobalMaster.C.

00183                                                                {
00184   return lastAtomsForcedBegin;
00185 }

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

Definition at line 187 of file GlobalMaster.C.

00187                                                              {
00188   return lastAtomsForcedEnd;
00189 }

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

Definition at line 191 of file GlobalMaster.C.

00191                                                          {
00192   return lastForcesBegin;
00193 }

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

Definition at line 205 of file GlobalMaster.C.

00206 {
00207   return totalForceBegin;
00208 }

const ForceList & GlobalMaster::groupForces  ) 
 

Definition at line 124 of file GlobalMaster.C.

References ForceList.

00124                                            {
00125   return grpForces;
00126 }

ForceList & GlobalMaster::modifyAppliedForces  )  [protected]
 

Definition at line 137 of file GlobalMaster.C.

References ForceList.

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

00137                                              {
00138   appForcesChanged = true;
00139   return appForces;
00140 }

AtomIDList & GlobalMaster::modifyForcedAtoms  )  [protected]
 

Definition at line 132 of file GlobalMaster.C.

References AtomIDList.

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

00132                                             {
00133   appForcesChanged = true;
00134   return fAtoms;
00135 }

ForceList & GlobalMaster::modifyGroupForces  )  [protected]
 

Definition at line 142 of file GlobalMaster.C.

References ForceList.

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

00142                                            {
00143   // XXX should we mark something else here?
00144   appForcesChanged = true;
00145   return grpForces;
00146 }

AtomIDList & GlobalMaster::modifyRequestedAtoms  )  [protected]
 

Definition at line 111 of file GlobalMaster.C.

References AtomIDList.

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

00111                                                {
00112   reqAtomsChanged = true;
00113   return reqAtoms;
00114 }

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

Definition at line 148 of file GlobalMaster.C.

References DebugM.

00148                                                              {
00149   reqGroupsChanged = true;
00150   DebugM(1,"Groups have changed.\n");
00151   return reqGroups;
00152 }

void GlobalMaster::processData AtomIDList::iterator  a_i,
AtomIDList::iterator  a_e,
PositionList::iterator  p_i,
PositionList::iterator  g_i,
PositionList::iterator  g_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 ResizeArray< Elem >::add(), AtomIDList, Molecule::atommass(), BigReal, calculate(), Node::molecule, NAMD_die(), Node::Object(), ResizeArray< Elem >::resize(), and ResizeArray< Elem >::size().

00026                                                                {
00027   atomIdBegin = a_i;
00028   atomIdEnd = a_e;
00029   atomPositionBegin = p_i;
00030   groupPositionBegin = g_i;
00031   groupPositionEnd = g_e;
00032   lastAtomsForcedBegin = last_atoms_forced_i;
00033   lastAtomsForcedEnd = last_atoms_forced_e;
00034   lastForcesBegin = last_forces_i;
00035   forceIdBegin = forceid_i;
00036   forceIdEnd = forceid_e;
00037   totalForceBegin = totalforce_i;
00038 
00039   calculate();
00040 
00041   /* check to make sure the force arrays still match */
00042   if(appForcesChanged) {
00043     if(fAtoms.size() != appForces.size())
00044       NAMD_die("# of atoms forced != # of forces given");
00045   }
00046   if(appForcesChanged) {
00047     if(reqGroups.size() != grpForces.size())
00048       NAMD_die("# of groups forced != # of groups requested");
00049   }
00050 
00051   /* check if the groups have changed, and update the masses */
00052   if(reqGroupsChanged) {
00053     groupMasses.resize(0);
00054 
00055     // is there a way to do this non-globally?
00056     Molecule *mol = Node::Object()->molecule;
00057 
00058     // update each group mass
00059     int g;
00060     for(g=0;g<reqGroups.size();g++) {
00061       AtomIDList &atom_list = reqGroups[g];
00062       BigReal mass = 0; // the total mass of the group
00063       int a;
00064       for(a=0;a<atom_list.size();a++) { // get the total
00065         mass += mol->atommass(a);
00066       }
00067       groupMasses.add(mass); // add the mass to the group
00068     }
00069   }
00070 }

const AtomIDList & GlobalMaster::requestedAtoms  ) 
 

Definition at line 107 of file GlobalMaster.C.

References AtomIDList.

Referenced by GlobalMasterTest::calculate().

00107                                                {
00108   return reqAtoms;
00109 }

const ResizeArray< AtomIDList > & GlobalMaster::requestedGroups  ) 
 

Definition at line 128 of file GlobalMaster.C.

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

00128                                                              {
00129   return reqGroups;
00130 }


Member Data Documentation

int GlobalMaster::step
 

Definition at line 46 of file GlobalMaster.h.

Referenced by GlobalMaster().


The documentation for this class was generated from the following files:
Generated on Sat Sep 6 04:07:45 2008 for NAMD by  doxygen 1.3.9.1