ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/brains/SimInfo.hpp
Revision: 2022
Committed: Fri Sep 26 22:22:28 2014 UTC (10 years, 7 months ago) by gezelter
File size: 24707 byte(s)
Log Message:
Added support for accumulateBoxQuadrupole flag

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 gezelter 1879 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
39 gezelter 1782 * [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 1782 #include "brains/ForceField.hpp"
64 gezelter 246 #include "utils/PropertyMap.hpp"
65     #include "utils/LocalIndexManager.hpp"
66 gezelter 1782 #include "nonbonded/SwitchingFunction.hpp"
67 tim 316
68 gezelter 1782 using namespace std;
69 gezelter 1390 namespace OpenMD{
70 gezelter 1782 //forward declaration
71 gezelter 507 class SnapshotManager;
72     class Molecule;
73     class SelectionManager;
74 tim 1024 class StuntDouble;
75 gezelter 1782
76 gezelter 507 /**
77 gezelter 1782 * @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 1782 typedef map<int, Molecule*>::iterator MoleculeIterator;
90    
91 gezelter 507 /**
92     * Constructor of SimInfo
93 gezelter 1782 *
94 gezelter 1879 * @param ff pointer to a concrete ForceField instance
95 gezelter 1782 *
96 gezelter 1879 * @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 1782 *
104     * @return return true if adding successfully, return false if the
105     * molecule is already in SimInfo
106     *
107 gezelter 1879 * @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 1782 *
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 1782 * 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 1782 * 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 1953 /** Returns the number of global bonds */
153     unsigned int getNGlobalBonds(){
154     return nGlobalBonds_;
155     }
156    
157     /** Returns the number of global bends */
158     unsigned int getNGlobalBends() {
159     return nGlobalBends_;
160     }
161    
162     /** Returns the number of global torsions */
163     unsigned int getNGlobalTorsions() {
164     return nGlobalTorsions_;
165     }
166    
167     /** Returns the number of global inversions */
168     unsigned int getNGlobalInversions() {
169     return nGlobalInversions_;
170     }
171    
172 gezelter 1983 unsigned int getNGlobalConstraints() {
173     if (!hasNGlobalConstraints_) calcNConstraints();
174     return nGlobalConstraints_;
175     }
176 gezelter 507 /**
177     * Returns the number of local molecules.
178     * @return the number of local molecules
179     */
180     int getNMolecules() {
181     return molecules_.size();
182     }
183 gezelter 2
184 gezelter 507 /** Returns the number of local atoms */
185     unsigned int getNAtoms() {
186     return nAtoms_;
187     }
188 gezelter 2
189 gezelter 1782 /** Returns the number of effective cutoff groups on local processor */
190     unsigned int getNLocalCutoffGroups();
191    
192 gezelter 507 /** Returns the number of local bonds */
193     unsigned int getNBonds(){
194     return nBonds_;
195     }
196 gezelter 2
197 gezelter 507 /** Returns the number of local bends */
198     unsigned int getNBends() {
199     return nBends_;
200     }
201 gezelter 2
202 gezelter 507 /** Returns the number of local torsions */
203     unsigned int getNTorsions() {
204     return nTorsions_;
205     }
206 gezelter 2
207 gezelter 1953 /** Returns the number of local inversions */
208 gezelter 1277 unsigned int getNInversions() {
209     return nInversions_;
210     }
211 gezelter 507 /** Returns the number of local rigid bodies */
212     unsigned int getNRigidBodies() {
213     return nRigidBodies_;
214     }
215 gezelter 2
216 gezelter 507 /** Returns the number of local integrable objects */
217     unsigned int getNIntegrableObjects() {
218     return nIntegrableObjects_;
219     }
220 gezelter 2
221 gezelter 507 /** Returns the number of local cutoff groups */
222     unsigned int getNCutoffGroups() {
223     return nCutoffGroups_;
224     }
225 gezelter 2
226 gezelter 507 /** Returns the total number of constraints in this SimInfo */
227     unsigned int getNConstraints() {
228     return nConstraints_;
229     }
230 gezelter 246
231 gezelter 507 /**
232     * Returns the first molecule in this SimInfo and intialize the iterator.
233     * @return the first molecule, return NULL if there is not molecule in this SimInfo
234     * @param i the iterator of molecule array (user shouldn't change it)
235     */
236     Molecule* beginMolecule(MoleculeIterator& i);
237 gezelter 2
238 gezelter 507 /**
239     * Returns the next avaliable Molecule based on the iterator.
240     * @return the next avaliable molecule, return NULL if reaching the end of the array
241     * @param i the iterator of molecule array
242     */
243     Molecule* nextMolecule(MoleculeIterator& i);
244 gezelter 2
245 gezelter 1782 /** Returns the total number of fluctuating charges that are present */
246     int getNFluctuatingCharges() {
247     return nGlobalFluctuatingCharges_;
248     }
249    
250 gezelter 507 /** Returns the number of degrees of freedom */
251     int getNdf() {
252 gezelter 945 return ndf_ - getFdf();
253 gezelter 507 }
254 gezelter 2
255 gezelter 1782 /** Returns the number of degrees of freedom (LOCAL) */
256     int getNdfLocal() {
257     return ndfLocal_;
258     }
259    
260 gezelter 507 /** Returns the number of raw degrees of freedom */
261     int getNdfRaw() {
262     return ndfRaw_;
263     }
264 gezelter 2
265 gezelter 507 /** Returns the number of translational degrees of freedom */
266     int getNdfTrans() {
267     return ndfTrans_;
268     }
269 gezelter 2
270 gezelter 945 /** sets the current number of frozen degrees of freedom */
271     void setFdf(int fdf) {
272     fdf_local = fdf;
273     }
274    
275     int getFdf();
276    
277 gezelter 1782 //getNZconstraint and setNZconstraint ruin the coherence of
278     //SimInfo class, need refactoring
279 gezelter 246
280 gezelter 507 /** Returns the total number of z-constraint molecules in the system */
281     int getNZconstraint() {
282     return nZconstraint_;
283     }
284 gezelter 2
285 gezelter 507 /**
286     * Sets the number of z-constraint molecules in the system.
287     */
288     void setNZconstraint(int nZconstraint) {
289     nZconstraint_ = nZconstraint;
290     }
291 gezelter 246
292 gezelter 507 /** Returns the snapshot manager. */
293     SnapshotManager* getSnapshotManager() {
294     return sman_;
295     }
296 gezelter 1879 /** Returns the storage layout (computed by SimCreator) */
297     int getStorageLayout() {
298     return storageLayout_;
299     }
300     /** Sets the storage layout (computed by SimCreator) */
301     void setStorageLayout(int sl) {
302     storageLayout_ = sl;
303     }
304    
305 gezelter 507 /** Sets the snapshot manager. */
306     void setSnapshotManager(SnapshotManager* sman);
307 gezelter 246
308 gezelter 507 /** Returns the force field */
309     ForceField* getForceField() {
310     return forceField_;
311     }
312 gezelter 2
313 gezelter 507 Globals* getSimParams() {
314     return simParams_;
315     }
316 gezelter 2
317 gezelter 1782 void update();
318     /**
319     * Do final bookkeeping before Force managers need their data.
320     */
321     void prepareTopology();
322 gezelter 2
323    
324 gezelter 507 /** Returns the local index manager */
325     LocalIndexManager* getLocalIndexManager() {
326     return &localIndexMan_;
327     }
328 gezelter 2
329 gezelter 507 int getMoleculeStampId(int globalIndex) {
330     //assert(globalIndex < molStampIds_.size())
331     return molStampIds_[globalIndex];
332     }
333 gezelter 2
334 gezelter 507 /** Returns the molecule stamp */
335     MoleculeStamp* getMoleculeStamp(int id) {
336     return moleculeStamps_[id];
337     }
338 gezelter 2
339 gezelter 507 /** Return the total number of the molecule stamps */
340     int getNMoleculeStamp() {
341     return moleculeStamps_.size();
342     }
343     /**
344     * Finds a molecule with a specified global index
345     * @return a pointer point to found molecule
346     * @param index
347     */
348     Molecule* getMoleculeByGlobalIndex(int index) {
349     MoleculeIterator i;
350     i = molecules_.find(index);
351 gezelter 2
352 gezelter 507 return i != molecules_.end() ? i->second : NULL;
353     }
354 gezelter 2
355 chuckv 1292 int getGlobalMolMembership(int id){
356     return globalMolMembership_[id];
357     }
358    
359 gezelter 1782 /**
360     * returns a vector which maps the local atom index on this
361     * processor to the global atom index. With only one processor,
362     * these should be identical.
363     */
364     vector<int> getGlobalAtomIndices();
365 gezelter 2
366 gezelter 1782 /**
367     * returns a vector which maps the local cutoff group index on
368     * this processor to the global cutoff group index. With only one
369     * processor, these should be identical.
370     */
371     vector<int> getGlobalGroupIndices();
372 gezelter 764
373 gezelter 246
374 gezelter 1782 string getFinalConfigFileName() {
375 gezelter 507 return finalConfigFileName_;
376     }
377 tim 1024
378 gezelter 1782 void setFinalConfigFileName(const string& fileName) {
379 gezelter 507 finalConfigFileName_ = fileName;
380     }
381 gezelter 2
382 gezelter 1782 string getRawMetaData() {
383 tim 1024 return rawMetaData_;
384     }
385 gezelter 1782 void setRawMetaData(const string& rawMetaData) {
386 tim 1024 rawMetaData_ = rawMetaData;
387     }
388    
389 gezelter 1782 string getDumpFileName() {
390 gezelter 507 return dumpFileName_;
391     }
392 gezelter 246
393 gezelter 1782 void setDumpFileName(const string& fileName) {
394 gezelter 507 dumpFileName_ = fileName;
395     }
396 gezelter 2
397 gezelter 1782 string getStatFileName() {
398 gezelter 507 return statFileName_;
399     }
400 gezelter 246
401 gezelter 1782 void setStatFileName(const string& fileName) {
402 gezelter 507 statFileName_ = fileName;
403     }
404 chrisfen 417
405 gezelter 1782 string getRestFileName() {
406 gezelter 507 return restFileName_;
407     }
408 chrisfen 417
409 gezelter 1782 void setRestFileName(const string& fileName) {
410 gezelter 507 restFileName_ = fileName;
411     }
412 gezelter 2
413 gezelter 507 /**
414     * Sets GlobalGroupMembership
415     */
416 gezelter 1846 void setGlobalGroupMembership(const vector<int>& ggm) {
417     assert(ggm.size() == static_cast<size_t>(nGlobalAtoms_));
418     globalGroupMembership_ = ggm;
419 gezelter 507 }
420 gezelter 2
421 gezelter 507 /**
422     * Sets GlobalMolMembership
423     */
424 gezelter 1846 void setGlobalMolMembership(const vector<int>& gmm) {
425     assert(gmm.size() == (static_cast<size_t>(nGlobalAtoms_ +
426     nGlobalRigidBodies_)));
427     globalMolMembership_ = gmm;
428 gezelter 507 }
429 gezelter 246
430    
431 gezelter 1782 bool isTopologyDone() {
432     return topologyDone_;
433 gezelter 507 }
434 gezelter 246
435 chrisfen 998 bool getCalcBoxDipole() {
436     return calcBoxDipole_;
437     }
438 gezelter 2022 bool getCalcBoxQuadrupole() {
439     return calcBoxQuadrupole_;
440     }
441 chrisfen 998
442 gezelter 1126 bool getUseAtomicVirial() {
443     return useAtomicVirial_;
444     }
445    
446 gezelter 507 /**
447     * Adds property into property map
448     * @param genData GenericData to be added into PropertyMap
449     */
450     void addProperty(GenericData* genData);
451 gezelter 246
452 gezelter 507 /**
453     * Removes property from PropertyMap by name
454     * @param propName the name of property to be removed
455     */
456 gezelter 1782 void removeProperty(const string& propName);
457 gezelter 246
458 gezelter 507 /**
459     * clear all of the properties
460     */
461     void clearProperties();
462 gezelter 246
463 gezelter 507 /**
464     * Returns all names of properties
465     * @return all names of properties
466     */
467 gezelter 1782 vector<string> getPropertyNames();
468 gezelter 246
469 gezelter 507 /**
470     * Returns all of the properties in PropertyMap
471     * @return all of the properties in PropertyMap
472     */
473 gezelter 1782 vector<GenericData*> getProperties();
474 gezelter 246
475 gezelter 507 /**
476     * Returns property
477     * @param propName name of property
478     * @return a pointer point to property with propName. If no property named propName
479     * exists, return NULL
480     */
481 gezelter 1782 GenericData* getPropertyByName(const string& propName);
482 gezelter 246
483 gezelter 507 /**
484 gezelter 1287 * add all special interaction pairs (including excluded
485     * interactions) in a molecule into the appropriate lists.
486 gezelter 507 */
487 gezelter 1287 void addInteractionPairs(Molecule* mol);
488 gezelter 246
489 gezelter 507 /**
490 gezelter 1287 * remove all special interaction pairs which belong to a molecule
491     * from the appropriate lists.
492 gezelter 507 */
493 gezelter 1287 void removeInteractionPairs(Molecule* mol);
494 gezelter 246
495 gezelter 1782 /** Returns the set of atom types present in this simulation */
496     set<AtomType*> getSimulatedAtomTypes();
497 gezelter 1879
498     /** Returns the global count of atoms of a particular type */
499     int getGlobalCountOfType(AtomType* atype);
500 tim 292
501 gezelter 1782 friend ostream& operator <<(ostream& o, SimInfo& info);
502 tim 326
503 tim 963 void getCutoff(RealType& rcut, RealType& rsw);
504 gezelter 246
505 gezelter 507 private:
506 gezelter 246
507 gezelter 1782 /** fill up the simtype struct and other simulation-related variables */
508     void setupSimVariables();
509 gezelter 246
510    
511 gezelter 507 /** Calculates the number of degress of freedom in the whole system */
512     void calcNdf();
513     void calcNdfRaw();
514     void calcNdfTrans();
515 gezelter 1983 void calcNConstraints();
516 gezelter 246
517 gezelter 507 /**
518 gezelter 1782 * Adds molecule stamp and the total number of the molecule with
519     * same molecule stamp in the whole system.
520 gezelter 507 */
521     void addMoleculeStamp(MoleculeStamp* molStamp, int nmol);
522 gezelter 246
523 gezelter 1782 // Other classes holdingn important information
524     ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */
525     Globals* simParams_; /**< provides access to simulation parameters set by user */
526 gezelter 246
527 gezelter 1782 /// Counts of local objects
528 gezelter 1277 int nAtoms_; /**< number of atoms in local processor */
529     int nBonds_; /**< number of bonds in local processor */
530     int nBends_; /**< number of bends in local processor */
531     int nTorsions_; /**< number of torsions in local processor */
532     int nInversions_; /**< number of inversions in local processor */
533     int nRigidBodies_; /**< number of rigid bodies in local processor */
534     int nIntegrableObjects_; /**< number of integrable objects in local processor */
535     int nCutoffGroups_; /**< number of cutoff groups in local processor */
536     int nConstraints_; /**< number of constraints in local processors */
537 gezelter 1782 int nFluctuatingCharges_; /**< number of fluctuating charges in local processor */
538    
539     /// Counts of global objects
540     int nGlobalMols_; /**< number of molecules in the system (GLOBAL) */
541     int nGlobalAtoms_; /**< number of atoms in the system (GLOBAL) */
542     int nGlobalCutoffGroups_; /**< number of cutoff groups in this system (GLOBAL) */
543     int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
544     int nGlobalRigidBodies_; /**< number of rigid bodies in this system (GLOBAL) */
545     int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */
546 gezelter 1953 int nGlobalBonds_; /**< number of bonds in the system */
547     int nGlobalBends_; /**< number of bends in the system */
548     int nGlobalTorsions_; /**< number of torsions in the system */
549     int nGlobalInversions_; /**< number of inversions in the system */
550 gezelter 1983 int nGlobalConstraints_; /**< number of constraints in the system */
551     bool hasNGlobalConstraints_;
552    
553 gezelter 1782 /// Degress of freedom
554     int ndf_; /**< number of degress of freedom (excludes constraints) (LOCAL) */
555     int ndfLocal_; /**< number of degrees of freedom (LOCAL, excludes constraints) */
556     int fdf_local; /**< number of frozen degrees of freedom (LOCAL) */
557     int fdf_; /**< number of frozen degrees of freedom (GLOBAL) */
558     int ndfRaw_; /**< number of degress of freedom (includes constraints), (LOCAL) */
559     int ndfTrans_; /**< number of translation degress of freedom, (LOCAL) */
560     int nZconstraint_; /**< number of z-constraint molecules (GLOBAL) */
561 gezelter 246
562 gezelter 1782 /// logicals
563     bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */
564     bool usesDirectionalAtoms_; /**< are there atoms with position AND orientation? */
565     bool usesMetallicAtoms_; /**< are there transition metal atoms? */
566     bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */
567     bool usesFluctuatingCharges_; /**< are there fluctuating charges? */
568     bool usesAtomicVirial_; /**< are we computing atomic virials? */
569     bool requiresPrepair_; /**< does this simulation require a pre-pair loop? */
570     bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
571     bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
572 gezelter 246
573 gezelter 1782 public:
574     bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
575     bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
576     bool usesFluctuatingCharges() { return usesFluctuatingCharges_; }
577     bool usesAtomicVirial() { return usesAtomicVirial_; }
578     bool requiresPrepair() { return requiresPrepair_; }
579     bool requiresSkipCorrection() { return requiresSkipCorrection_;}
580     bool requiresSelfCorrection() { return requiresSelfCorrection_;}
581    
582     private:
583     /// Data structures holding primary simulation objects
584     map<int, Molecule*> molecules_; /**< map holding pointers to LOCAL molecules */
585    
586     /// Stamps are templates for objects that are then used to create
587     /// groups of objects. For example, a molecule stamp contains
588     /// information on how to build that molecule (i.e. the topology,
589     /// the atoms, the bonds, etc.) Once the system is built, the
590     /// stamps are no longer useful.
591     vector<int> molStampIds_; /**< stamp id for molecules in the system */
592     vector<MoleculeStamp*> moleculeStamps_; /**< molecule stamps array */
593    
594     /**
595     * A vector that maps between the global index of an atom, and the
596     * global index of cutoff group the atom belong to. It is filled
597     * by SimCreator once and only once, since it never changed during
598     * the simulation. It should be nGlobalAtoms_ in size.
599     */
600     vector<int> globalGroupMembership_;
601     public:
602     vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
603     private:
604    
605     /**
606     * A vector that maps between the global index of an atom and the
607     * global index of the molecule the atom belongs to. It is filled
608     * by SimCreator once and only once, since it is never changed
609     * during the simulation. It shoudl be nGlobalAtoms_ in size.
610     */
611     vector<int> globalMolMembership_;
612    
613 gezelter 507 /**
614 gezelter 1782 * A vector that maps between the local index of an atom and the
615     * index of the AtomType.
616     */
617     vector<int> identArray_;
618     public:
619     vector<int> getIdentArray() { return identArray_; }
620 gezelter 1929
621     /**
622     * A vector that contains information about the local region of an
623     * atom (used for fluctuating charges, etc.)
624     */
625 gezelter 1782 private:
626 gezelter 1929 vector<int> regions_;
627     public:
628     vector<int> getRegions() { return regions_; }
629     private:
630 gezelter 1782 /**
631     * A vector which contains the fractional contribution of an
632     * atom's mass to the total mass of the cutoffGroup that atom
633     * belongs to. In the case of single atom cutoff groups, the mass
634     * factor for that atom is 1. For massless atoms, the factor is
635     * also 1.
636     */
637     vector<RealType> massFactors_;
638     public:
639     vector<RealType> getMassFactors() { return massFactors_; }
640    
641     PairList* getExcludedInteractions() { return &excludedInteractions_; }
642     PairList* getOneTwoInteractions() { return &oneTwoInteractions_; }
643     PairList* getOneThreeInteractions() { return &oneThreeInteractions_; }
644     PairList* getOneFourInteractions() { return &oneFourInteractions_; }
645    
646     private:
647    
648     /// lists to handle atoms needing special treatment in the non-bonded interactions
649     PairList excludedInteractions_; /**< atoms excluded from interacting with each other */
650     PairList oneTwoInteractions_; /**< atoms that are directly Bonded */
651     PairList oneThreeInteractions_; /**< atoms sharing a Bend */
652     PairList oneFourInteractions_; /**< atoms sharing a Torsion */
653    
654     PropertyMap properties_; /**< Generic Properties can be added */
655     SnapshotManager* sman_; /**< SnapshotManager (handles particle positions, etc.) */
656 gezelter 1879 int storageLayout_; /**< Bits to tell how much data to store on each object */
657 gezelter 1782
658     /**
659     * The reason to have a local index manager is that when molecule
660     * is migrating to other processors, the atoms and the
661     * rigid-bodies will release their local indices to
662     * LocalIndexManager. Combining the information of molecule
663     * migrating to current processor, Migrator class can query the
664     * LocalIndexManager to make a efficient data moving plan.
665 gezelter 507 */
666     LocalIndexManager localIndexMan_;
667 gezelter 246
668 tim 1024 // unparsed MetaData block for storing in Dump and EOR files:
669 gezelter 1782 string rawMetaData_;
670 tim 1024
671 gezelter 1782 // file names
672     string finalConfigFileName_;
673     string dumpFileName_;
674     string statFileName_;
675     string restFileName_;
676 gezelter 246
677 gezelter 1782 bool topologyDone_; /** flag to indicate whether the topology has
678     been scanned and all the relevant
679     bookkeeping has been done*/
680 gezelter 1126
681     bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
682     the simulation box dipole moment */
683 gezelter 2022 bool calcBoxQuadrupole_; /**< flag to indicate whether or not we calculate
684     the simulation box quadrupole moment */
685 gezelter 1126
686     bool useAtomicVirial_; /**< flag to indicate whether or not we use
687     Atomic Virials to calculate the pressure */
688 gezelter 1782
689     public:
690     /**
691     * return an integral objects by its global index. In MPI
692     * version, if the StuntDouble with specified global index does
693     * not belong to local processor, a NULL will be return.
694 tim 1024 */
695 gezelter 1782 StuntDouble* getIOIndexToIntegrableObject(int index);
696     void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v);
697 tim 1024
698 gezelter 1782 private:
699     vector<StuntDouble*> IOIndexToIntegrableObject;
700    
701 gezelter 507 public:
702 gezelter 246
703 gezelter 507 /**
704     * Finds the processor where a molecule resides
705     * @return the id of the processor which contains the molecule
706     * @param globalIndex global Index of the molecule
707     */
708     int getMolToProc(int globalIndex) {
709     //assert(globalIndex < molToProcMap_.size());
710     return molToProcMap_[globalIndex];
711     }
712 gezelter 1782
713 gezelter 507 /**
714     * Set MolToProcMap array
715     */
716 gezelter 1782 void setMolToProcMap(const vector<int>& molToProcMap) {
717 gezelter 507 molToProcMap_ = molToProcMap;
718     }
719 gezelter 246
720 gezelter 507 private:
721 gezelter 246
722 gezelter 507 /**
723 gezelter 1241 * The size of molToProcMap_ is equal to total number of molecules
724     * in the system. It maps a molecule to the processor on which it
725     * resides. it is filled by SimCreator once and only once.
726 gezelter 507 */
727 gezelter 1782 vector<int> molToProcMap_;
728 tim 292
729 gezelter 507 };
730 gezelter 2
731 gezelter 1390 } //namespace OpenMD
732 gezelter 246 #endif //BRAINS_SIMMODEL_HPP
733 gezelter 2

Properties

Name Value
svn:keywords Author Id Revision Date