ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/brains/SimInfo.hpp
(Generate patch)

Comparing trunk/src/brains/SimInfo.hpp (file contents):
Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
Revision 1953 by gezelter, Thu Dec 5 18:19:26 2013 UTC

# Line 35 | Line 35
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 < * [4]  Vardeman & Gezelter, in progress (2009).                        
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   /**
# Line 59 | Line 60
60   #include "math/Vector3.hpp"
61   #include "math/SquareMatrix3.hpp"
62   #include "types/MoleculeStamp.hpp"
63 < #include "UseTheForce/ForceField.hpp"
63 > #include "brains/ForceField.hpp"
64   #include "utils/PropertyMap.hpp"
65   #include "utils/LocalIndexManager.hpp"
66 + #include "nonbonded/SwitchingFunction.hpp"
67  
68 < //another nonsense macro declaration
67 < #define __OPENMD_C
68 < #include "brains/fSimulation.h"
69 <
68 > using namespace std;
69   namespace OpenMD{
70 <
72 <  //forward decalration
70 >  //forward declaration
71    class SnapshotManager;
72    class Molecule;
73    class SelectionManager;
74    class StuntDouble;
75 +
76    /**
77 <   * @class SimInfo SimInfo.hpp "brains/SimInfo.hpp"
78 <   * @brief One of the heavy weight classes of OpenMD, SimInfo maintains a list of molecules.
79 <    * The Molecule class maintains all of the concrete objects
80 <    * (atoms, bond, bend, torsions, inversions, rigid bodies, cutoff groups,
81 <    * constraints). In both the single and parallel versions, atoms and
82 <    * rigid bodies have both global and local indices.  The local index is
83 <    * not relevant to molecules or cutoff groups.
84 <    */
77 >   * @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    class SimInfo {
88    public:
89 <    typedef std::map<int, Molecule*>::iterator  MoleculeIterator;
90 <
89 >    typedef map<int, Molecule*>::iterator  MoleculeIterator;
90 >    
91      /**
92       * Constructor of SimInfo
93 <     * @param molStampPairs MoleculeStamp Array. The first element of the pair is molecule stamp, the
94 <     * second element is the total number of molecules with the same molecule stamp in the system
95 <     * @param ff pointer of a concrete ForceField instance
96 <     * @param simParams
96 <     * @note
93 >     *
94 >     * @param ff pointer to a concrete ForceField instance
95 >     *
96 >     * @param simParams pointer to the simulation parameters in a Globals object
97       */
98      SimInfo(ForceField* ff, Globals* simParams);
99      virtual ~SimInfo();
100  
101      /**
102       * Adds a molecule
103 <     * @return return true if adding successfully, return false if the molecule is already in SimInfo
104 <     * @param mol molecule to be added
103 >     *
104 >     * @return return true if adding successfully, return false if the
105 >     * molecule is already in SimInfo
106 >     *
107 >     * @param mol Molecule to be added
108       */
109      bool addMolecule(Molecule* mol);
110  
111      /**
112       * Removes a molecule from SimInfo
113 <     * @return true if removing successfully, return false if molecule is not in this SimInfo
113 >     *
114 >     * @return true if removing successfully, return false if molecule
115 >     * is not in this SimInfo
116       */
117      bool removeMolecule(Molecule* mol);
118  
# Line 127 | Line 132 | namespace OpenMD{
132      }
133  
134      /**
135 <     * Returns the total number of integrable objects (total number of rigid bodies plus the total number
136 <     * of atoms which do not belong to the rigid bodies) in the system
135 >     * 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       */
139      int getNGlobalIntegrableObjects() {
140        return nGlobalIntegrableObjects_;
141      }
142  
143      /**
144 <     * Returns the total number of integrable objects (total number of rigid bodies plus the total number
145 <     * of atoms which do not belong to the rigid bodies) in the system
144 >     * 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       */
148      int getNGlobalRigidBodies() {
149        return nGlobalRigidBodies_;
150      }
151  
152 +    /** 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      int getNGlobalConstraints();
173      /**
174       * Returns the number of local molecules.
# Line 156 | Line 183 | namespace OpenMD{
183        return nAtoms_;
184      }
185  
186 +    /** Returns the number of effective cutoff groups on local processor */
187 +    unsigned int getNLocalCutoffGroups();
188 +
189      /** Returns the number of local bonds */        
190      unsigned int getNBonds(){
191        return nBonds_;
# Line 171 | Line 201 | namespace OpenMD{
201        return nTorsions_;
202      }
203  
204 <    /** Returns the number of local torsions */        
204 >    /** Returns the number of local inversions */        
205      unsigned int getNInversions() {
206        return nInversions_;
207      }
# Line 209 | Line 239 | namespace OpenMD{
239       */
240      Molecule* nextMolecule(MoleculeIterator& i);
241  
242 +    /** Returns the total number of fluctuating charges that are present */
243 +    int getNFluctuatingCharges() {
244 +      return nGlobalFluctuatingCharges_;
245 +    }
246 +
247      /** Returns the number of degrees of freedom */
248      int getNdf() {
249        return ndf_ - getFdf();
250      }
251  
252 +    /** Returns the number of degrees of freedom (LOCAL) */
253 +    int getNdfLocal() {
254 +      return ndfLocal_;
255 +    }
256 +
257      /** Returns the number of raw degrees of freedom */
258      int getNdfRaw() {
259        return ndfRaw_;
# Line 231 | Line 271 | namespace OpenMD{
271  
272      int getFdf();
273      
274 <    //getNZconstraint and setNZconstraint ruin the coherent of SimInfo class, need refactorying
274 >    //getNZconstraint and setNZconstraint ruin the coherence of
275 >    //SimInfo class, need refactoring
276          
277      /** Returns the total number of z-constraint molecules in the system */
278      int getNZconstraint() {
# Line 249 | Line 290 | namespace OpenMD{
290      SnapshotManager* getSnapshotManager() {
291        return sman_;
292      }
293 <
293 >    /** Returns the storage layout (computed by SimCreator) */
294 >    int getStorageLayout() {
295 >      return storageLayout_;
296 >    }
297 >    /** Sets the storage layout (computed by SimCreator) */
298 >    void setStorageLayout(int sl) {
299 >      storageLayout_ = sl;
300 >    }
301 >    
302      /** Sets the snapshot manager. */
303      void setSnapshotManager(SnapshotManager* sman);
304          
# Line 262 | Line 311 | namespace OpenMD{
311        return simParams_;
312      }
313  
265    /** Returns the velocity of center of mass of the whole system.*/
266    Vector3d getComVel();
267
268    /** Returns the center of the mass of the whole system.*/
269    Vector3d getCom();
270   /** Returns the center of the mass and Center of Mass velocity of the whole system.*/
271    void getComAll(Vector3d& com,Vector3d& comVel);
272
273    /** Returns intertia tensor for the entire system and system Angular Momentum.*/
274    void getInertiaTensor(Mat3x3d &intertiaTensor,Vector3d &angularMomentum);
275    
276    /** Returns system angular momentum */
277    Vector3d getAngularMomentum();
278
279    /** Returns volume of system as estimated by an ellipsoid defined by the radii of gyration*/
280    void getGyrationalVolume(RealType &vol);
281    /** Overloaded version of gyrational volume that also returns det(I) so dV/dr can be calculated*/
282    void getGyrationalVolume(RealType &vol, RealType &detI);
283    /** main driver function to interact with fortran during the initialization and molecule migration */
314      void update();
315 +    /**
316 +     * Do final bookkeeping before Force managers need their data.
317 +     */
318 +    void prepareTopology();
319  
320 +
321      /** Returns the local index manager */
322      LocalIndexManager* getLocalIndexManager() {
323        return &localIndexMan_;
# Line 318 | Line 353 | namespace OpenMD{
353        return globalMolMembership_[id];
354      }
355  
356 <    RealType getRcut() {
357 <      return rcut_;
358 <    }
356 >    /**
357 >     * returns a vector which maps the local atom index on this
358 >     * processor to the global atom index.  With only one processor,
359 >     * these should be identical.
360 >     */
361 >    vector<int> getGlobalAtomIndices();
362  
363 <    RealType getRsw() {
364 <      return rsw_;
365 <    }
363 >    /**
364 >     * returns a vector which maps the local cutoff group index on
365 >     * this processor to the global cutoff group index.  With only one
366 >     * processor, these should be identical.
367 >     */
368 >    vector<int> getGlobalGroupIndices();
369  
329    RealType getList() {
330      return rlist_;
331    }
370          
371 <    std::string getFinalConfigFileName() {
371 >    string getFinalConfigFileName() {
372        return finalConfigFileName_;
373      }
374  
375 <    void setFinalConfigFileName(const std::string& fileName) {
375 >    void setFinalConfigFileName(const string& fileName) {
376        finalConfigFileName_ = fileName;
377      }
378  
379 <    std::string getRawMetaData() {
379 >    string getRawMetaData() {
380        return rawMetaData_;
381      }
382 <    void setRawMetaData(const std::string& rawMetaData) {
382 >    void setRawMetaData(const string& rawMetaData) {
383        rawMetaData_ = rawMetaData;
384      }
385          
386 <    std::string getDumpFileName() {
386 >    string getDumpFileName() {
387        return dumpFileName_;
388      }
389          
390 <    void setDumpFileName(const std::string& fileName) {
390 >    void setDumpFileName(const string& fileName) {
391        dumpFileName_ = fileName;
392      }
393  
394 <    std::string getStatFileName() {
394 >    string getStatFileName() {
395        return statFileName_;
396      }
397          
398 <    void setStatFileName(const std::string& fileName) {
398 >    void setStatFileName(const string& fileName) {
399        statFileName_ = fileName;
400      }
401          
402 <    std::string getRestFileName() {
402 >    string getRestFileName() {
403        return restFileName_;
404      }
405          
406 <    void setRestFileName(const std::string& fileName) {
406 >    void setRestFileName(const string& fileName) {
407        restFileName_ = fileName;
408      }
409  
410      /**
411       * Sets GlobalGroupMembership
374     * @see #SimCreator::setGlobalIndex
412       */  
413 <    void setGlobalGroupMembership(const std::vector<int>& globalGroupMembership) {
414 <      assert(globalGroupMembership.size() == static_cast<size_t>(nGlobalAtoms_));
415 <      globalGroupMembership_ = globalGroupMembership;
413 >    void setGlobalGroupMembership(const vector<int>& ggm) {
414 >      assert(ggm.size() == static_cast<size_t>(nGlobalAtoms_));
415 >      globalGroupMembership_ = ggm;
416      }
417  
418      /**
419       * Sets GlobalMolMembership
383     * @see #SimCreator::setGlobalIndex
420       */        
421 <    void setGlobalMolMembership(const std::vector<int>& globalMolMembership) {
422 <      assert(globalMolMembership.size() == static_cast<size_t>(nGlobalAtoms_));
423 <      globalMolMembership_ = globalMolMembership;
421 >    void setGlobalMolMembership(const vector<int>& gmm) {
422 >      assert(gmm.size() == (static_cast<size_t>(nGlobalAtoms_ +
423 >                                                nGlobalRigidBodies_)));
424 >      globalMolMembership_ = gmm;
425      }
426  
427  
428 <    bool isFortranInitialized() {
429 <      return fortranInitialized_;
428 >    bool isTopologyDone() {
429 >      return topologyDone_;
430      }
431          
432      bool getCalcBoxDipole() {
# Line 400 | Line 437 | namespace OpenMD{
437        return useAtomicVirial_;
438      }
439  
403    //below functions are just forward functions
404    //To compose or to inherit is always a hot debate. In general, is-a relation need subclassing, in the
405    //the other hand, has-a relation need composing.
440      /**
441       * Adds property into property map
442       * @param genData GenericData to be added into PropertyMap
# Line 413 | Line 447 | namespace OpenMD{
447       * Removes property from PropertyMap by name
448       * @param propName the name of property to be removed
449       */
450 <    void removeProperty(const std::string& propName);
450 >    void removeProperty(const string& propName);
451  
452      /**
453       * clear all of the properties
# Line 424 | Line 458 | namespace OpenMD{
458       * Returns all names of properties
459       * @return all names of properties
460       */
461 <    std::vector<std::string> getPropertyNames();
461 >    vector<string> getPropertyNames();
462  
463      /**
464       * Returns all of the properties in PropertyMap
465       * @return all of the properties in PropertyMap
466       */      
467 <    std::vector<GenericData*> getProperties();
467 >    vector<GenericData*> getProperties();
468  
469      /**
470       * Returns property
# Line 438 | Line 472 | namespace OpenMD{
472       * @return a pointer point to property with propName. If no property named propName
473       * exists, return NULL
474       */      
475 <    GenericData* getPropertyByName(const std::string& propName);
475 >    GenericData* getPropertyByName(const string& propName);
476  
477      /**
478       * add all special interaction pairs (including excluded
# Line 452 | Line 486 | namespace OpenMD{
486       */
487      void removeInteractionPairs(Molecule* mol);
488  
489 +    /** Returns the set of atom types present in this simulation */
490 +    set<AtomType*> getSimulatedAtomTypes();
491  
492 <    /** Returns the unique atom types of local processor in an array */
493 <    std::set<AtomType*> getUniqueAtomTypes();
492 >    /** Returns the global count of atoms of a particular type */
493 >    int getGlobalCountOfType(AtomType* atype);
494          
495 <    friend std::ostream& operator <<(std::ostream& o, SimInfo& info);
495 >    friend ostream& operator <<(ostream& o, SimInfo& info);
496  
497      void getCutoff(RealType& rcut, RealType& rsw);
498          
499    private:
500  
501 <    /** fill up the simtype struct*/
502 <    void setupSimType();
501 >    /** fill up the simtype struct and other simulation-related variables */
502 >    void setupSimVariables();
503  
468    /**
469     * Setup Fortran Simulation
470     * @see #setupFortranParallel
471     */
472    void setupFortranSim();
504  
474    /** Figure out the radius of cutoff, radius of switching function and pass them to fortran */
475    void setupCutoff();
476
477    /** Figure out which coulombic correction method to use and pass to fortran */
478    void setupElectrostaticSummationMethod( int isError );
479
480    /** Figure out which polynomial type to use for the switching function */
481    void setupSwitchingFunction();
482
505      /** Determine if we need to accumulate the simulation box dipole */
506      void setupAccumulateBoxDipole();
507  
# Line 488 | Line 510 | namespace OpenMD{
510      void calcNdfRaw();
511      void calcNdfTrans();
512  
491    ForceField* forceField_;      
492    Globals* simParams_;
493
494    std::map<int, Molecule*>  molecules_; /**< Molecule array */
495
513      /**
514 <     * Adds molecule stamp and the total number of the molecule with same molecule stamp in the whole
515 <     * system.
514 >     * Adds molecule stamp and the total number of the molecule with
515 >     * same molecule stamp in the whole system.
516       */
517      void addMoleculeStamp(MoleculeStamp* molStamp, int nmol);
501        
502    //degress of freedom
503    int ndf_;           /**< number of degress of freedom (excludes constraints),  ndf_ is local */
504    int fdf_local;       /**< number of frozen degrees of freedom */
505    int fdf_;            /**< number of frozen degrees of freedom */
506    int ndfRaw_;    /**< number of degress of freedom (includes constraints),  ndfRaw_ is local */
507    int ndfTrans_; /**< number of translation degress of freedom, ndfTrans_ is local */
508    int nZconstraint_; /** number of  z-constraint molecules, nZconstraint_ is global */
509        
510    //number of global objects
511    int nGlobalMols_;       /**< number of molecules in the system */
512    int nGlobalAtoms_;   /**< number of atoms in the system */
513    int nGlobalCutoffGroups_; /**< number of cutoff groups in this system */
514    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
515    int nGlobalRigidBodies_; /**< number of rigid bodies in this system */
516    /**
517     * the size of globalGroupMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
518     * corresponding content is the global index of cutoff group this atom belong to.
519     * It is filled by SimCreator once and only once, since it never changed during the simulation.
520     */
521    std::vector<int> globalGroupMembership_;
518  
519 <    /**
520 <     * the size of globalMolMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
521 <     * corresponding content is the global index of molecule this atom belong to.
526 <     * It is filled by SimCreator once and only once, since it is never changed during the simulation.
527 <     */
528 <    std::vector<int> globalMolMembership_;        
519 >    // Other classes holdingn important information
520 >    ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */
521 >    Globals* simParams_;     /**< provides access to simulation parameters set by user */
522  
523 <        
531 <    std::vector<int> molStampIds_;                                /**< stamp id array of all molecules in the system */
532 <    std::vector<MoleculeStamp*> moleculeStamps_;      /**< molecule stamps array */        
533 <        
534 <    //number of local objects
523 >    ///  Counts of local objects
524      int nAtoms_;              /**< number of atoms in local processor */
525      int nBonds_;              /**< number of bonds in local processor */
526      int nBends_;              /**< number of bends in local processor */
# Line 541 | Line 530 | namespace OpenMD{
530      int nIntegrableObjects_;  /**< number of integrable objects in local processor */
531      int nCutoffGroups_;       /**< number of cutoff groups in local processor */
532      int nConstraints_;        /**< number of constraints in local processors */
533 +    int nFluctuatingCharges_; /**< number of fluctuating charges in local processor */
534 +        
535 +    /// Counts of global objects
536 +    int nGlobalMols_;              /**< number of molecules in the system (GLOBAL) */
537 +    int nGlobalAtoms_;             /**< number of atoms in the system (GLOBAL) */
538 +    int nGlobalCutoffGroups_;      /**< number of cutoff groups in this system (GLOBAL) */
539 +    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
540 +    int nGlobalRigidBodies_;       /**< number of rigid bodies in this system (GLOBAL) */
541 +    int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */
542 +    int nGlobalBonds_;              /**< number of bonds in the system */
543 +    int nGlobalBends_;              /**< number of bends in the system */
544 +    int nGlobalTorsions_;           /**< number of torsions in the system */
545 +    int nGlobalInversions_;         /**< number of inversions in the system */
546 +      
547 +    /// Degress of freedom
548 +    int ndf_;          /**< number of degress of freedom (excludes constraints) (LOCAL) */
549 +    int ndfLocal_;     /**< number of degrees of freedom (LOCAL, excludes constraints) */
550 +    int fdf_local;     /**< number of frozen degrees of freedom (LOCAL) */
551 +    int fdf_;          /**< number of frozen degrees of freedom (GLOBAL) */
552 +    int ndfRaw_;       /**< number of degress of freedom (includes constraints),  (LOCAL) */
553 +    int ndfTrans_;     /**< number of translation degress of freedom, (LOCAL) */
554 +    int nZconstraint_; /**< number of  z-constraint molecules (GLOBAL) */
555  
556 <    simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/
557 <    PairList excludedInteractions_;      
558 <    PairList oneTwoInteractions_;      
559 <    PairList oneThreeInteractions_;      
560 <    PairList oneFourInteractions_;      
561 <    PropertyMap properties_;                  /**< Generic Property */
562 <    SnapshotManager* sman_;               /**< SnapshotManager */
556 >    /// logicals
557 >    bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */
558 >    bool usesDirectionalAtoms_;   /**< are there atoms with position AND orientation? */
559 >    bool usesMetallicAtoms_;      /**< are there transition metal atoms? */
560 >    bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */
561 >    bool usesFluctuatingCharges_; /**< are there fluctuating charges? */
562 >    bool usesAtomicVirial_;       /**< are we computing atomic virials? */
563 >    bool requiresPrepair_;        /**< does this simulation require a pre-pair loop? */
564 >    bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
565 >    bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
566  
567 +  public:
568 +    bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
569 +    bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
570 +    bool usesFluctuatingCharges() { return usesFluctuatingCharges_; }
571 +    bool usesAtomicVirial() { return usesAtomicVirial_; }
572 +    bool requiresPrepair() { return requiresPrepair_; }
573 +    bool requiresSkipCorrection() { return requiresSkipCorrection_;}
574 +    bool requiresSelfCorrection() { return requiresSelfCorrection_;}
575 +
576 +  private:
577 +    /// Data structures holding primary simulation objects
578 +    map<int, Molecule*>  molecules_;  /**< map holding pointers to LOCAL molecules */
579 +
580 +    /// Stamps are templates for objects that are then used to create
581 +    /// groups of objects.  For example, a molecule stamp contains
582 +    /// information on how to build that molecule (i.e. the topology,
583 +    /// the atoms, the bonds, etc.)  Once the system is built, the
584 +    /// stamps are no longer useful.
585 +    vector<int> molStampIds_;                /**< stamp id for molecules in the system */
586 +    vector<MoleculeStamp*> moleculeStamps_;  /**< molecule stamps array */        
587 +
588 +    /**
589 +     * A vector that maps between the global index of an atom, and the
590 +     * global index of cutoff group the atom belong to.  It is filled
591 +     * by SimCreator once and only once, since it never changed during
592 +     * the simulation.  It should be nGlobalAtoms_ in size.
593 +     */
594 +    vector<int> globalGroupMembership_;
595 +  public:
596 +    vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
597 +  private:
598 +
599 +    /**
600 +     * A vector that maps between the global index of an atom and the
601 +     * global index of the molecule the atom belongs to.  It is filled
602 +     * by SimCreator once and only once, since it is never changed
603 +     * during the simulation. It shoudl be nGlobalAtoms_ in size.
604 +     */
605 +    vector<int> globalMolMembership_;
606 +
607      /**
608 <     * The reason to have a local index manager is that when molecule is migrating to other processors,
609 <     * the atoms and the rigid-bodies will release their local indices to LocalIndexManager. Combining the
610 <     * information of molecule migrating to current processor, Migrator class can query  the LocalIndexManager
611 <     * to make a efficient data moving plan.
608 >     * A vector that maps between the local index of an atom and the
609 >     * index of the AtomType.
610 >     */
611 >    vector<int> identArray_;
612 >  public:
613 >    vector<int> getIdentArray() { return identArray_; }
614 >
615 >    /**
616 >     * A vector that contains information about the local region of an
617 >     * atom (used for fluctuating charges, etc.)
618 >     */
619 >  private:
620 >    vector<int> regions_;
621 >  public:
622 >    vector<int> getRegions() { return regions_; }
623 >  private:
624 >    /**
625 >     * A vector which contains the fractional contribution of an
626 >     * atom's mass to the total mass of the cutoffGroup that atom
627 >     * belongs to.  In the case of single atom cutoff groups, the mass
628 >     * factor for that atom is 1.  For massless atoms, the factor is
629 >     * also 1.
630 >     */
631 >    vector<RealType> massFactors_;
632 >  public:
633 >    vector<RealType> getMassFactors() { return massFactors_; }
634 >
635 >    PairList* getExcludedInteractions() { return &excludedInteractions_; }
636 >    PairList* getOneTwoInteractions() { return &oneTwoInteractions_; }
637 >    PairList* getOneThreeInteractions() { return &oneThreeInteractions_; }
638 >    PairList* getOneFourInteractions() { return &oneFourInteractions_; }
639 >
640 >  private:
641 >              
642 >    /// lists to handle atoms needing special treatment in the non-bonded interactions
643 >    PairList excludedInteractions_;  /**< atoms excluded from interacting with each other */
644 >    PairList oneTwoInteractions_;    /**< atoms that are directly Bonded */
645 >    PairList oneThreeInteractions_;  /**< atoms sharing a Bend */    
646 >    PairList oneFourInteractions_;   /**< atoms sharing a Torsion */
647 >
648 >    PropertyMap properties_;       /**< Generic Properties can be added */
649 >    SnapshotManager* sman_;        /**< SnapshotManager (handles particle positions, etc.) */
650 >    int storageLayout_;            /**< Bits to tell how much data to store on each object */
651 >
652 >    /**
653 >     * The reason to have a local index manager is that when molecule
654 >     * is migrating to other processors, the atoms and the
655 >     * rigid-bodies will release their local indices to
656 >     * LocalIndexManager. Combining the information of molecule
657 >     * migrating to current processor, Migrator class can query the
658 >     * LocalIndexManager to make a efficient data moving plan.
659       */        
660      LocalIndexManager localIndexMan_;
661  
662      // unparsed MetaData block for storing in Dump and EOR files:
663 <    std::string rawMetaData_;
663 >    string rawMetaData_;
664  
665 <    //file names
666 <    std::string finalConfigFileName_;
667 <    std::string dumpFileName_;
668 <    std::string statFileName_;
669 <    std::string restFileName_;
569 <        
570 <    RealType rcut_;       /**< cutoff radius*/
571 <    RealType rsw_;        /**< radius of switching function*/
572 <    RealType rlist_;      /**< neighbor list radius */
665 >    // file names
666 >    string finalConfigFileName_;
667 >    string dumpFileName_;
668 >    string statFileName_;
669 >    string restFileName_;
670  
671 <    int ljsp_; /**< use shifted potential for LJ*/
672 <    int ljsf_; /**< use shifted force for LJ*/
673 <
577 <    bool fortranInitialized_; /**< flag indicate whether fortran side
578 <                                 is initialized */
671 >    bool topologyDone_;  /** flag to indicate whether the topology has
672 >                             been scanned and all the relevant
673 >                             bookkeeping has been done*/
674      
675      bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
676                              the simulation box dipole moment */
677      
678      bool useAtomicVirial_; /**< flag to indicate whether or not we use
679                                Atomic Virials to calculate the pressure */
680 <
681 <    public:
587 <     /**
588 <      * return an integral objects by its global index. In MPI version, if the StuntDouble with specified
589 <      * global index does not belong to local processor, a NULL will be return.
590 <      */
591 <      StuntDouble* getIOIndexToIntegrableObject(int index);
592 <      void setIOIndexToIntegrableObject(const std::vector<StuntDouble*>& v);
593 <    private:
594 <      std::vector<StuntDouble*> IOIndexToIntegrableObject;
595 <  //public:
596 <    //void setStuntDoubleFromGlobalIndex(std::vector<StuntDouble*> v);
680 >    
681 >  public:
682      /**
683 <     * return a StuntDouble by its global index. In MPI version, if the StuntDouble with specified
684 <     * global index does not belong to local processor, a NULL will be return.
685 <     */
686 <    //StuntDouble* getStuntDoubleFromGlobalIndex(int index);
687 <  //private:
688 <    //std::vector<StuntDouble*> sdByGlobalIndex_;
683 >     * return an integral objects by its global index. In MPI
684 >     * version, if the StuntDouble with specified global index does
685 >      * not belong to local processor, a NULL will be return.
686 >      */
687 >    StuntDouble* getIOIndexToIntegrableObject(int index);
688 >    void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v);
689      
690 <    //in Parallel version, we need MolToProc
690 >  private:
691 >    vector<StuntDouble*> IOIndexToIntegrableObject;
692 >    
693    public:
694                  
695      /**
# Line 614 | Line 701 | namespace OpenMD{
701        //assert(globalIndex < molToProcMap_.size());
702        return molToProcMap_[globalIndex];
703      }
704 <
704 >    
705      /**
706       * Set MolToProcMap array
620     * @see #SimCreator::divideMolecules
707       */
708 <    void setMolToProcMap(const std::vector<int>& molToProcMap) {
708 >    void setMolToProcMap(const vector<int>& molToProcMap) {
709        molToProcMap_ = molToProcMap;
710      }
711          
712    private:
627
628    void setupFortranParallel();
713          
714      /**
715       * The size of molToProcMap_ is equal to total number of molecules
716       * in the system.  It maps a molecule to the processor on which it
717       * resides. it is filled by SimCreator once and only once.
718       */        
719 <    std::vector<int> molToProcMap_;
719 >    vector<int> molToProcMap_;
720  
637
721    };
722  
723   } //namespace OpenMD

Comparing trunk/src/brains/SimInfo.hpp (property svn:keywords):
Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
Revision 1953 by gezelter, Thu Dec 5 18:19:26 2013 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines