NAMD
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
GlobalMaster Class Reference

#include <GlobalMaster.h>

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

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

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 31 of file GlobalMaster.h.

Constructor & Destructor Documentation

◆ ~GlobalMaster()

GlobalMaster::~GlobalMaster ( )
virtual

Definition at line 120 of file GlobalMaster.C.

120  {
121 #if (defined (NAMD_CUDA) || defined (NAMD_HIP))
122  if (reductionGpuResident) delete reductionGpuResident;
123 #endif
124  delete reduction;
125 }

◆ GlobalMaster()

GlobalMaster::GlobalMaster ( )
protected

Definition at line 88 of file GlobalMaster.C.

References atomIdBegin, atomIdEnd, atomPositionBegin, clearChanged(), SimParameters::CUDASOAintegrateMode, forceIdBegin, forceIdEnd, gridObjValueBegin, gridObjValueEnd, groupMassBegin, groupMassEnd, groupPositionBegin, groupPositionEnd, lastAtomsForcedBegin, lastAtomsForcedEnd, lastForcesBegin, lattice, Node::Object(), ReductionMgr::Object(), old_num_groups_requested, REDUCTIONS_BASIC, REDUCTIONS_GPURESIDENT, Node::simParameters, step, totalForceBegin, totalForceRequested, and ReductionMgr::willSubmit().

88  {
89  step = -1;
91  clearChanged();
92  atomIdBegin = 0;
93  atomIdEnd = 0;
96  groupPositionEnd = 0;
97  groupMassBegin = 0;
98  groupMassEnd = 0;
100  gridObjValueEnd = 0;
102  lastAtomsForcedEnd = 0;
103  lastForcesBegin = 0;
104  forceIdBegin = 0;
105  forceIdEnd = 0;
106  totalForceBegin = 0;
107  lattice = 0;
108  totalForceRequested = false;
109 #if (defined (NAMD_CUDA) || defined (NAMD_HIP))
110  const SimParameters* simparams = Node::Object()->simParameters;
111  if (simparams->CUDASOAintegrateMode) {
112  reductionGpuResident = ReductionMgr::Object()->willSubmit(REDUCTIONS_GPURESIDENT);
113  } else {
114  reductionGpuResident = nullptr;
115  }
116 #endif
118 }
static Node * Object()
Definition: Node.h:86
int old_num_groups_requested
Definition: GlobalMaster.h:58
bool totalForceRequested
Definition: GlobalMaster.h:134
BigRealList::iterator gridObjValueEnd
Definition: GlobalMaster.h:166
SimParameters * simParameters
Definition: Node.h:181
Bool CUDASOAintegrateMode
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:368
ForceList::iterator totalForceBegin
Definition: GlobalMaster.h:176
AtomIDList::iterator lastAtomsForcedEnd
Definition: GlobalMaster.h:171
ForceList::iterator lastForcesBegin
Definition: GlobalMaster.h:170
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:290
AtomIDList::iterator lastAtomsForcedBegin
Definition: GlobalMaster.h:169
PositionList::iterator atomPositionBegin
Definition: GlobalMaster.h:156
BigRealList::iterator gridObjValueBegin
Definition: GlobalMaster.h:165
AtomIDList::iterator atomIdEnd
Definition: GlobalMaster.h:155
BigRealList::iterator groupMassBegin
Definition: GlobalMaster.h:159
AtomIDList::iterator atomIdBegin
Definition: GlobalMaster.h:154
BigRealList::iterator groupMassEnd
Definition: GlobalMaster.h:160
const Lattice * lattice
Definition: GlobalMaster.h:147
PositionList::iterator groupPositionBegin
Definition: GlobalMaster.h:157
AtomIDList::iterator forceIdBegin
Definition: GlobalMaster.h:174
void clearChanged()
Definition: GlobalMaster.C:77
AtomIDList::iterator forceIdEnd
Definition: GlobalMaster.h:175
PositionList::iterator groupPositionEnd
Definition: GlobalMaster.h:158

Member Function Documentation

◆ addReductionEnergy()

void GlobalMaster::addReductionEnergy ( int  reductionTag,
BigReal  energy 
)
protected

Definition at line 142 of file GlobalMaster.C.

References getCurrentReduction(), and SubmitReduction::item().

Referenced by colvarproxy_namd::add_energy().

142  {
144  r->item(reductionTag) += energy;
145 }
BigReal & item(int i)
Definition: ReductionMgr.h:336
SubmitReduction * getCurrentReduction()
Definition: GlobalMaster.C:127

◆ appliedForces()

const ForceList & GlobalMaster::appliedForces ( )

Definition at line 177 of file GlobalMaster.C.

References appForces.

Referenced by GlobalMasterTest::calculate().

177  {
178  return appForces;
179 }
ForceList appForces
Definition: GlobalMaster.h:185

◆ calculate()

void GlobalMaster::calculate ( )
protectedvirtual

Reimplemented in colvarproxy_namd, GlobalMasterIMD, GlobalMasterTcl, and GlobalMasterTest.

Definition at line 84 of file GlobalMaster.C.

References NAMD_die().

Referenced by processData().

84  {
85  NAMD_die("Internal error: pure virtual function called");
86 }
void NAMD_die(const char *err_msg)
Definition: common.C:147

◆ changedAtoms()

bool GlobalMaster::changedAtoms ( )

Definition at line 147 of file GlobalMaster.C.

References reqAtomsChanged.

147  {
148  return reqAtomsChanged;
149 }
bool reqAtomsChanged
Definition: GlobalMaster.h:180

◆ changedForces()

bool GlobalMaster::changedForces ( )

Definition at line 151 of file GlobalMaster.C.

References appForcesChanged.

151  {
152  return appForcesChanged;
153 }
bool appForcesChanged
Definition: GlobalMaster.h:183

◆ changedGridObjs()

bool GlobalMaster::changedGridObjs ( )

Definition at line 159 of file GlobalMaster.C.

References reqGridObjsChanged.

159  {
160  return reqGridObjsChanged;
161 }
bool reqGridObjsChanged
Definition: GlobalMaster.h:191

◆ changedGroups()

bool GlobalMaster::changedGroups ( )

Definition at line 155 of file GlobalMaster.C.

References reqGroupsChanged.

155  {
156  return reqGroupsChanged;
157 }
bool reqGroupsChanged
Definition: GlobalMaster.h:187

◆ check()

void GlobalMaster::check ( ) const

Definition at line 67 of file GlobalMaster.C.

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

Referenced by processData().

67  {
68  /* check to make sure the force arrays still match */
69  if(fAtoms.size() != appForces.size())
70  NAMD_die("# of atoms forced != # of forces given");
72  NAMD_die("# of groups forced != # of groups requested");
74  NAMD_die("# of grid objects forced != # of grid objects requested");
75 }
ForceList grpForces
Definition: GlobalMaster.h:189
int size(void) const
Definition: ResizeArray.h:131
ForceList appForces
Definition: GlobalMaster.h:185
BigRealList gridobjForces
Definition: GlobalMaster.h:193
BigRealList::iterator groupMassBegin
Definition: GlobalMaster.h:159
IntList reqGridObjs
Definition: GlobalMaster.h:192
void NAMD_die(const char *err_msg)
Definition: common.C:147
BigRealList::iterator groupMassEnd
Definition: GlobalMaster.h:160
AtomIDList fAtoms
Definition: GlobalMaster.h:184

◆ clearChanged()

void GlobalMaster::clearChanged ( )

Definition at line 77 of file GlobalMaster.C.

References appForcesChanged, reqAtomsChanged, reqGridObjsChanged, and reqGroupsChanged.

Referenced by GlobalMaster().

77  {
78  reqAtomsChanged = false;
79  appForcesChanged = false;
80  reqGroupsChanged = false;
81  reqGridObjsChanged = false;
82 }
bool reqGroupsChanged
Definition: GlobalMaster.h:187
bool reqGridObjsChanged
Definition: GlobalMaster.h:191
bool reqAtomsChanged
Definition: GlobalMaster.h:180
bool appForcesChanged
Definition: GlobalMaster.h:183

◆ forcedAtoms()

const AtomIDList & GlobalMaster::forcedAtoms ( )

Definition at line 173 of file GlobalMaster.C.

References fAtoms.

173  {
174  return fAtoms;
175 }
AtomIDList fAtoms
Definition: GlobalMaster.h:184

◆ getAtomIdBegin()

AtomIDList::const_iterator GlobalMaster::getAtomIdBegin ( )
protected

Definition at line 230 of file GlobalMaster.C.

References atomIdBegin.

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

230  {
231  return atomIdBegin;
232 }
AtomIDList::iterator atomIdBegin
Definition: GlobalMaster.h:154

◆ getAtomIdEnd()

AtomIDList::const_iterator GlobalMaster::getAtomIdEnd ( )
protected

Definition at line 234 of file GlobalMaster.C.

References atomIdEnd.

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

234  {
235  return atomIdEnd;
236 }
AtomIDList::iterator atomIdEnd
Definition: GlobalMaster.h:155

◆ getAtomPositionBegin()

PositionList::const_iterator GlobalMaster::getAtomPositionBegin ( )
protected

Definition at line 238 of file GlobalMaster.C.

References atomPositionBegin.

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

238  {
239  return atomPositionBegin;
240 }
PositionList::iterator atomPositionBegin
Definition: GlobalMaster.h:156

◆ getCurrentReduction()

SubmitReduction * GlobalMaster::getCurrentReduction ( )
protected

Definition at line 127 of file GlobalMaster.C.

References SimParameters::CUDASOAintegrate, Node::Object(), and Node::simParameters.

Referenced by addReductionEnergy(), and submitReduction().

127  {
128 #if (defined (NAMD_CUDA) || defined (NAMD_HIP))
129  const SimParameters* simparams = Node::Object()->simParameters;
130  return (simparams->CUDASOAintegrate) ? reductionGpuResident :
131  reduction;
132 #else
133  return reduction;
134 #endif
135 }
static Node * Object()
Definition: Node.h:86
SimParameters * simParameters
Definition: Node.h:181

◆ getForceIdBegin()

AtomIDList::const_iterator GlobalMaster::getForceIdBegin ( )
protected

Definition at line 295 of file GlobalMaster.C.

References forceIdBegin.

Referenced by colvarproxy_namd::calculate().

296 {
297  return forceIdBegin;
298 }
AtomIDList::iterator forceIdBegin
Definition: GlobalMaster.h:174

◆ getForceIdEnd()

AtomIDList::const_iterator GlobalMaster::getForceIdEnd ( )
protected

Definition at line 300 of file GlobalMaster.C.

References forceIdEnd.

Referenced by colvarproxy_namd::calculate().

301 {
302  return forceIdEnd;
303 }
AtomIDList::iterator forceIdEnd
Definition: GlobalMaster.h:175

◆ getGridObjIndexBegin()

IntList::const_iterator GlobalMaster::getGridObjIndexBegin ( )
protected

Definition at line 258 of file GlobalMaster.C.

References gridObjIndexBegin.

Referenced by colvarproxy_namd::calculate().

258  {
259  return gridObjIndexBegin;
260 }
IntList::iterator gridObjIndexBegin
Definition: GlobalMaster.h:163

◆ getGridObjIndexEnd()

IntList::const_iterator GlobalMaster::getGridObjIndexEnd ( )
protected

Definition at line 262 of file GlobalMaster.C.

References gridObjIndexEnd.

Referenced by colvarproxy_namd::calculate().

262  {
263  return gridObjIndexEnd;
264 }
IntList::iterator gridObjIndexEnd
Definition: GlobalMaster.h:164

◆ getGridObjValueBegin()

BigRealList::const_iterator GlobalMaster::getGridObjValueBegin ( )
protected

Definition at line 266 of file GlobalMaster.C.

References gridObjValueBegin.

Referenced by colvarproxy_namd::calculate().

266  {
267  return gridObjValueBegin;
268 }
BigRealList::iterator gridObjValueBegin
Definition: GlobalMaster.h:165

◆ getGridObjValueEnd()

BigRealList::const_iterator GlobalMaster::getGridObjValueEnd ( )
protected

Definition at line 270 of file GlobalMaster.C.

References gridObjValueEnd.

Referenced by colvarproxy_namd::calculate().

270  {
271  return gridObjValueEnd;
272 }
BigRealList::iterator gridObjValueEnd
Definition: GlobalMaster.h:166

◆ getGroupMassBegin()

BigRealList::const_iterator GlobalMaster::getGroupMassBegin ( )
protected

Definition at line 274 of file GlobalMaster.C.

References groupMassBegin.

Referenced by GlobalMasterTcl::calculate().

275 {
276  return groupMassBegin;
277 }
BigRealList::iterator groupMassBegin
Definition: GlobalMaster.h:159

◆ getGroupMassEnd()

BigRealList::const_iterator GlobalMaster::getGroupMassEnd ( )
protected

Definition at line 279 of file GlobalMaster.C.

References groupMassEnd.

Referenced by GlobalMasterTcl::calculate().

279  {
280  return groupMassEnd;
281 }
BigRealList::iterator groupMassEnd
Definition: GlobalMaster.h:160

◆ getGroupPositionBegin()

PositionList::const_iterator GlobalMaster::getGroupPositionBegin ( )
protected

Definition at line 242 of file GlobalMaster.C.

References groupPositionBegin.

Referenced by colvarproxy_namd::calculate().

242  {
243  return groupPositionBegin;
244 }
PositionList::iterator groupPositionBegin
Definition: GlobalMaster.h:157

◆ getGroupPositionEnd()

PositionList::const_iterator GlobalMaster::getGroupPositionEnd ( )
protected

Definition at line 246 of file GlobalMaster.C.

References groupPositionEnd.

Referenced by colvarproxy_namd::calculate().

246  {
247  return groupPositionEnd;
248 }
PositionList::iterator groupPositionEnd
Definition: GlobalMaster.h:158

◆ getGroupTotalForceBegin()

ForceList::const_iterator GlobalMaster::getGroupTotalForceBegin ( )
protected

Definition at line 250 of file GlobalMaster.C.

References groupTotalForceBegin.

Referenced by colvarproxy_namd::calculate().

250  {
251  return groupTotalForceBegin;
252 }
ForceList::iterator groupTotalForceBegin
Definition: GlobalMaster.h:161

◆ getGroupTotalForceEnd()

ForceList::const_iterator GlobalMaster::getGroupTotalForceEnd ( )
protected

Definition at line 254 of file GlobalMaster.C.

References groupTotalForceEnd.

Referenced by colvarproxy_namd::calculate().

254  {
255  return groupTotalForceEnd;
256 }
ForceList::iterator groupTotalForceEnd
Definition: GlobalMaster.h:162

◆ getLastAtomsForcedBegin()

AtomIDList::const_iterator GlobalMaster::getLastAtomsForcedBegin ( )
protected

Definition at line 283 of file GlobalMaster.C.

References lastAtomsForcedBegin.

283  {
284  return lastAtomsForcedBegin;
285 }
AtomIDList::iterator lastAtomsForcedBegin
Definition: GlobalMaster.h:169

◆ getLastAtomsForcedEnd()

AtomIDList::const_iterator GlobalMaster::getLastAtomsForcedEnd ( )
protected

Definition at line 287 of file GlobalMaster.C.

References lastAtomsForcedEnd.

287  {
288  return lastAtomsForcedEnd;
289 }
AtomIDList::iterator lastAtomsForcedEnd
Definition: GlobalMaster.h:171

◆ getLastForcesBegin()

ForceList::const_iterator GlobalMaster::getLastForcesBegin ( )
protected

Definition at line 291 of file GlobalMaster.C.

References lastForcesBegin.

291  {
292  return lastForcesBegin;
293 }
ForceList::iterator lastForcesBegin
Definition: GlobalMaster.h:170

◆ getTotalForce()

ForceList::const_iterator GlobalMaster::getTotalForce ( )
protected

Definition at line 305 of file GlobalMaster.C.

References totalForceBegin.

Referenced by colvarproxy_namd::calculate().

306 {
307  return totalForceBegin;
308 }
ForceList::iterator totalForceBegin
Definition: GlobalMaster.h:176

◆ gridObjForces()

const BigRealList & GlobalMaster::gridObjForces ( )

Definition at line 185 of file GlobalMaster.C.

References gridobjForces.

185  {
186  return gridobjForces;
187 }
BigRealList gridobjForces
Definition: GlobalMaster.h:193

◆ groupForces()

const ForceList & GlobalMaster::groupForces ( )

Definition at line 181 of file GlobalMaster.C.

References grpForces.

181  {
182  return grpForces;
183 }
ForceList grpForces
Definition: GlobalMaster.h:189

◆ modifyAppliedForces()

ForceList & GlobalMaster::modifyAppliedForces ( )
protected

◆ modifyForcedAtoms()

AtomIDList & GlobalMaster::modifyForcedAtoms ( )
protected

◆ modifyGridObjForces()

BigRealList & GlobalMaster::modifyGridObjForces ( )
protected

Definition at line 219 of file GlobalMaster.C.

References appForcesChanged, and gridobjForces.

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

219  {
220  appForcesChanged = true;
221  return gridobjForces;
222 }
BigRealList gridobjForces
Definition: GlobalMaster.h:193
bool appForcesChanged
Definition: GlobalMaster.h:183

◆ modifyGroupForces()

ForceList & GlobalMaster::modifyGroupForces ( )
protected

Definition at line 207 of file GlobalMaster.C.

References appForcesChanged, and grpForces.

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

207  {
208  // XXX should we mark something else here?
209  appForcesChanged = true;
210  return grpForces;
211 }
ForceList grpForces
Definition: GlobalMaster.h:189
bool appForcesChanged
Definition: GlobalMaster.h:183

◆ modifyRequestedAtoms()

AtomIDList & GlobalMaster::modifyRequestedAtoms ( )
protected

Definition at line 167 of file GlobalMaster.C.

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

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

167  {
168  reqAtomsChanged = true;
169  DebugM(3,"modifyRequestedAtoms()\n" << endi);
170  return reqAtoms;
171 }
AtomIDList reqAtoms
Definition: GlobalMaster.h:181
#define DebugM(x, y)
Definition: Debug.h:75
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
bool reqAtomsChanged
Definition: GlobalMaster.h:180

◆ modifyRequestedGridObjects()

IntList & GlobalMaster::modifyRequestedGridObjects ( )
protected

Definition at line 213 of file GlobalMaster.C.

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

Referenced by colvarproxy_namd::init_volmap_by_id(), colvarproxy_namd::init_volmap_by_name(), and colvarproxy_namd::reset().

213  {
214  reqGridObjsChanged = true;
215  DebugM(3,"modifyRequestedGridObjects()\n" << endi);
216  return reqGridObjs;
217 }
#define DebugM(x, y)
Definition: Debug.h:75
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
bool reqGridObjsChanged
Definition: GlobalMaster.h:191
IntList reqGridObjs
Definition: GlobalMaster.h:192

◆ modifyRequestedGroups()

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

Definition at line 224 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().

224  {
225  reqGroupsChanged = true;
226  DebugM(1,"Groups have changed.\n");
227  return reqGroups;
228 }
ResizeArray< AtomIDList > reqGroups
Definition: GlobalMaster.h:188
#define DebugM(x, y)
Definition: Debug.h:75
bool reqGroupsChanged
Definition: GlobalMaster.h:187

◆ processData()

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 19 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, submitReduction(), and totalForceBegin.

37  {
38  atomIdBegin = a_i;
39  atomIdEnd = a_e;
40  atomPositionBegin = p_i;
41  groupPositionBegin = g_i;
42  groupPositionEnd = g_e;
43  groupMassBegin = gm_i;
44  groupMassEnd = gm_e;
45  groupTotalForceBegin = gtf_i;
46  groupTotalForceEnd = gtf_e;
47  gridObjIndexBegin = goi_i;
48  gridObjIndexEnd = goi_e;
49  gridObjValueBegin = gov_i;
50  gridObjValueEnd = gov_e;
51  lastAtomsForcedBegin = last_atoms_forced_i;
52  lastAtomsForcedEnd = last_atoms_forced_e;
53  lastForcesBegin = last_forces_i;
54  forceIdBegin = forceid_i;
55  forceIdEnd = forceid_e;
56  totalForceBegin = totalforce_i;
57 
58  calculate();
60 
61  /* check to make sure the force arrays still match */
62  if(appForcesChanged) {
63  check();
64  }
65 }
BigRealList::iterator gridObjValueEnd
Definition: GlobalMaster.h:166
IntList::iterator gridObjIndexBegin
Definition: GlobalMaster.h:163
void submitReduction()
Definition: GlobalMaster.C:137
ForceList::iterator totalForceBegin
Definition: GlobalMaster.h:176
AtomIDList::iterator lastAtomsForcedEnd
Definition: GlobalMaster.h:171
ForceList::iterator lastForcesBegin
Definition: GlobalMaster.h:170
AtomIDList::iterator lastAtomsForcedBegin
Definition: GlobalMaster.h:169
virtual void calculate()
Definition: GlobalMaster.C:84
PositionList::iterator atomPositionBegin
Definition: GlobalMaster.h:156
ForceList::iterator groupTotalForceEnd
Definition: GlobalMaster.h:162
BigRealList::iterator gridObjValueBegin
Definition: GlobalMaster.h:165
AtomIDList::iterator atomIdEnd
Definition: GlobalMaster.h:155
BigRealList::iterator groupMassBegin
Definition: GlobalMaster.h:159
IntList::iterator gridObjIndexEnd
Definition: GlobalMaster.h:164
AtomIDList::iterator atomIdBegin
Definition: GlobalMaster.h:154
BigRealList::iterator groupMassEnd
Definition: GlobalMaster.h:160
PositionList::iterator groupPositionBegin
Definition: GlobalMaster.h:157
bool appForcesChanged
Definition: GlobalMaster.h:183
AtomIDList::iterator forceIdBegin
Definition: GlobalMaster.h:174
AtomIDList::iterator forceIdEnd
Definition: GlobalMaster.h:175
void check() const
Definition: GlobalMaster.C:67
ForceList::iterator groupTotalForceBegin
Definition: GlobalMaster.h:161
PositionList::iterator groupPositionEnd
Definition: GlobalMaster.h:158

◆ requestedAtoms()

const AtomIDList & GlobalMaster::requestedAtoms ( )

Definition at line 163 of file GlobalMaster.C.

References reqAtoms.

Referenced by GlobalMasterTest::calculate().

163  {
164  return reqAtoms;
165 }
AtomIDList reqAtoms
Definition: GlobalMaster.h:181

◆ requestedGridObjs()

const IntList & GlobalMaster::requestedGridObjs ( )

Definition at line 193 of file GlobalMaster.C.

References reqGridObjs.

Referenced by colvarproxy_namd::calculate().

193  {
194  return reqGridObjs;
195 }
IntList reqGridObjs
Definition: GlobalMaster.h:192

◆ requestedGroups()

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

Definition at line 189 of file GlobalMaster.C.

References reqGroups.

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

189  {
190  return reqGroups;
191 }
ResizeArray< AtomIDList > reqGroups
Definition: GlobalMaster.h:188

◆ requestedTotalForces()

bool GlobalMaster::requestedTotalForces ( )
inline

Definition at line 71 of file GlobalMaster.h.

References totalForceRequested.

71 { return totalForceRequested; }
bool totalForceRequested
Definition: GlobalMaster.h:134

◆ requestTotalForce()

void GlobalMaster::requestTotalForce ( bool  yesno = true)
inlineprotected

◆ setLattice()

void GlobalMaster::setLattice ( const Lattice lat)
inline

Definition at line 79 of file GlobalMaster.h.

References lattice.

Referenced by GlobalMasterServer::addClient().

79 { lattice = lat; }
const Lattice * lattice
Definition: GlobalMaster.h:147

◆ submitReduction()

void GlobalMaster::submitReduction ( )
protected

Definition at line 137 of file GlobalMaster.C.

References getCurrentReduction(), and SubmitReduction::submit().

Referenced by processData().

137  {
139  r->submit();
140 }
virtual void submit(void)=0
SubmitReduction * getCurrentReduction()
Definition: GlobalMaster.C:127

Member Data Documentation

◆ appForces

ForceList GlobalMaster::appForces
protected

Definition at line 185 of file GlobalMaster.h.

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

◆ appForcesChanged

bool GlobalMaster::appForcesChanged
protected

◆ atomIdBegin

AtomIDList::iterator GlobalMaster::atomIdBegin
protected

Definition at line 154 of file GlobalMaster.h.

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

◆ atomIdEnd

AtomIDList::iterator GlobalMaster::atomIdEnd
protected

Definition at line 155 of file GlobalMaster.h.

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

◆ atomPositionBegin

PositionList::iterator GlobalMaster::atomPositionBegin
protected

Definition at line 156 of file GlobalMaster.h.

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

◆ fAtoms

AtomIDList GlobalMaster::fAtoms
protected

Definition at line 184 of file GlobalMaster.h.

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

◆ forceIdBegin

AtomIDList::iterator GlobalMaster::forceIdBegin
protected

Definition at line 174 of file GlobalMaster.h.

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

◆ forceIdEnd

AtomIDList::iterator GlobalMaster::forceIdEnd
protected

Definition at line 175 of file GlobalMaster.h.

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

◆ globalMasterStep

int GlobalMaster::globalMasterStep

Definition at line 57 of file GlobalMaster.h.

◆ gridobjForces

BigRealList GlobalMaster::gridobjForces
protected

Definition at line 193 of file GlobalMaster.h.

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

◆ gridObjIndexBegin

IntList::iterator GlobalMaster::gridObjIndexBegin
protected

Definition at line 163 of file GlobalMaster.h.

Referenced by getGridObjIndexBegin(), and processData().

◆ gridObjIndexEnd

IntList::iterator GlobalMaster::gridObjIndexEnd
protected

Definition at line 164 of file GlobalMaster.h.

Referenced by getGridObjIndexEnd(), and processData().

◆ gridObjValueBegin

BigRealList::iterator GlobalMaster::gridObjValueBegin
protected

Definition at line 165 of file GlobalMaster.h.

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

◆ gridObjValueEnd

BigRealList::iterator GlobalMaster::gridObjValueEnd
protected

Definition at line 166 of file GlobalMaster.h.

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

◆ groupMassBegin

BigRealList::iterator GlobalMaster::groupMassBegin
protected

Definition at line 159 of file GlobalMaster.h.

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

◆ groupMassEnd

BigRealList::iterator GlobalMaster::groupMassEnd
protected

Definition at line 160 of file GlobalMaster.h.

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

◆ groupPositionBegin

PositionList::iterator GlobalMaster::groupPositionBegin
protected

Definition at line 157 of file GlobalMaster.h.

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

◆ groupPositionEnd

PositionList::iterator GlobalMaster::groupPositionEnd
protected

Definition at line 158 of file GlobalMaster.h.

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

◆ groupTotalForceBegin

ForceList::iterator GlobalMaster::groupTotalForceBegin
protected

Definition at line 161 of file GlobalMaster.h.

Referenced by getGroupTotalForceBegin(), and processData().

◆ groupTotalForceEnd

ForceList::iterator GlobalMaster::groupTotalForceEnd
protected

Definition at line 162 of file GlobalMaster.h.

Referenced by getGroupTotalForceEnd(), and processData().

◆ grpForces

ForceList GlobalMaster::grpForces
protected

Definition at line 189 of file GlobalMaster.h.

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

◆ lastAtomsForcedBegin

AtomIDList::iterator GlobalMaster::lastAtomsForcedBegin
protected

Definition at line 169 of file GlobalMaster.h.

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

◆ lastAtomsForcedEnd

AtomIDList::iterator GlobalMaster::lastAtomsForcedEnd
protected

Definition at line 171 of file GlobalMaster.h.

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

◆ lastForcesBegin

ForceList::iterator GlobalMaster::lastForcesBegin
protected

Definition at line 170 of file GlobalMaster.h.

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

◆ lattice

const Lattice* GlobalMaster::lattice
protected

◆ old_num_groups_requested

int GlobalMaster::old_num_groups_requested

Definition at line 58 of file GlobalMaster.h.

Referenced by GlobalMaster().

◆ reqAtoms

AtomIDList GlobalMaster::reqAtoms
protected

Definition at line 181 of file GlobalMaster.h.

Referenced by modifyRequestedAtoms(), and requestedAtoms().

◆ reqAtomsChanged

bool GlobalMaster::reqAtomsChanged
protected

Definition at line 180 of file GlobalMaster.h.

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

◆ reqGridObjs

IntList GlobalMaster::reqGridObjs
protected

Definition at line 192 of file GlobalMaster.h.

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

◆ reqGridObjsChanged

bool GlobalMaster::reqGridObjsChanged
protected

Definition at line 191 of file GlobalMaster.h.

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

◆ reqGroups

ResizeArray<AtomIDList> GlobalMaster::reqGroups
protected

Definition at line 188 of file GlobalMaster.h.

Referenced by modifyRequestedGroups(), and requestedGroups().

◆ reqGroupsChanged

bool GlobalMaster::reqGroupsChanged
protected

Definition at line 187 of file GlobalMaster.h.

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

◆ step

int GlobalMaster::step

◆ totalForceBegin

ForceList::iterator GlobalMaster::totalForceBegin
protected

Definition at line 176 of file GlobalMaster.h.

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

◆ totalForceRequested

bool GlobalMaster::totalForceRequested
protected

Definition at line 134 of file GlobalMaster.h.

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


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