ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimInfo.hpp
Revision: 1725
Committed: Sat May 26 18:13:43 2012 UTC (12 years, 11 months ago) by gezelter
File size: 23847 byte(s)
Log Message:
Individual ForceField classes have been removed (they were essentially
all duplicates anyway).  

ForceField has moved to brains, and since only one force field is in
play at any time, the ForceFieldFactory and Register methods have been
removed.  


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

Properties

Name Value
svn:keywords Author Id Revision Date