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

Comparing branches/development/src/brains/SimInfo.hpp (file contents):
Revision 1503 by gezelter, Sat Oct 2 19:54:41 2010 UTC vs.
Revision 1838 by gezelter, Tue Jan 22 16:20:11 2013 UTC

# Line 36 | Line 36
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).                        
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/Electrostatic.hpp"
66 > #include "nonbonded/SwitchingFunction.hpp"
67  
68 < //another nonsense macro declaration
68 < #define __OPENMD_C
69 < #include "brains/fSimulation.h"
70 <
68 > using namespace std;
69   namespace OpenMD{
70 <
73 <  //forward decalration
70 >  //forward declaration
71    class SnapshotManager;
72    class Molecule;
73    class SelectionManager;
74    class StuntDouble;
75 <  class Electrostatic;
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
98 <     * @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 129 | 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_;
# Line 158 | Line 163 | namespace OpenMD{
163        return nAtoms_;
164      }
165  
166 +    /** Returns the number of effective cutoff groups on local processor */
167 +    unsigned int getNLocalCutoffGroups();
168 +
169      /** Returns the number of local bonds */        
170      unsigned int getNBonds(){
171        return nBonds_;
# Line 211 | Line 219 | namespace OpenMD{
219       */
220      Molecule* nextMolecule(MoleculeIterator& i);
221  
222 +    /** Returns the total number of fluctuating charges that are present */
223 +    int getNFluctuatingCharges() {
224 +      return nGlobalFluctuatingCharges_;
225 +    }
226 +
227      /** Returns the number of degrees of freedom */
228      int getNdf() {
229        return ndf_ - getFdf();
230      }
231  
232 +    /** Returns the number of degrees of freedom (LOCAL) */
233 +    int getNdfLocal() {
234 +      return ndfLocal_;
235 +    }
236 +
237      /** Returns the number of raw degrees of freedom */
238      int getNdfRaw() {
239        return ndfRaw_;
# Line 233 | Line 251 | namespace OpenMD{
251  
252      int getFdf();
253      
254 <    //getNZconstraint and setNZconstraint ruin the coherent of SimInfo class, need refactorying
254 >    //getNZconstraint and setNZconstraint ruin the coherence of
255 >    //SimInfo class, need refactoring
256          
257      /** Returns the total number of z-constraint molecules in the system */
258      int getNZconstraint() {
# Line 251 | Line 270 | namespace OpenMD{
270      SnapshotManager* getSnapshotManager() {
271        return sman_;
272      }
273 <
273 >    /** 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      /** Sets the snapshot manager. */
283      void setSnapshotManager(SnapshotManager* sman);
284          
# Line 264 | Line 291 | namespace OpenMD{
291        return simParams_;
292      }
293  
267    /** Returns the velocity of center of mass of the whole system.*/
268    Vector3d getComVel();
269
270    /** Returns the center of the mass of the whole system.*/
271    Vector3d getCom();
272   /** Returns the center of the mass and Center of Mass velocity of the whole system.*/
273    void getComAll(Vector3d& com,Vector3d& comVel);
274
275    /** Returns intertia tensor for the entire system and system Angular Momentum.*/
276    void getInertiaTensor(Mat3x3d &intertiaTensor,Vector3d &angularMomentum);
277    
278    /** Returns system angular momentum */
279    Vector3d getAngularMomentum();
280
281    /** Returns volume of system as estimated by an ellipsoid defined by the radii of gyration*/
282    void getGyrationalVolume(RealType &vol);
283    /** Overloaded version of gyrational volume that also returns det(I) so dV/dr can be calculated*/
284    void getGyrationalVolume(RealType &vol, RealType &detI);
285    /** main driver function to interact with fortran during the initialization and molecule migration */
294      void update();
295 +    /**
296 +     * Do final bookkeeping before Force managers need their data.
297 +     */
298 +    void prepareTopology();
299 +
300  
301      /** Returns the local index manager */
302      LocalIndexManager* getLocalIndexManager() {
# Line 320 | Line 333 | namespace OpenMD{
333        return globalMolMembership_[id];
334      }
335  
336 <    RealType getRcut() {
337 <      return rcut_;
338 <    }
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 <    RealType getRsw() {
344 <      return rsw_;
345 <    }
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  
331    RealType getList() {
332      return rlist_;
333    }
350          
351 <    std::string getFinalConfigFileName() {
351 >    string getFinalConfigFileName() {
352        return finalConfigFileName_;
353      }
354  
355 <    void setFinalConfigFileName(const std::string& fileName) {
355 >    void setFinalConfigFileName(const string& fileName) {
356        finalConfigFileName_ = fileName;
357      }
358  
359 <    std::string getRawMetaData() {
359 >    string getRawMetaData() {
360        return rawMetaData_;
361      }
362 <    void setRawMetaData(const std::string& rawMetaData) {
362 >    void setRawMetaData(const string& rawMetaData) {
363        rawMetaData_ = rawMetaData;
364      }
365          
366 <    std::string getDumpFileName() {
366 >    string getDumpFileName() {
367        return dumpFileName_;
368      }
369          
370 <    void setDumpFileName(const std::string& fileName) {
370 >    void setDumpFileName(const string& fileName) {
371        dumpFileName_ = fileName;
372      }
373  
374 <    std::string getStatFileName() {
374 >    string getStatFileName() {
375        return statFileName_;
376      }
377          
378 <    void setStatFileName(const std::string& fileName) {
378 >    void setStatFileName(const string& fileName) {
379        statFileName_ = fileName;
380      }
381          
382 <    std::string getRestFileName() {
382 >    string getRestFileName() {
383        return restFileName_;
384      }
385          
386 <    void setRestFileName(const std::string& fileName) {
386 >    void setRestFileName(const string& fileName) {
387        restFileName_ = fileName;
388      }
389  
390      /**
391       * Sets GlobalGroupMembership
376     * @see #SimCreator::setGlobalIndex
392       */  
393 <    void setGlobalGroupMembership(const std::vector<int>& globalGroupMembership) {
393 >    void setGlobalGroupMembership(const vector<int>& globalGroupMembership) {
394        assert(globalGroupMembership.size() == static_cast<size_t>(nGlobalAtoms_));
395        globalGroupMembership_ = globalGroupMembership;
396      }
397  
398      /**
399       * Sets GlobalMolMembership
385     * @see #SimCreator::setGlobalIndex
400       */        
401 <    void setGlobalMolMembership(const std::vector<int>& globalMolMembership) {
401 >    void setGlobalMolMembership(const vector<int>& globalMolMembership) {
402        assert(globalMolMembership.size() == static_cast<size_t>(nGlobalAtoms_));
403        globalMolMembership_ = globalMolMembership;
404      }
405  
406  
407 <    bool isFortranInitialized() {
408 <      return fortranInitialized_;
407 >    bool isTopologyDone() {
408 >      return topologyDone_;
409      }
410          
411      bool getCalcBoxDipole() {
# Line 402 | Line 416 | namespace OpenMD{
416        return useAtomicVirial_;
417      }
418  
405    //below functions are just forward functions
406    //To compose or to inherit is always a hot debate. In general, is-a relation need subclassing, in the
407    //the other hand, has-a relation need composing.
419      /**
420       * Adds property into property map
421       * @param genData GenericData to be added into PropertyMap
# Line 415 | Line 426 | namespace OpenMD{
426       * Removes property from PropertyMap by name
427       * @param propName the name of property to be removed
428       */
429 <    void removeProperty(const std::string& propName);
429 >    void removeProperty(const string& propName);
430  
431      /**
432       * clear all of the properties
# Line 426 | Line 437 | namespace OpenMD{
437       * Returns all names of properties
438       * @return all names of properties
439       */
440 <    std::vector<std::string> getPropertyNames();
440 >    vector<string> getPropertyNames();
441  
442      /**
443       * Returns all of the properties in PropertyMap
444       * @return all of the properties in PropertyMap
445       */      
446 <    std::vector<GenericData*> getProperties();
446 >    vector<GenericData*> getProperties();
447  
448      /**
449       * Returns property
# Line 440 | Line 451 | namespace OpenMD{
451       * @return a pointer point to property with propName. If no property named propName
452       * exists, return NULL
453       */      
454 <    GenericData* getPropertyByName(const std::string& propName);
454 >    GenericData* getPropertyByName(const string& propName);
455  
456      /**
457       * add all special interaction pairs (including excluded
# Line 454 | Line 465 | namespace OpenMD{
465       */
466      void removeInteractionPairs(Molecule* mol);
467  
468 <
469 <    /** Returns the unique atom types of local processor in an array */
459 <    std::set<AtomType*> getUniqueAtomTypes();
468 >    /** Returns the set of atom types present in this simulation */
469 >    set<AtomType*> getSimulatedAtomTypes();
470          
471 <    friend std::ostream& operator <<(std::ostream& o, SimInfo& info);
471 >    friend ostream& operator <<(ostream& o, SimInfo& info);
472  
473      void getCutoff(RealType& rcut, RealType& rsw);
474          
475    private:
476  
477 <    /** fill up the simtype struct*/
478 <    void setupSimType();
477 >    /** fill up the simtype struct and other simulation-related variables */
478 >    void setupSimVariables();
479  
470    /**
471     * Setup Fortran Simulation
472     * @see #setupFortranParallel
473     */
474    void setupFortranSim();
480  
476    /** Figure out the radius of cutoff, radius of switching function and pass them to fortran */
477    void setupCutoff();
478
479    /** Figure out which coulombic correction method to use and pass to fortran */
480    void setupElectrostaticSummationMethod( int isError );
481
482    /** Figure out which polynomial type to use for the switching function */
483    void setupSwitchingFunction();
484
481      /** Determine if we need to accumulate the simulation box dipole */
482      void setupAccumulateBoxDipole();
483  
# Line 490 | Line 486 | namespace OpenMD{
486      void calcNdfRaw();
487      void calcNdfTrans();
488  
493    ForceField* forceField_;      
494    Globals* simParams_;
495
496    std::map<int, Molecule*>  molecules_; /**< Molecule array */
497
489      /**
490 <     * Adds molecule stamp and the total number of the molecule with same molecule stamp in the whole
491 <     * system.
490 >     * Adds molecule stamp and the total number of the molecule with
491 >     * same molecule stamp in the whole system.
492       */
493      void addMoleculeStamp(MoleculeStamp* molStamp, int nmol);
503        
504    //degress of freedom
505    int ndf_;           /**< number of degress of freedom (excludes constraints),  ndf_ is local */
506    int fdf_local;       /**< number of frozen degrees of freedom */
507    int fdf_;            /**< number of frozen degrees of freedom */
508    int ndfRaw_;    /**< number of degress of freedom (includes constraints),  ndfRaw_ is local */
509    int ndfTrans_; /**< number of translation degress of freedom, ndfTrans_ is local */
510    int nZconstraint_; /** number of  z-constraint molecules, nZconstraint_ is global */
511        
512    //number of global objects
513    int nGlobalMols_;       /**< number of molecules in the system */
514    int nGlobalAtoms_;   /**< number of atoms in the system */
515    int nGlobalCutoffGroups_; /**< number of cutoff groups in this system */
516    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
517    int nGlobalRigidBodies_; /**< number of rigid bodies in this system */
518    /**
519     * the size of globalGroupMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
520     * corresponding content is the global index of cutoff group this atom belong to.
521     * It is filled by SimCreator once and only once, since it never changed during the simulation.
522     */
523    std::vector<int> globalGroupMembership_;
494  
495 <    /**
496 <     * the size of globalMolMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
497 <     * corresponding content is the global index of molecule this atom belong to.
528 <     * It is filled by SimCreator once and only once, since it is never changed during the simulation.
529 <     */
530 <    std::vector<int> globalMolMembership_;        
495 >    // Other classes holdingn important information
496 >    ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */
497 >    Globals* simParams_;     /**< provides access to simulation parameters set by user */
498  
499 <        
533 <    std::vector<int> molStampIds_;                                /**< stamp id array of all molecules in the system */
534 <    std::vector<MoleculeStamp*> moleculeStamps_;      /**< molecule stamps array */        
535 <        
536 <    //number of local objects
499 >    ///  Counts of local objects
500      int nAtoms_;              /**< number of atoms in local processor */
501      int nBonds_;              /**< number of bonds in local processor */
502      int nBends_;              /**< number of bends in local processor */
# Line 543 | Line 506 | namespace OpenMD{
506      int nIntegrableObjects_;  /**< number of integrable objects in local processor */
507      int nCutoffGroups_;       /**< number of cutoff groups in local processor */
508      int nConstraints_;        /**< number of constraints in local processors */
509 +    int nFluctuatingCharges_; /**< number of fluctuating charges in local processor */
510 +        
511 +    /// Counts of global objects
512 +    int nGlobalMols_;              /**< number of molecules in the system (GLOBAL) */
513 +    int nGlobalAtoms_;             /**< number of atoms in the system (GLOBAL) */
514 +    int nGlobalCutoffGroups_;      /**< number of cutoff groups in this system (GLOBAL) */
515 +    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
516 +    int nGlobalRigidBodies_;       /**< number of rigid bodies in this system (GLOBAL) */
517 +    int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */
518 +    
519 +      
520 +    /// Degress of freedom
521 +    int ndf_;          /**< number of degress of freedom (excludes constraints) (LOCAL) */
522 +    int ndfLocal_;     /**< number of degrees of freedom (LOCAL, excludes constraints) */
523 +    int fdf_local;     /**< number of frozen degrees of freedom (LOCAL) */
524 +    int fdf_;          /**< number of frozen degrees of freedom (GLOBAL) */
525 +    int ndfRaw_;       /**< number of degress of freedom (includes constraints),  (LOCAL) */
526 +    int ndfTrans_;     /**< number of translation degress of freedom, (LOCAL) */
527 +    int nZconstraint_; /**< number of  z-constraint molecules (GLOBAL) */
528  
529 <    simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/
530 <    PairList excludedInteractions_;      
531 <    PairList oneTwoInteractions_;      
532 <    PairList oneThreeInteractions_;      
533 <    PairList oneFourInteractions_;      
534 <    PropertyMap properties_;                  /**< Generic Property */
535 <    SnapshotManager* sman_;               /**< SnapshotManager */
529 >    /// logicals
530 >    bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */
531 >    bool usesDirectionalAtoms_;   /**< are there atoms with position AND orientation? */
532 >    bool usesMetallicAtoms_;      /**< are there transition metal atoms? */
533 >    bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */
534 >    bool usesFluctuatingCharges_; /**< are there fluctuating charges? */
535 >    bool usesAtomicVirial_;       /**< are we computing atomic virials? */
536 >    bool requiresPrepair_;        /**< does this simulation require a pre-pair loop? */
537 >    bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
538 >    bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
539  
540 +  public:
541 +    bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
542 +    bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
543 +    bool usesFluctuatingCharges() { return usesFluctuatingCharges_; }
544 +    bool usesAtomicVirial() { return usesAtomicVirial_; }
545 +    bool requiresPrepair() { return requiresPrepair_; }
546 +    bool requiresSkipCorrection() { return requiresSkipCorrection_;}
547 +    bool requiresSelfCorrection() { return requiresSelfCorrection_;}
548 +
549 +  private:
550 +    /// Data structures holding primary simulation objects
551 +    map<int, Molecule*>  molecules_;  /**< map holding pointers to LOCAL molecules */
552 +
553 +    /// Stamps are templates for objects that are then used to create
554 +    /// groups of objects.  For example, a molecule stamp contains
555 +    /// information on how to build that molecule (i.e. the topology,
556 +    /// the atoms, the bonds, etc.)  Once the system is built, the
557 +    /// stamps are no longer useful.
558 +    vector<int> molStampIds_;                /**< stamp id for molecules in the system */
559 +    vector<MoleculeStamp*> moleculeStamps_;  /**< molecule stamps array */        
560 +
561 +    /**
562 +     * A vector that maps between the global index of an atom, and the
563 +     * global index of cutoff group the atom belong to.  It is filled
564 +     * by SimCreator once and only once, since it never changed during
565 +     * the simulation.  It should be nGlobalAtoms_ in size.
566 +     */
567 +    vector<int> globalGroupMembership_;
568 +  public:
569 +    vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
570 +  private:
571 +
572 +    /**
573 +     * A vector that maps between the global index of an atom and the
574 +     * global index of the molecule the atom belongs to.  It is filled
575 +     * by SimCreator once and only once, since it is never changed
576 +     * during the simulation. It shoudl be nGlobalAtoms_ in size.
577 +     */
578 +    vector<int> globalMolMembership_;
579 +
580      /**
581 <     * The reason to have a local index manager is that when molecule is migrating to other processors,
582 <     * the atoms and the rigid-bodies will release their local indices to LocalIndexManager. Combining the
583 <     * information of molecule migrating to current processor, Migrator class can query  the LocalIndexManager
584 <     * to make a efficient data moving plan.
581 >     * A vector that maps between the local index of an atom and the
582 >     * index of the AtomType.
583 >     */
584 >    vector<int> identArray_;
585 >  public:
586 >    vector<int> getIdentArray() { return identArray_; }
587 >  private:
588 >    
589 >    /**
590 >     * A vector which contains the fractional contribution of an
591 >     * atom's mass to the total mass of the cutoffGroup that atom
592 >     * belongs to.  In the case of single atom cutoff groups, the mass
593 >     * factor for that atom is 1.  For massless atoms, the factor is
594 >     * also 1.
595 >     */
596 >    vector<RealType> massFactors_;
597 >  public:
598 >    vector<RealType> getMassFactors() { return massFactors_; }
599 >
600 >    PairList* getExcludedInteractions() { return &excludedInteractions_; }
601 >    PairList* getOneTwoInteractions() { return &oneTwoInteractions_; }
602 >    PairList* getOneThreeInteractions() { return &oneThreeInteractions_; }
603 >    PairList* getOneFourInteractions() { return &oneFourInteractions_; }
604 >
605 >  private:
606 >              
607 >    /// lists to handle atoms needing special treatment in the non-bonded interactions
608 >    PairList excludedInteractions_;  /**< atoms excluded from interacting with each other */
609 >    PairList oneTwoInteractions_;    /**< atoms that are directly Bonded */
610 >    PairList oneThreeInteractions_;  /**< atoms sharing a Bend */    
611 >    PairList oneFourInteractions_;   /**< atoms sharing a Torsion */
612 >
613 >    PropertyMap properties_;       /**< Generic Properties can be added */
614 >    SnapshotManager* sman_;        /**< SnapshotManager (handles particle positions, etc.) */
615 >    int storageLayout_;            /**< Bits to tell how much data to store on each object */
616 >
617 >    /**
618 >     * The reason to have a local index manager is that when molecule
619 >     * is migrating to other processors, the atoms and the
620 >     * rigid-bodies will release their local indices to
621 >     * LocalIndexManager. Combining the information of molecule
622 >     * migrating to current processor, Migrator class can query the
623 >     * LocalIndexManager to make a efficient data moving plan.
624       */        
625      LocalIndexManager localIndexMan_;
626  
627      // unparsed MetaData block for storing in Dump and EOR files:
628 <    std::string rawMetaData_;
628 >    string rawMetaData_;
629  
630 <    //file names
631 <    std::string finalConfigFileName_;
632 <    std::string dumpFileName_;
633 <    std::string statFileName_;
634 <    std::string restFileName_;
571 <        
572 <    RealType rcut_;       /**< cutoff radius*/
573 <    RealType rsw_;        /**< radius of switching function*/
574 <    RealType rlist_;      /**< neighbor list radius */
630 >    // file names
631 >    string finalConfigFileName_;
632 >    string dumpFileName_;
633 >    string statFileName_;
634 >    string restFileName_;
635  
636 <    int ljsp_; /**< use shifted potential for LJ*/
637 <    int ljsf_; /**< use shifted force for LJ*/
638 <
579 <    bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */
636 >    bool topologyDone_;  /** flag to indicate whether the topology has
637 >                             been scanned and all the relevant
638 >                             bookkeeping has been done*/
639      
640      bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
641                              the simulation box dipole moment */
642      
643      bool useAtomicVirial_; /**< flag to indicate whether or not we use
644                                Atomic Virials to calculate the pressure */
645 <
646 <    public:
588 <     /**
589 <      * return an integral objects by its global index. In MPI version, if the StuntDouble with specified
590 <      * global index does not belong to local processor, a NULL will be return.
591 <      */
592 <      StuntDouble* getIOIndexToIntegrableObject(int index);
593 <      void setIOIndexToIntegrableObject(const std::vector<StuntDouble*>& v);
594 <    private:
595 <      std::vector<StuntDouble*> IOIndexToIntegrableObject;
596 <  //public:
597 <    //void setStuntDoubleFromGlobalIndex(std::vector<StuntDouble*> v);
645 >    
646 >  public:
647      /**
648 <     * return a StuntDouble by its global index. In MPI version, if the StuntDouble with specified
649 <     * global index does not belong to local processor, a NULL will be return.
650 <     */
651 <    //StuntDouble* getStuntDoubleFromGlobalIndex(int index);
652 <  //private:
653 <    //std::vector<StuntDouble*> sdByGlobalIndex_;
648 >     * return an integral objects by its global index. In MPI
649 >     * version, if the StuntDouble with specified global index does
650 >      * not belong to local processor, a NULL will be return.
651 >      */
652 >    StuntDouble* getIOIndexToIntegrableObject(int index);
653 >    void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v);
654      
655 <    //in Parallel version, we need MolToProc
655 >  private:
656 >    vector<StuntDouble*> IOIndexToIntegrableObject;
657 >    
658    public:
659                  
660      /**
# Line 615 | Line 666 | namespace OpenMD{
666        //assert(globalIndex < molToProcMap_.size());
667        return molToProcMap_[globalIndex];
668      }
669 <
669 >    
670      /**
671       * Set MolToProcMap array
621     * @see #SimCreator::divideMolecules
672       */
673 <    void setMolToProcMap(const std::vector<int>& molToProcMap) {
673 >    void setMolToProcMap(const vector<int>& molToProcMap) {
674        molToProcMap_ = molToProcMap;
675      }
676          
677    private:
628
629    void setupFortranParallel();
678          
679      /**
680       * The size of molToProcMap_ is equal to total number of molecules
681       * in the system.  It maps a molecule to the processor on which it
682       * resides. it is filled by SimCreator once and only once.
683       */        
684 <    std::vector<int> molToProcMap_;
684 >    vector<int> molToProcMap_;
685  
638
686    };
687  
688   } //namespace OpenMD

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines