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 1848 by gezelter, Mon Feb 4 21:13:46 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() {
303        return &localIndexMan_;
# 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) {
394 <      assert(globalGroupMembership.size() == static_cast<size_t>(nGlobalAtoms_));
395 <      globalGroupMembership_ = globalGroupMembership;
393 >    void setGlobalGroupMembership(const vector<int>& ggm) {
394 >      assert(ggm.size() == static_cast<size_t>(nGlobalAtoms_));
395 >      globalGroupMembership_ = ggm;
396      }
397  
398      /**
399       * Sets GlobalMolMembership
385     * @see #SimCreator::setGlobalIndex
400       */        
401 <    void setGlobalMolMembership(const std::vector<int>& globalMolMembership) {
402 <      assert(globalMolMembership.size() == static_cast<size_t>(nGlobalAtoms_));
403 <      globalMolMembership_ = globalMolMembership;
401 >    void setGlobalMolMembership(const vector<int>& gmm) {
402 >      assert(gmm.size() == (static_cast<size_t>(nGlobalAtoms_ +
403 >                                                nGlobalRigidBodies_)));
404 >      globalMolMembership_ = gmm;
405      }
406  
407  
408 <    bool isFortranInitialized() {
409 <      return fortranInitialized_;
408 >    bool isTopologyDone() {
409 >      return topologyDone_;
410      }
411          
412      bool getCalcBoxDipole() {
# Line 402 | Line 417 | namespace OpenMD{
417        return useAtomicVirial_;
418      }
419  
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.
420      /**
421       * Adds property into property map
422       * @param genData GenericData to be added into PropertyMap
# Line 415 | Line 427 | namespace OpenMD{
427       * Removes property from PropertyMap by name
428       * @param propName the name of property to be removed
429       */
430 <    void removeProperty(const std::string& propName);
430 >    void removeProperty(const string& propName);
431  
432      /**
433       * clear all of the properties
# Line 426 | Line 438 | namespace OpenMD{
438       * Returns all names of properties
439       * @return all names of properties
440       */
441 <    std::vector<std::string> getPropertyNames();
441 >    vector<string> getPropertyNames();
442  
443      /**
444       * Returns all of the properties in PropertyMap
445       * @return all of the properties in PropertyMap
446       */      
447 <    std::vector<GenericData*> getProperties();
447 >    vector<GenericData*> getProperties();
448  
449      /**
450       * Returns property
# Line 440 | Line 452 | namespace OpenMD{
452       * @return a pointer point to property with propName. If no property named propName
453       * exists, return NULL
454       */      
455 <    GenericData* getPropertyByName(const std::string& propName);
455 >    GenericData* getPropertyByName(const string& propName);
456  
457      /**
458       * add all special interaction pairs (including excluded
# Line 454 | Line 466 | namespace OpenMD{
466       */
467      void removeInteractionPairs(Molecule* mol);
468  
469 <
470 <    /** Returns the unique atom types of local processor in an array */
459 <    std::set<AtomType*> getUniqueAtomTypes();
469 >    /** Returns the set of atom types present in this simulation */
470 >    set<AtomType*> getSimulatedAtomTypes();
471          
472 <    friend std::ostream& operator <<(std::ostream& o, SimInfo& info);
472 >    friend ostream& operator <<(ostream& o, SimInfo& info);
473  
474      void getCutoff(RealType& rcut, RealType& rsw);
475          
476    private:
477  
478 <    /** fill up the simtype struct*/
479 <    void setupSimType();
478 >    /** fill up the simtype struct and other simulation-related variables */
479 >    void setupSimVariables();
480  
470    /**
471     * Setup Fortran Simulation
472     * @see #setupFortranParallel
473     */
474    void setupFortranSim();
481  
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
482      /** Determine if we need to accumulate the simulation box dipole */
483      void setupAccumulateBoxDipole();
484  
# Line 490 | Line 487 | namespace OpenMD{
487      void calcNdfRaw();
488      void calcNdfTrans();
489  
493    ForceField* forceField_;      
494    Globals* simParams_;
495
496    std::map<int, Molecule*>  molecules_; /**< Molecule array */
497
490      /**
491 <     * Adds molecule stamp and the total number of the molecule with same molecule stamp in the whole
492 <     * system.
491 >     * Adds molecule stamp and the total number of the molecule with
492 >     * same molecule stamp in the whole system.
493       */
494      void addMoleculeStamp(MoleculeStamp* molStamp, int nmol);
495 <        
496 <    //degress of freedom
497 <    int ndf_;           /**< number of degress of freedom (excludes constraints),  ndf_ is local */
498 <    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_;
495 >
496 >    // Other classes holdingn important information
497 >    ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */
498 >    Globals* simParams_;     /**< provides access to simulation parameters set by user */
499  
500 <    /**
526 <     * the size of globalMolMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
527 <     * 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_;        
531 <
532 <        
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
500 >    ///  Counts of local objects
501      int nAtoms_;              /**< number of atoms in local processor */
502      int nBonds_;              /**< number of bonds in local processor */
503      int nBends_;              /**< number of bends in local processor */
# Line 543 | Line 507 | namespace OpenMD{
507      int nIntegrableObjects_;  /**< number of integrable objects in local processor */
508      int nCutoffGroups_;       /**< number of cutoff groups in local processor */
509      int nConstraints_;        /**< number of constraints in local processors */
510 +    int nFluctuatingCharges_; /**< number of fluctuating charges in local processor */
511 +        
512 +    /// Counts of global objects
513 +    int nGlobalMols_;              /**< number of molecules in the system (GLOBAL) */
514 +    int nGlobalAtoms_;             /**< number of atoms in the system (GLOBAL) */
515 +    int nGlobalCutoffGroups_;      /**< number of cutoff groups in this system (GLOBAL) */
516 +    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
517 +    int nGlobalRigidBodies_;       /**< number of rigid bodies in this system (GLOBAL) */
518 +    int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */
519 +    
520 +      
521 +    /// Degress of freedom
522 +    int ndf_;          /**< number of degress of freedom (excludes constraints) (LOCAL) */
523 +    int ndfLocal_;     /**< number of degrees of freedom (LOCAL, excludes constraints) */
524 +    int fdf_local;     /**< number of frozen degrees of freedom (LOCAL) */
525 +    int fdf_;          /**< number of frozen degrees of freedom (GLOBAL) */
526 +    int ndfRaw_;       /**< number of degress of freedom (includes constraints),  (LOCAL) */
527 +    int ndfTrans_;     /**< number of translation degress of freedom, (LOCAL) */
528 +    int nZconstraint_; /**< number of  z-constraint molecules (GLOBAL) */
529  
530 <    simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/
531 <    PairList excludedInteractions_;      
532 <    PairList oneTwoInteractions_;      
533 <    PairList oneThreeInteractions_;      
534 <    PairList oneFourInteractions_;      
535 <    PropertyMap properties_;                  /**< Generic Property */
536 <    SnapshotManager* sman_;               /**< SnapshotManager */
530 >    /// logicals
531 >    bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */
532 >    bool usesDirectionalAtoms_;   /**< are there atoms with position AND orientation? */
533 >    bool usesMetallicAtoms_;      /**< are there transition metal atoms? */
534 >    bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */
535 >    bool usesFluctuatingCharges_; /**< are there fluctuating charges? */
536 >    bool usesAtomicVirial_;       /**< are we computing atomic virials? */
537 >    bool requiresPrepair_;        /**< does this simulation require a pre-pair loop? */
538 >    bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
539 >    bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
540  
541 +  public:
542 +    bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
543 +    bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
544 +    bool usesFluctuatingCharges() { return usesFluctuatingCharges_; }
545 +    bool usesAtomicVirial() { return usesAtomicVirial_; }
546 +    bool requiresPrepair() { return requiresPrepair_; }
547 +    bool requiresSkipCorrection() { return requiresSkipCorrection_;}
548 +    bool requiresSelfCorrection() { return requiresSelfCorrection_;}
549 +
550 +  private:
551 +    /// Data structures holding primary simulation objects
552 +    map<int, Molecule*>  molecules_;  /**< map holding pointers to LOCAL molecules */
553 +
554 +    /// Stamps are templates for objects that are then used to create
555 +    /// groups of objects.  For example, a molecule stamp contains
556 +    /// information on how to build that molecule (i.e. the topology,
557 +    /// the atoms, the bonds, etc.)  Once the system is built, the
558 +    /// stamps are no longer useful.
559 +    vector<int> molStampIds_;                /**< stamp id for molecules in the system */
560 +    vector<MoleculeStamp*> moleculeStamps_;  /**< molecule stamps array */        
561 +
562 +    /**
563 +     * A vector that maps between the global index of an atom, and the
564 +     * global index of cutoff group the atom belong to.  It is filled
565 +     * by SimCreator once and only once, since it never changed during
566 +     * the simulation.  It should be nGlobalAtoms_ in size.
567 +     */
568 +    vector<int> globalGroupMembership_;
569 +  public:
570 +    vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
571 +  private:
572 +
573 +    /**
574 +     * A vector that maps between the global index of an atom and the
575 +     * global index of the molecule the atom belongs to.  It is filled
576 +     * by SimCreator once and only once, since it is never changed
577 +     * during the simulation. It shoudl be nGlobalAtoms_ in size.
578 +     */
579 +    vector<int> globalMolMembership_;
580 +
581      /**
582 <     * The reason to have a local index manager is that when molecule is migrating to other processors,
583 <     * the atoms and the rigid-bodies will release their local indices to LocalIndexManager. Combining the
584 <     * information of molecule migrating to current processor, Migrator class can query  the LocalIndexManager
585 <     * to make a efficient data moving plan.
582 >     * A vector that maps between the local index of an atom and the
583 >     * index of the AtomType.
584 >     */
585 >    vector<int> identArray_;
586 >  public:
587 >    vector<int> getIdentArray() { return identArray_; }
588 >  private:
589 >    
590 >    /**
591 >     * A vector which contains the fractional contribution of an
592 >     * atom's mass to the total mass of the cutoffGroup that atom
593 >     * belongs to.  In the case of single atom cutoff groups, the mass
594 >     * factor for that atom is 1.  For massless atoms, the factor is
595 >     * also 1.
596 >     */
597 >    vector<RealType> massFactors_;
598 >  public:
599 >    vector<RealType> getMassFactors() { return massFactors_; }
600 >
601 >    PairList* getExcludedInteractions() { return &excludedInteractions_; }
602 >    PairList* getOneTwoInteractions() { return &oneTwoInteractions_; }
603 >    PairList* getOneThreeInteractions() { return &oneThreeInteractions_; }
604 >    PairList* getOneFourInteractions() { return &oneFourInteractions_; }
605 >
606 >  private:
607 >              
608 >    /// lists to handle atoms needing special treatment in the non-bonded interactions
609 >    PairList excludedInteractions_;  /**< atoms excluded from interacting with each other */
610 >    PairList oneTwoInteractions_;    /**< atoms that are directly Bonded */
611 >    PairList oneThreeInteractions_;  /**< atoms sharing a Bend */    
612 >    PairList oneFourInteractions_;   /**< atoms sharing a Torsion */
613 >
614 >    PropertyMap properties_;       /**< Generic Properties can be added */
615 >    SnapshotManager* sman_;        /**< SnapshotManager (handles particle positions, etc.) */
616 >    int storageLayout_;            /**< Bits to tell how much data to store on each object */
617 >
618 >    /**
619 >     * The reason to have a local index manager is that when molecule
620 >     * is migrating to other processors, the atoms and the
621 >     * rigid-bodies will release their local indices to
622 >     * LocalIndexManager. Combining the information of molecule
623 >     * migrating to current processor, Migrator class can query the
624 >     * LocalIndexManager to make a efficient data moving plan.
625       */        
626      LocalIndexManager localIndexMan_;
627  
628      // unparsed MetaData block for storing in Dump and EOR files:
629 <    std::string rawMetaData_;
629 >    string rawMetaData_;
630  
631 <    //file names
632 <    std::string finalConfigFileName_;
633 <    std::string dumpFileName_;
634 <    std::string statFileName_;
635 <    std::string restFileName_;
571 <        
572 <    RealType rcut_;       /**< cutoff radius*/
573 <    RealType rsw_;        /**< radius of switching function*/
574 <    RealType rlist_;      /**< neighbor list radius */
631 >    // file names
632 >    string finalConfigFileName_;
633 >    string dumpFileName_;
634 >    string statFileName_;
635 >    string restFileName_;
636  
637 <    int ljsp_; /**< use shifted potential for LJ*/
638 <    int ljsf_; /**< use shifted force for LJ*/
639 <
579 <    bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */
637 >    bool topologyDone_;  /** flag to indicate whether the topology has
638 >                             been scanned and all the relevant
639 >                             bookkeeping has been done*/
640      
641      bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
642                              the simulation box dipole moment */
643      
644      bool useAtomicVirial_; /**< flag to indicate whether or not we use
645                                Atomic Virials to calculate the pressure */
646 <
647 <    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);
646 >    
647 >  public:
648      /**
649 <     * return a StuntDouble by its global index. In MPI version, if the StuntDouble with specified
650 <     * global index does not belong to local processor, a NULL will be return.
651 <     */
652 <    //StuntDouble* getStuntDoubleFromGlobalIndex(int index);
653 <  //private:
654 <    //std::vector<StuntDouble*> sdByGlobalIndex_;
649 >     * return an integral objects by its global index. In MPI
650 >     * version, if the StuntDouble with specified global index does
651 >      * not belong to local processor, a NULL will be return.
652 >      */
653 >    StuntDouble* getIOIndexToIntegrableObject(int index);
654 >    void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v);
655      
656 <    //in Parallel version, we need MolToProc
656 >  private:
657 >    vector<StuntDouble*> IOIndexToIntegrableObject;
658 >    
659    public:
660                  
661      /**
# Line 615 | Line 667 | namespace OpenMD{
667        //assert(globalIndex < molToProcMap_.size());
668        return molToProcMap_[globalIndex];
669      }
670 <
670 >    
671      /**
672       * Set MolToProcMap array
621     * @see #SimCreator::divideMolecules
673       */
674 <    void setMolToProcMap(const std::vector<int>& molToProcMap) {
674 >    void setMolToProcMap(const vector<int>& molToProcMap) {
675        molToProcMap_ = molToProcMap;
676      }
677          
678    private:
628
629    void setupFortranParallel();
679          
680      /**
681       * The size of molToProcMap_ is equal to total number of molecules
682       * in the system.  It maps a molecule to the processor on which it
683       * resides. it is filled by SimCreator once and only once.
684       */        
685 <    std::vector<int> molToProcMap_;
685 >    vector<int> molToProcMap_;
686  
638
687    };
688  
689   } //namespace OpenMD

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines