ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimInfo.hpp
Revision: 1849
Committed: Wed Feb 20 13:52:51 2013 UTC (12 years, 2 months ago) by gezelter
File size: 23292 byte(s)
Log Message:
Performance increases for cubic spline.
Bug fix for electric field in parallel.
Cleaned up globals.
Started adding infrastructure for long range corrections.

File Contents

# User Rev Content
1 gezelter 507 /*
2 gezelter 246 * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3     *
4     * The University of Notre Dame grants you ("Licensee") a
5     * non-exclusive, royalty free, license to use, modify and
6     * redistribute this software in source and binary code form, provided
7     * that the following conditions are met:
8     *
9 gezelter 1390 * 1. Redistributions of source code must retain the above copyright
10 gezelter 246 * notice, this list of conditions and the following disclaimer.
11     *
12 gezelter 1390 * 2. Redistributions in binary form must reproduce the above copyright
13 gezelter 246 * notice, this list of conditions and the following disclaimer in the
14     * documentation and/or other materials provided with the
15     * distribution.
16     *
17     * This software is provided "AS IS," without a warranty of any
18     * kind. All express or implied conditions, representations and
19     * warranties, including any implied warranty of merchantability,
20     * fitness for a particular purpose or non-infringement, are hereby
21     * excluded. The University of Notre Dame and its licensors shall not
22     * be liable for any damages suffered by licensee as a result of
23     * using, modifying or distributing the software or its
24     * derivatives. In no event will the University of Notre Dame or its
25     * licensors be liable for any lost revenue, profit or data, or for
26     * direct, indirect, special, consequential, incidental or punitive
27     * damages, however caused and regardless of the theory of liability,
28     * arising out of the use of or inability to use software, even if the
29     * University of Notre Dame has been advised of the possibility of
30     * such damages.
31 gezelter 1390 *
32     * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
33     * research, please cite the appropriate papers when you publish your
34     * work. Good starting points are:
35     *
36     * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
37     * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
38     * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).
39 gezelter 1665 * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010).
40     * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41 gezelter 246 */
42    
43     /**
44     * @file SimInfo.hpp
45     * @author tlin
46     * @date 11/02/2004
47     * @version 1.0
48     */
49 gezelter 2
50 gezelter 246 #ifndef BRAINS_SIMMODEL_HPP
51     #define BRAINS_SIMMODEL_HPP
52    
53     #include <iostream>
54     #include <set>
55     #include <utility>
56 gezelter 2 #include <vector>
57    
58 gezelter 1287 #include "brains/PairList.hpp"
59 gezelter 246 #include "io/Globals.hpp"
60     #include "math/Vector3.hpp"
61 chuckv 555 #include "math/SquareMatrix3.hpp"
62 gezelter 246 #include "types/MoleculeStamp.hpp"
63 gezelter 1725 #include "brains/ForceField.hpp"
64 gezelter 246 #include "utils/PropertyMap.hpp"
65     #include "utils/LocalIndexManager.hpp"
66 gezelter 1530 #include "nonbonded/SwitchingFunction.hpp"
67 tim 316
68 gezelter 1528 using namespace std;
69 gezelter 1390 namespace OpenMD{
70 gezelter 1553 //forward declaration
71 gezelter 507 class SnapshotManager;
72     class Molecule;
73     class SelectionManager;
74 tim 1024 class StuntDouble;
75 gezelter 1528
76 gezelter 507 /**
77 gezelter 1528 * @class SimInfo SimInfo.hpp "brains/SimInfo.hpp"
78     *
79     * @brief One of the heavy-weight classes of OpenMD, SimInfo
80     * maintains objects and variables relating to the current
81     * simulation. This includes the master list of Molecules. The
82     * Molecule class maintains all of the concrete objects (Atoms,
83     * Bond, Bend, Torsions, Inversions, RigidBodies, CutoffGroups,
84     * Constraints). In both the single and parallel versions, Atoms and
85     * RigidBodies have both global and local indices.
86     */
87 gezelter 507 class SimInfo {
88     public:
89 gezelter 1528 typedef map<int, Molecule*>::iterator MoleculeIterator;
90    
91 gezelter 507 /**
92     * Constructor of SimInfo
93 gezelter 1528 *
94 gezelter 1808 * @param ff pointer to a concrete ForceField instance
95 gezelter 1528 *
96 gezelter 1808 * @param simParams pointer to the simulation parameters in a Globals object
97 gezelter 507 */
98 tim 770 SimInfo(ForceField* ff, Globals* simParams);
99 gezelter 507 virtual ~SimInfo();
100 gezelter 2
101 gezelter 507 /**
102     * Adds a molecule
103 gezelter 1528 *
104     * @return return true if adding successfully, return false if the
105     * molecule is already in SimInfo
106     *
107 gezelter 1808 * @param mol Molecule to be added
108 gezelter 507 */
109     bool addMolecule(Molecule* mol);
110 gezelter 2
111 gezelter 507 /**
112     * Removes a molecule from SimInfo
113 gezelter 1528 *
114     * @return true if removing successfully, return false if molecule
115     * is not in this SimInfo
116 gezelter 507 */
117     bool removeMolecule(Molecule* mol);
118 gezelter 2
119 gezelter 507 /** Returns the total number of molecules in the system. */
120     int getNGlobalMolecules() {
121     return nGlobalMols_;
122     }
123 gezelter 2
124 gezelter 507 /** Returns the total number of atoms in the system. */
125     int getNGlobalAtoms() {
126     return nGlobalAtoms_;
127     }
128 gezelter 2
129 gezelter 507 /** Returns the total number of cutoff groups in the system. */
130     int getNGlobalCutoffGroups() {
131     return nGlobalCutoffGroups_;
132     }
133 gezelter 2
134 gezelter 507 /**
135 gezelter 1528 * Returns the total number of integrable objects (total number of
136     * rigid bodies plus the total number of atoms which do not belong
137     * to the rigid bodies) in the system
138 gezelter 507 */
139     int getNGlobalIntegrableObjects() {
140     return nGlobalIntegrableObjects_;
141     }
142 gezelter 2
143 gezelter 507 /**
144 gezelter 1528 * Returns the total number of integrable objects (total number of
145     * rigid bodies plus the total number of atoms which do not belong
146     * to the rigid bodies) in the system
147 gezelter 507 */
148     int getNGlobalRigidBodies() {
149     return nGlobalRigidBodies_;
150     }
151 gezelter 2
152 gezelter 507 int getNGlobalConstraints();
153     /**
154     * Returns the number of local molecules.
155     * @return the number of local molecules
156     */
157     int getNMolecules() {
158     return molecules_.size();
159     }
160 gezelter 2
161 gezelter 507 /** Returns the number of local atoms */
162     unsigned int getNAtoms() {
163     return nAtoms_;
164     }
165 gezelter 2
166 gezelter 1577 /** Returns the number of effective cutoff groups on local processor */
167     unsigned int getNLocalCutoffGroups();
168    
169 gezelter 507 /** Returns the number of local bonds */
170     unsigned int getNBonds(){
171     return nBonds_;
172     }
173 gezelter 2
174 gezelter 507 /** Returns the number of local bends */
175     unsigned int getNBends() {
176     return nBends_;
177     }
178 gezelter 2
179 gezelter 507 /** Returns the number of local torsions */
180     unsigned int getNTorsions() {
181     return nTorsions_;
182     }
183 gezelter 2
184 gezelter 1277 /** Returns the number of local torsions */
185     unsigned int getNInversions() {
186     return nInversions_;
187     }
188 gezelter 507 /** Returns the number of local rigid bodies */
189     unsigned int getNRigidBodies() {
190     return nRigidBodies_;
191     }
192 gezelter 2
193 gezelter 507 /** Returns the number of local integrable objects */
194     unsigned int getNIntegrableObjects() {
195     return nIntegrableObjects_;
196     }
197 gezelter 2
198 gezelter 507 /** Returns the number of local cutoff groups */
199     unsigned int getNCutoffGroups() {
200     return nCutoffGroups_;
201     }
202 gezelter 2
203 gezelter 507 /** Returns the total number of constraints in this SimInfo */
204     unsigned int getNConstraints() {
205     return nConstraints_;
206     }
207 gezelter 246
208 gezelter 507 /**
209     * Returns the first molecule in this SimInfo and intialize the iterator.
210     * @return the first molecule, return NULL if there is not molecule in this SimInfo
211     * @param i the iterator of molecule array (user shouldn't change it)
212     */
213     Molecule* beginMolecule(MoleculeIterator& i);
214 gezelter 2
215 gezelter 507 /**
216     * Returns the next avaliable Molecule based on the iterator.
217     * @return the next avaliable molecule, return NULL if reaching the end of the array
218     * @param i the iterator of molecule array
219     */
220     Molecule* nextMolecule(MoleculeIterator& i);
221 gezelter 2
222 gezelter 1715 /** Returns the total number of fluctuating charges that are present */
223     int getNFluctuatingCharges() {
224     return nGlobalFluctuatingCharges_;
225     }
226    
227 gezelter 507 /** Returns the number of degrees of freedom */
228     int getNdf() {
229 gezelter 945 return ndf_ - getFdf();
230 gezelter 507 }
231 gezelter 2
232 gezelter 1744 /** Returns the number of degrees of freedom (LOCAL) */
233     int getNdfLocal() {
234     return ndfLocal_;
235     }
236    
237 gezelter 507 /** Returns the number of raw degrees of freedom */
238     int getNdfRaw() {
239     return ndfRaw_;
240     }
241 gezelter 2
242 gezelter 507 /** Returns the number of translational degrees of freedom */
243     int getNdfTrans() {
244     return ndfTrans_;
245     }
246 gezelter 2
247 gezelter 945 /** sets the current number of frozen degrees of freedom */
248     void setFdf(int fdf) {
249     fdf_local = fdf;
250     }
251    
252     int getFdf();
253    
254 gezelter 1528 //getNZconstraint and setNZconstraint ruin the coherence of
255     //SimInfo class, need refactoring
256 gezelter 246
257 gezelter 507 /** Returns the total number of z-constraint molecules in the system */
258     int getNZconstraint() {
259     return nZconstraint_;
260     }
261 gezelter 2
262 gezelter 507 /**
263     * Sets the number of z-constraint molecules in the system.
264     */
265     void setNZconstraint(int nZconstraint) {
266     nZconstraint_ = nZconstraint;
267     }
268 gezelter 246
269 gezelter 507 /** Returns the snapshot manager. */
270     SnapshotManager* getSnapshotManager() {
271     return sman_;
272     }
273 gezelter 1838 /** Returns the storage layout (computed by SimCreator) */
274     int getStorageLayout() {
275     return storageLayout_;
276     }
277     /** Sets the storage layout (computed by SimCreator) */
278     void setStorageLayout(int sl) {
279     storageLayout_ = sl;
280     }
281    
282 gezelter 507 /** Sets the snapshot manager. */
283     void setSnapshotManager(SnapshotManager* sman);
284 gezelter 246
285 gezelter 507 /** Returns the force field */
286     ForceField* getForceField() {
287     return forceField_;
288     }
289 gezelter 2
290 gezelter 507 Globals* getSimParams() {
291     return simParams_;
292     }
293 gezelter 2
294 gezelter 507 void update();
295 gezelter 1535 /**
296 gezelter 1569 * Do final bookkeeping before Force managers need their data.
297 gezelter 1535 */
298 gezelter 1569 void prepareTopology();
299 gezelter 2
300 gezelter 1535
301 gezelter 507 /** Returns the local index manager */
302     LocalIndexManager* getLocalIndexManager() {
303     return &localIndexMan_;
304     }
305 gezelter 2
306 gezelter 507 int getMoleculeStampId(int globalIndex) {
307     //assert(globalIndex < molStampIds_.size())
308     return molStampIds_[globalIndex];
309     }
310 gezelter 2
311 gezelter 507 /** Returns the molecule stamp */
312     MoleculeStamp* getMoleculeStamp(int id) {
313     return moleculeStamps_[id];
314     }
315 gezelter 2
316 gezelter 507 /** Return the total number of the molecule stamps */
317     int getNMoleculeStamp() {
318     return moleculeStamps_.size();
319     }
320     /**
321     * Finds a molecule with a specified global index
322     * @return a pointer point to found molecule
323     * @param index
324     */
325     Molecule* getMoleculeByGlobalIndex(int index) {
326     MoleculeIterator i;
327     i = molecules_.find(index);
328 gezelter 2
329 gezelter 507 return i != molecules_.end() ? i->second : NULL;
330     }
331 gezelter 2
332 chuckv 1292 int getGlobalMolMembership(int id){
333     return globalMolMembership_[id];
334     }
335 gezelter 1549
336     /**
337     * returns a vector which maps the local atom index on this
338     * processor to the global atom index. With only one processor,
339     * these should be identical.
340     */
341     vector<int> getGlobalAtomIndices();
342    
343     /**
344     * returns a vector which maps the local cutoff group index on
345     * this processor to the global cutoff group index. With only one
346     * processor, these should be identical.
347     */
348     vector<int> getGlobalGroupIndices();
349 gezelter 1569
350 gezelter 246
351 gezelter 1528 string getFinalConfigFileName() {
352 gezelter 507 return finalConfigFileName_;
353     }
354 tim 1024
355 gezelter 1528 void setFinalConfigFileName(const string& fileName) {
356 gezelter 507 finalConfigFileName_ = fileName;
357     }
358 gezelter 2
359 gezelter 1528 string getRawMetaData() {
360 tim 1024 return rawMetaData_;
361     }
362 gezelter 1528 void setRawMetaData(const string& rawMetaData) {
363 tim 1024 rawMetaData_ = rawMetaData;
364     }
365    
366 gezelter 1528 string getDumpFileName() {
367 gezelter 507 return dumpFileName_;
368     }
369 gezelter 246
370 gezelter 1528 void setDumpFileName(const string& fileName) {
371 gezelter 507 dumpFileName_ = fileName;
372     }
373 gezelter 2
374 gezelter 1528 string getStatFileName() {
375 gezelter 507 return statFileName_;
376     }
377 gezelter 246
378 gezelter 1528 void setStatFileName(const string& fileName) {
379 gezelter 507 statFileName_ = fileName;
380     }
381 chrisfen 417
382 gezelter 1528 string getRestFileName() {
383 gezelter 507 return restFileName_;
384     }
385 chrisfen 417
386 gezelter 1528 void setRestFileName(const string& fileName) {
387 gezelter 507 restFileName_ = fileName;
388     }
389 gezelter 2
390 gezelter 507 /**
391     * Sets GlobalGroupMembership
392     */
393 gezelter 1848 void setGlobalGroupMembership(const vector<int>& ggm) {
394     assert(ggm.size() == static_cast<size_t>(nGlobalAtoms_));
395     globalGroupMembership_ = ggm;
396 gezelter 507 }
397 gezelter 2
398 gezelter 507 /**
399     * Sets GlobalMolMembership
400     */
401 gezelter 1848 void setGlobalMolMembership(const vector<int>& gmm) {
402     assert(gmm.size() == (static_cast<size_t>(nGlobalAtoms_ +
403     nGlobalRigidBodies_)));
404     globalMolMembership_ = gmm;
405 gezelter 507 }
406 gezelter 246
407    
408 gezelter 1569 bool isTopologyDone() {
409     return topologyDone_;
410 gezelter 507 }
411 gezelter 246
412 chrisfen 998 bool getCalcBoxDipole() {
413     return calcBoxDipole_;
414     }
415    
416 gezelter 1126 bool getUseAtomicVirial() {
417     return useAtomicVirial_;
418     }
419    
420 gezelter 507 /**
421     * Adds property into property map
422     * @param genData GenericData to be added into PropertyMap
423     */
424     void addProperty(GenericData* genData);
425 gezelter 246
426 gezelter 507 /**
427     * Removes property from PropertyMap by name
428     * @param propName the name of property to be removed
429     */
430 gezelter 1528 void removeProperty(const string& propName);
431 gezelter 246
432 gezelter 507 /**
433     * clear all of the properties
434     */
435     void clearProperties();
436 gezelter 246
437 gezelter 507 /**
438     * Returns all names of properties
439     * @return all names of properties
440     */
441 gezelter 1528 vector<string> getPropertyNames();
442 gezelter 246
443 gezelter 507 /**
444     * Returns all of the properties in PropertyMap
445     * @return all of the properties in PropertyMap
446     */
447 gezelter 1528 vector<GenericData*> getProperties();
448 gezelter 246
449 gezelter 507 /**
450     * Returns property
451     * @param propName name of property
452     * @return a pointer point to property with propName. If no property named propName
453     * exists, return NULL
454     */
455 gezelter 1528 GenericData* getPropertyByName(const string& propName);
456 gezelter 246
457 gezelter 507 /**
458 gezelter 1287 * add all special interaction pairs (including excluded
459     * interactions) in a molecule into the appropriate lists.
460 gezelter 507 */
461 gezelter 1287 void addInteractionPairs(Molecule* mol);
462 gezelter 246
463 gezelter 507 /**
464 gezelter 1287 * remove all special interaction pairs which belong to a molecule
465     * from the appropriate lists.
466 gezelter 507 */
467 gezelter 1287 void removeInteractionPairs(Molecule* mol);
468 gezelter 246
469 gezelter 1528 /** Returns the set of atom types present in this simulation */
470     set<AtomType*> getSimulatedAtomTypes();
471 gezelter 1849
472     /** Returns the global count of atoms of a particular type */
473     int getGlobalCountOfType(AtomType* atype);
474 tim 292
475 gezelter 1528 friend ostream& operator <<(ostream& o, SimInfo& info);
476 tim 326
477 tim 963 void getCutoff(RealType& rcut, RealType& rsw);
478 gezelter 246
479 gezelter 507 private:
480 gezelter 246
481 gezelter 1530 /** fill up the simtype struct and other simulation-related variables */
482     void setupSimVariables();
483 gezelter 246
484    
485 chrisfen 998 /** Determine if we need to accumulate the simulation box dipole */
486     void setupAccumulateBoxDipole();
487    
488 gezelter 507 /** Calculates the number of degress of freedom in the whole system */
489     void calcNdf();
490     void calcNdfRaw();
491     void calcNdfTrans();
492 gezelter 246
493 gezelter 507 /**
494 gezelter 1528 * Adds molecule stamp and the total number of the molecule with
495     * same molecule stamp in the whole system.
496 gezelter 507 */
497     void addMoleculeStamp(MoleculeStamp* molStamp, int nmol);
498 gezelter 246
499 gezelter 1528 // Other classes holdingn important information
500     ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */
501     Globals* simParams_; /**< provides access to simulation parameters set by user */
502 gezelter 246
503 gezelter 1528 /// Counts of local objects
504 gezelter 1277 int nAtoms_; /**< number of atoms in local processor */
505     int nBonds_; /**< number of bonds in local processor */
506     int nBends_; /**< number of bends in local processor */
507     int nTorsions_; /**< number of torsions in local processor */
508     int nInversions_; /**< number of inversions in local processor */
509     int nRigidBodies_; /**< number of rigid bodies in local processor */
510     int nIntegrableObjects_; /**< number of integrable objects in local processor */
511     int nCutoffGroups_; /**< number of cutoff groups in local processor */
512     int nConstraints_; /**< number of constraints in local processors */
513 gezelter 1715 int nFluctuatingCharges_; /**< number of fluctuating charges in local processor */
514 gezelter 1528
515     /// Counts of global objects
516     int nGlobalMols_; /**< number of molecules in the system (GLOBAL) */
517     int nGlobalAtoms_; /**< number of atoms in the system (GLOBAL) */
518     int nGlobalCutoffGroups_; /**< number of cutoff groups in this system (GLOBAL) */
519     int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
520     int nGlobalRigidBodies_; /**< number of rigid bodies in this system (GLOBAL) */
521 gezelter 1715 int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */
522    
523 gezelter 1528
524     /// Degress of freedom
525     int ndf_; /**< number of degress of freedom (excludes constraints) (LOCAL) */
526 gezelter 1744 int ndfLocal_; /**< number of degrees of freedom (LOCAL, excludes constraints) */
527 gezelter 1528 int fdf_local; /**< number of frozen degrees of freedom (LOCAL) */
528     int fdf_; /**< number of frozen degrees of freedom (GLOBAL) */
529     int ndfRaw_; /**< number of degress of freedom (includes constraints), (LOCAL) */
530     int ndfTrans_; /**< number of translation degress of freedom, (LOCAL) */
531     int nZconstraint_; /**< number of z-constraint molecules (GLOBAL) */
532 gezelter 246
533 gezelter 1528 /// logicals
534     bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */
535     bool usesDirectionalAtoms_; /**< are there atoms with position AND orientation? */
536     bool usesMetallicAtoms_; /**< are there transition metal atoms? */
537     bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */
538 gezelter 1715 bool usesFluctuatingCharges_; /**< are there fluctuating charges? */
539 gezelter 1528 bool usesAtomicVirial_; /**< are we computing atomic virials? */
540     bool requiresPrepair_; /**< does this simulation require a pre-pair loop? */
541     bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
542     bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
543 gezelter 246
544 gezelter 1535 public:
545     bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
546     bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
547 gezelter 1715 bool usesFluctuatingCharges() { return usesFluctuatingCharges_; }
548 gezelter 1546 bool usesAtomicVirial() { return usesAtomicVirial_; }
549     bool requiresPrepair() { return requiresPrepair_; }
550     bool requiresSkipCorrection() { return requiresSkipCorrection_;}
551     bool requiresSelfCorrection() { return requiresSelfCorrection_;}
552 gezelter 1535
553     private:
554 gezelter 1528 /// Data structures holding primary simulation objects
555     map<int, Molecule*> molecules_; /**< map holding pointers to LOCAL molecules */
556 gezelter 1535
557 gezelter 1528 /// Stamps are templates for objects that are then used to create
558     /// groups of objects. For example, a molecule stamp contains
559     /// information on how to build that molecule (i.e. the topology,
560     /// the atoms, the bonds, etc.) Once the system is built, the
561     /// stamps are no longer useful.
562     vector<int> molStampIds_; /**< stamp id for molecules in the system */
563     vector<MoleculeStamp*> moleculeStamps_; /**< molecule stamps array */
564    
565     /**
566     * A vector that maps between the global index of an atom, and the
567     * global index of cutoff group the atom belong to. It is filled
568     * by SimCreator once and only once, since it never changed during
569     * the simulation. It should be nGlobalAtoms_ in size.
570     */
571     vector<int> globalGroupMembership_;
572 gezelter 1547 public:
573     vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
574     private:
575 gezelter 1528
576     /**
577     * A vector that maps between the global index of an atom and the
578     * global index of the molecule the atom belongs to. It is filled
579     * by SimCreator once and only once, since it is never changed
580     * during the simulation. It shoudl be nGlobalAtoms_ in size.
581     */
582 gezelter 1544 vector<int> globalMolMembership_;
583    
584     /**
585     * A vector that maps between the local index of an atom and the
586     * index of the AtomType.
587     */
588     vector<int> identArray_;
589 gezelter 1545 public:
590 gezelter 1544 vector<int> getIdentArray() { return identArray_; }
591 gezelter 1545 private:
592 gezelter 1569
593     /**
594     * A vector which contains the fractional contribution of an
595     * atom's mass to the total mass of the cutoffGroup that atom
596     * belongs to. In the case of single atom cutoff groups, the mass
597     * factor for that atom is 1. For massless atoms, the factor is
598     * also 1.
599     */
600     vector<RealType> massFactors_;
601     public:
602     vector<RealType> getMassFactors() { return massFactors_; }
603 gezelter 1570
604 gezelter 1587 PairList* getExcludedInteractions() { return &excludedInteractions_; }
605     PairList* getOneTwoInteractions() { return &oneTwoInteractions_; }
606     PairList* getOneThreeInteractions() { return &oneThreeInteractions_; }
607     PairList* getOneFourInteractions() { return &oneFourInteractions_; }
608 gezelter 1570
609 gezelter 1569 private:
610 gezelter 1528
611     /// lists to handle atoms needing special treatment in the non-bonded interactions
612     PairList excludedInteractions_; /**< atoms excluded from interacting with each other */
613     PairList oneTwoInteractions_; /**< atoms that are directly Bonded */
614     PairList oneThreeInteractions_; /**< atoms sharing a Bend */
615     PairList oneFourInteractions_; /**< atoms sharing a Torsion */
616    
617     PropertyMap properties_; /**< Generic Properties can be added */
618     SnapshotManager* sman_; /**< SnapshotManager (handles particle positions, etc.) */
619 gezelter 1838 int storageLayout_; /**< Bits to tell how much data to store on each object */
620 gezelter 1528
621 gezelter 507 /**
622 gezelter 1528 * The reason to have a local index manager is that when molecule
623     * is migrating to other processors, the atoms and the
624     * rigid-bodies will release their local indices to
625     * LocalIndexManager. Combining the information of molecule
626     * migrating to current processor, Migrator class can query the
627     * LocalIndexManager to make a efficient data moving plan.
628 gezelter 507 */
629     LocalIndexManager localIndexMan_;
630 gezelter 246
631 tim 1024 // unparsed MetaData block for storing in Dump and EOR files:
632 gezelter 1528 string rawMetaData_;
633 tim 1024
634 gezelter 1528 // file names
635     string finalConfigFileName_;
636     string dumpFileName_;
637     string statFileName_;
638     string restFileName_;
639 gezelter 246
640 gezelter 1569 bool topologyDone_; /** flag to indicate whether the topology has
641     been scanned and all the relevant
642     bookkeeping has been done*/
643 gezelter 1126
644     bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
645     the simulation box dipole moment */
646    
647     bool useAtomicVirial_; /**< flag to indicate whether or not we use
648     Atomic Virials to calculate the pressure */
649 gezelter 1528
650     public:
651     /**
652     * return an integral objects by its global index. In MPI
653     * version, if the StuntDouble with specified global index does
654     * not belong to local processor, a NULL will be return.
655 tim 1024 */
656 gezelter 1528 StuntDouble* getIOIndexToIntegrableObject(int index);
657     void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v);
658 tim 1024
659 gezelter 1528 private:
660     vector<StuntDouble*> IOIndexToIntegrableObject;
661    
662 gezelter 507 public:
663 gezelter 246
664 gezelter 507 /**
665     * Finds the processor where a molecule resides
666     * @return the id of the processor which contains the molecule
667     * @param globalIndex global Index of the molecule
668     */
669     int getMolToProc(int globalIndex) {
670     //assert(globalIndex < molToProcMap_.size());
671     return molToProcMap_[globalIndex];
672     }
673 gezelter 1528
674 gezelter 507 /**
675     * Set MolToProcMap array
676     */
677 gezelter 1528 void setMolToProcMap(const vector<int>& molToProcMap) {
678 gezelter 507 molToProcMap_ = molToProcMap;
679     }
680 gezelter 246
681 gezelter 507 private:
682 gezelter 246
683 gezelter 507 /**
684 gezelter 1241 * The size of molToProcMap_ is equal to total number of molecules
685     * in the system. It maps a molecule to the processor on which it
686     * resides. it is filled by SimCreator once and only once.
687 gezelter 507 */
688 gezelter 1528 vector<int> molToProcMap_;
689 tim 292
690 gezelter 507 };
691 gezelter 2
692 gezelter 1390 } //namespace OpenMD
693 gezelter 246 #endif //BRAINS_SIMMODEL_HPP
694 gezelter 2

Properties

Name Value
svn:keywords Author Id Revision Date