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 1386 by gezelter, Fri Oct 23 18:41:09 2009 UTC vs.
Revision 1983 by gezelter, Tue Apr 15 20:36:19 2014 UTC

# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
35 + *                                                                      
36 + * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37 + * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 + * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 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
69 < #define __OOPSE_C
70 < #include "brains/fSimulation.h"
69 <
70 < namespace oopse{
71 <
72 <  //forward decalration
68 > using namespace std;
69 > namespace OpenMD{
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 OOPSE, 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 oopse{
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 <    int getNGlobalConstraints();
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 >    unsigned int getNGlobalConstraints() {
173 >      if (!hasNGlobalConstraints_) calcNConstraints();
174 >      return nGlobalConstraints_;
175 >    }
176      /**
177       * Returns the number of local molecules.
178       * @return the number of local molecules
# Line 156 | Line 186 | namespace oopse{
186        return nAtoms_;
187      }
188  
189 +    /** Returns the number of effective cutoff groups on local processor */
190 +    unsigned int getNLocalCutoffGroups();
191 +
192      /** Returns the number of local bonds */        
193      unsigned int getNBonds(){
194        return nBonds_;
# Line 171 | Line 204 | namespace oopse{
204        return nTorsions_;
205      }
206  
207 <    /** Returns the number of local torsions */        
207 >    /** Returns the number of local inversions */        
208      unsigned int getNInversions() {
209        return nInversions_;
210      }
# Line 209 | Line 242 | namespace oopse{
242       */
243      Molecule* nextMolecule(MoleculeIterator& i);
244  
245 +    /** Returns the total number of fluctuating charges that are present */
246 +    int getNFluctuatingCharges() {
247 +      return nGlobalFluctuatingCharges_;
248 +    }
249 +
250      /** Returns the number of degrees of freedom */
251      int getNdf() {
252        return ndf_ - getFdf();
253      }
254  
255 +    /** Returns the number of degrees of freedom (LOCAL) */
256 +    int getNdfLocal() {
257 +      return ndfLocal_;
258 +    }
259 +
260      /** Returns the number of raw degrees of freedom */
261      int getNdfRaw() {
262        return ndfRaw_;
# Line 231 | Line 274 | namespace oopse{
274  
275      int getFdf();
276      
277 <    //getNZconstraint and setNZconstraint ruin the coherent of SimInfo class, need refactorying
277 >    //getNZconstraint and setNZconstraint ruin the coherence of
278 >    //SimInfo class, need refactoring
279          
280      /** Returns the total number of z-constraint molecules in the system */
281      int getNZconstraint() {
# Line 249 | Line 293 | namespace oopse{
293      SnapshotManager* getSnapshotManager() {
294        return sman_;
295      }
296 <
296 >    /** Returns the storage layout (computed by SimCreator) */
297 >    int getStorageLayout() {
298 >      return storageLayout_;
299 >    }
300 >    /** Sets the storage layout (computed by SimCreator) */
301 >    void setStorageLayout(int sl) {
302 >      storageLayout_ = sl;
303 >    }
304 >    
305      /** Sets the snapshot manager. */
306      void setSnapshotManager(SnapshotManager* sman);
307          
# Line 262 | Line 314 | namespace oopse{
314        return simParams_;
315      }
316  
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 */
317      void update();
318 +    /**
319 +     * Do final bookkeeping before Force managers need their data.
320 +     */
321 +    void prepareTopology();
322  
323 +
324      /** Returns the local index manager */
325      LocalIndexManager* getLocalIndexManager() {
326        return &localIndexMan_;
# Line 318 | Line 356 | namespace oopse{
356        return globalMolMembership_[id];
357      }
358  
359 <    RealType getRcut() {
360 <      return rcut_;
361 <    }
359 >    /**
360 >     * returns a vector which maps the local atom index on this
361 >     * processor to the global atom index.  With only one processor,
362 >     * these should be identical.
363 >     */
364 >    vector<int> getGlobalAtomIndices();
365  
366 <    RealType getRsw() {
367 <      return rsw_;
368 <    }
366 >    /**
367 >     * returns a vector which maps the local cutoff group index on
368 >     * this processor to the global cutoff group index.  With only one
369 >     * processor, these should be identical.
370 >     */
371 >    vector<int> getGlobalGroupIndices();
372  
329    RealType getList() {
330      return rlist_;
331    }
373          
374 <    std::string getFinalConfigFileName() {
374 >    string getFinalConfigFileName() {
375        return finalConfigFileName_;
376      }
377  
378 <    void setFinalConfigFileName(const std::string& fileName) {
378 >    void setFinalConfigFileName(const string& fileName) {
379        finalConfigFileName_ = fileName;
380      }
381  
382 <    std::string getRawMetaData() {
382 >    string getRawMetaData() {
383        return rawMetaData_;
384      }
385 <    void setRawMetaData(const std::string& rawMetaData) {
385 >    void setRawMetaData(const string& rawMetaData) {
386        rawMetaData_ = rawMetaData;
387      }
388          
389 <    std::string getDumpFileName() {
389 >    string getDumpFileName() {
390        return dumpFileName_;
391      }
392          
393 <    void setDumpFileName(const std::string& fileName) {
393 >    void setDumpFileName(const string& fileName) {
394        dumpFileName_ = fileName;
395      }
396  
397 <    std::string getStatFileName() {
397 >    string getStatFileName() {
398        return statFileName_;
399      }
400          
401 <    void setStatFileName(const std::string& fileName) {
401 >    void setStatFileName(const string& fileName) {
402        statFileName_ = fileName;
403      }
404          
405 <    std::string getRestFileName() {
405 >    string getRestFileName() {
406        return restFileName_;
407      }
408          
409 <    void setRestFileName(const std::string& fileName) {
409 >    void setRestFileName(const string& fileName) {
410        restFileName_ = fileName;
411      }
412  
413      /**
414       * Sets GlobalGroupMembership
374     * @see #SimCreator::setGlobalIndex
415       */  
416 <    void setGlobalGroupMembership(const std::vector<int>& globalGroupMembership) {
417 <      assert(globalGroupMembership.size() == static_cast<size_t>(nGlobalAtoms_));
418 <      globalGroupMembership_ = globalGroupMembership;
416 >    void setGlobalGroupMembership(const vector<int>& ggm) {
417 >      assert(ggm.size() == static_cast<size_t>(nGlobalAtoms_));
418 >      globalGroupMembership_ = ggm;
419      }
420  
421      /**
422       * Sets GlobalMolMembership
383     * @see #SimCreator::setGlobalIndex
423       */        
424 <    void setGlobalMolMembership(const std::vector<int>& globalMolMembership) {
425 <      assert(globalMolMembership.size() == static_cast<size_t>(nGlobalAtoms_));
426 <      globalMolMembership_ = globalMolMembership;
424 >    void setGlobalMolMembership(const vector<int>& gmm) {
425 >      assert(gmm.size() == (static_cast<size_t>(nGlobalAtoms_ +
426 >                                                nGlobalRigidBodies_)));
427 >      globalMolMembership_ = gmm;
428      }
429  
430  
431 <    bool isFortranInitialized() {
432 <      return fortranInitialized_;
431 >    bool isTopologyDone() {
432 >      return topologyDone_;
433      }
434          
435      bool getCalcBoxDipole() {
# Line 400 | Line 440 | namespace oopse{
440        return useAtomicVirial_;
441      }
442  
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.
443      /**
444       * Adds property into property map
445       * @param genData GenericData to be added into PropertyMap
# Line 413 | Line 450 | namespace oopse{
450       * Removes property from PropertyMap by name
451       * @param propName the name of property to be removed
452       */
453 <    void removeProperty(const std::string& propName);
453 >    void removeProperty(const string& propName);
454  
455      /**
456       * clear all of the properties
# Line 424 | Line 461 | namespace oopse{
461       * Returns all names of properties
462       * @return all names of properties
463       */
464 <    std::vector<std::string> getPropertyNames();
464 >    vector<string> getPropertyNames();
465  
466      /**
467       * Returns all of the properties in PropertyMap
468       * @return all of the properties in PropertyMap
469       */      
470 <    std::vector<GenericData*> getProperties();
470 >    vector<GenericData*> getProperties();
471  
472      /**
473       * Returns property
# Line 438 | Line 475 | namespace oopse{
475       * @return a pointer point to property with propName. If no property named propName
476       * exists, return NULL
477       */      
478 <    GenericData* getPropertyByName(const std::string& propName);
478 >    GenericData* getPropertyByName(const string& propName);
479  
480      /**
481       * add all special interaction pairs (including excluded
# Line 452 | Line 489 | namespace oopse{
489       */
490      void removeInteractionPairs(Molecule* mol);
491  
492 +    /** Returns the set of atom types present in this simulation */
493 +    set<AtomType*> getSimulatedAtomTypes();
494  
495 <    /** Returns the unique atom types of local processor in an array */
496 <    std::set<AtomType*> getUniqueAtomTypes();
495 >    /** Returns the global count of atoms of a particular type */
496 >    int getGlobalCountOfType(AtomType* atype);
497          
498 <    friend std::ostream& operator <<(std::ostream& o, SimInfo& info);
498 >    friend ostream& operator <<(ostream& o, SimInfo& info);
499  
500      void getCutoff(RealType& rcut, RealType& rsw);
501          
502    private:
503  
504 <    /** fill up the simtype struct*/
505 <    void setupSimType();
504 >    /** fill up the simtype struct and other simulation-related variables */
505 >    void setupSimVariables();
506  
468    /**
469     * Setup Fortran Simulation
470     * @see #setupFortranParallel
471     */
472    void setupFortranSim();
507  
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
508      /** Determine if we need to accumulate the simulation box dipole */
509      void setupAccumulateBoxDipole();
510  
# Line 487 | Line 512 | namespace oopse{
512      void calcNdf();
513      void calcNdfRaw();
514      void calcNdfTrans();
515 +    void calcNConstraints();
516  
491    ForceField* forceField_;      
492    Globals* simParams_;
493
494    std::map<int, Molecule*>  molecules_; /**< Molecule array */
495
517      /**
518 <     * Adds molecule stamp and the total number of the molecule with same molecule stamp in the whole
519 <     * system.
518 >     * Adds molecule stamp and the total number of the molecule with
519 >     * same molecule stamp in the whole system.
520       */
521      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_;
522  
523 <    /**
524 <     * the size of globalMolMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
525 <     * 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_;        
523 >    // Other classes holdingn important information
524 >    ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */
525 >    Globals* simParams_;     /**< provides access to simulation parameters set by user */
526  
527 <        
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
527 >    ///  Counts of local objects
528      int nAtoms_;              /**< number of atoms in local processor */
529      int nBonds_;              /**< number of bonds in local processor */
530      int nBends_;              /**< number of bends in local processor */
# Line 541 | Line 534 | namespace oopse{
534      int nIntegrableObjects_;  /**< number of integrable objects in local processor */
535      int nCutoffGroups_;       /**< number of cutoff groups in local processor */
536      int nConstraints_;        /**< number of constraints in local processors */
537 +    int nFluctuatingCharges_; /**< number of fluctuating charges in local processor */
538 +        
539 +    /// Counts of global objects
540 +    int nGlobalMols_;              /**< number of molecules in the system (GLOBAL) */
541 +    int nGlobalAtoms_;             /**< number of atoms in the system (GLOBAL) */
542 +    int nGlobalCutoffGroups_;      /**< number of cutoff groups in this system (GLOBAL) */
543 +    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */
544 +    int nGlobalRigidBodies_;       /**< number of rigid bodies in this system (GLOBAL) */
545 +    int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */
546 +    int nGlobalBonds_;              /**< number of bonds in the system */
547 +    int nGlobalBends_;              /**< number of bends in the system */
548 +    int nGlobalTorsions_;           /**< number of torsions in the system */
549 +    int nGlobalInversions_;         /**< number of inversions in the system */
550 +    int nGlobalConstraints_;        /**< number of constraints in the system */
551 +    bool hasNGlobalConstraints_;
552  
553 <    simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/
554 <    PairList excludedInteractions_;      
555 <    PairList oneTwoInteractions_;      
556 <    PairList oneThreeInteractions_;      
557 <    PairList oneFourInteractions_;      
558 <    PropertyMap properties_;                  /**< Generic Property */
559 <    SnapshotManager* sman_;               /**< SnapshotManager */
553 >    /// Degress of freedom
554 >    int ndf_;          /**< number of degress of freedom (excludes constraints) (LOCAL) */
555 >    int ndfLocal_;     /**< number of degrees of freedom (LOCAL, excludes constraints) */
556 >    int fdf_local;     /**< number of frozen degrees of freedom (LOCAL) */
557 >    int fdf_;          /**< number of frozen degrees of freedom (GLOBAL) */
558 >    int ndfRaw_;       /**< number of degress of freedom (includes constraints),  (LOCAL) */
559 >    int ndfTrans_;     /**< number of translation degress of freedom, (LOCAL) */
560 >    int nZconstraint_; /**< number of  z-constraint molecules (GLOBAL) */
561  
562 +    /// logicals
563 +    bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */
564 +    bool usesDirectionalAtoms_;   /**< are there atoms with position AND orientation? */
565 +    bool usesMetallicAtoms_;      /**< are there transition metal atoms? */
566 +    bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */
567 +    bool usesFluctuatingCharges_; /**< are there fluctuating charges? */
568 +    bool usesAtomicVirial_;       /**< are we computing atomic virials? */
569 +    bool requiresPrepair_;        /**< does this simulation require a pre-pair loop? */
570 +    bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
571 +    bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
572 +
573 +  public:
574 +    bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
575 +    bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
576 +    bool usesFluctuatingCharges() { return usesFluctuatingCharges_; }
577 +    bool usesAtomicVirial() { return usesAtomicVirial_; }
578 +    bool requiresPrepair() { return requiresPrepair_; }
579 +    bool requiresSkipCorrection() { return requiresSkipCorrection_;}
580 +    bool requiresSelfCorrection() { return requiresSelfCorrection_;}
581 +
582 +  private:
583 +    /// Data structures holding primary simulation objects
584 +    map<int, Molecule*>  molecules_;  /**< map holding pointers to LOCAL molecules */
585 +
586 +    /// Stamps are templates for objects that are then used to create
587 +    /// groups of objects.  For example, a molecule stamp contains
588 +    /// information on how to build that molecule (i.e. the topology,
589 +    /// the atoms, the bonds, etc.)  Once the system is built, the
590 +    /// stamps are no longer useful.
591 +    vector<int> molStampIds_;                /**< stamp id for molecules in the system */
592 +    vector<MoleculeStamp*> moleculeStamps_;  /**< molecule stamps array */        
593 +
594 +    /**
595 +     * A vector that maps between the global index of an atom, and the
596 +     * global index of cutoff group the atom belong to.  It is filled
597 +     * by SimCreator once and only once, since it never changed during
598 +     * the simulation.  It should be nGlobalAtoms_ in size.
599 +     */
600 +    vector<int> globalGroupMembership_;
601 +  public:
602 +    vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
603 +  private:
604 +
605 +    /**
606 +     * A vector that maps between the global index of an atom and the
607 +     * global index of the molecule the atom belongs to.  It is filled
608 +     * by SimCreator once and only once, since it is never changed
609 +     * during the simulation. It shoudl be nGlobalAtoms_ in size.
610 +     */
611 +    vector<int> globalMolMembership_;
612 +
613      /**
614 <     * The reason to have a local index manager is that when molecule is migrating to other processors,
615 <     * the atoms and the rigid-bodies will release their local indices to LocalIndexManager. Combining the
616 <     * information of molecule migrating to current processor, Migrator class can query  the LocalIndexManager
617 <     * to make a efficient data moving plan.
614 >     * A vector that maps between the local index of an atom and the
615 >     * index of the AtomType.
616 >     */
617 >    vector<int> identArray_;
618 >  public:
619 >    vector<int> getIdentArray() { return identArray_; }
620 >
621 >    /**
622 >     * A vector that contains information about the local region of an
623 >     * atom (used for fluctuating charges, etc.)
624 >     */
625 >  private:
626 >    vector<int> regions_;
627 >  public:
628 >    vector<int> getRegions() { return regions_; }
629 >  private:
630 >    /**
631 >     * A vector which contains the fractional contribution of an
632 >     * atom's mass to the total mass of the cutoffGroup that atom
633 >     * belongs to.  In the case of single atom cutoff groups, the mass
634 >     * factor for that atom is 1.  For massless atoms, the factor is
635 >     * also 1.
636 >     */
637 >    vector<RealType> massFactors_;
638 >  public:
639 >    vector<RealType> getMassFactors() { return massFactors_; }
640 >
641 >    PairList* getExcludedInteractions() { return &excludedInteractions_; }
642 >    PairList* getOneTwoInteractions() { return &oneTwoInteractions_; }
643 >    PairList* getOneThreeInteractions() { return &oneThreeInteractions_; }
644 >    PairList* getOneFourInteractions() { return &oneFourInteractions_; }
645 >
646 >  private:
647 >              
648 >    /// lists to handle atoms needing special treatment in the non-bonded interactions
649 >    PairList excludedInteractions_;  /**< atoms excluded from interacting with each other */
650 >    PairList oneTwoInteractions_;    /**< atoms that are directly Bonded */
651 >    PairList oneThreeInteractions_;  /**< atoms sharing a Bend */    
652 >    PairList oneFourInteractions_;   /**< atoms sharing a Torsion */
653 >
654 >    PropertyMap properties_;       /**< Generic Properties can be added */
655 >    SnapshotManager* sman_;        /**< SnapshotManager (handles particle positions, etc.) */
656 >    int storageLayout_;            /**< Bits to tell how much data to store on each object */
657 >
658 >    /**
659 >     * The reason to have a local index manager is that when molecule
660 >     * is migrating to other processors, the atoms and the
661 >     * rigid-bodies will release their local indices to
662 >     * LocalIndexManager. Combining the information of molecule
663 >     * migrating to current processor, Migrator class can query the
664 >     * LocalIndexManager to make a efficient data moving plan.
665       */        
666      LocalIndexManager localIndexMan_;
667  
668      // unparsed MetaData block for storing in Dump and EOR files:
669 <    std::string rawMetaData_;
669 >    string rawMetaData_;
670  
671 <    //file names
672 <    std::string finalConfigFileName_;
673 <    std::string dumpFileName_;
674 <    std::string statFileName_;
675 <    std::string restFileName_;
569 <        
570 <    RealType rcut_;       /**< cutoff radius*/
571 <    RealType rsw_;        /**< radius of switching function*/
572 <    RealType rlist_;      /**< neighbor list radius */
671 >    // file names
672 >    string finalConfigFileName_;
673 >    string dumpFileName_;
674 >    string statFileName_;
675 >    string restFileName_;
676  
677 <    int ljsp_; /**< use shifted potential for LJ*/
678 <    int ljsf_; /**< use shifted force for LJ*/
679 <
577 <    bool fortranInitialized_; /**< flag indicate whether fortran side
578 <                                 is initialized */
677 >    bool topologyDone_;  /** flag to indicate whether the topology has
678 >                             been scanned and all the relevant
679 >                             bookkeeping has been done*/
680      
681      bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
682                              the simulation box dipole moment */
683      
684      bool useAtomicVirial_; /**< flag to indicate whether or not we use
685                                Atomic Virials to calculate the pressure */
686 <
687 <    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);
686 >    
687 >  public:
688      /**
689 <     * return a StuntDouble by its global index. In MPI version, if the StuntDouble with specified
690 <     * global index does not belong to local processor, a NULL will be return.
691 <     */
692 <    //StuntDouble* getStuntDoubleFromGlobalIndex(int index);
693 <  //private:
694 <    //std::vector<StuntDouble*> sdByGlobalIndex_;
689 >     * return an integral objects by its global index. In MPI
690 >     * version, if the StuntDouble with specified global index does
691 >      * not belong to local processor, a NULL will be return.
692 >      */
693 >    StuntDouble* getIOIndexToIntegrableObject(int index);
694 >    void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v);
695      
696 <    //in Parallel version, we need MolToProc
696 >  private:
697 >    vector<StuntDouble*> IOIndexToIntegrableObject;
698 >    
699    public:
700                  
701      /**
# Line 614 | Line 707 | namespace oopse{
707        //assert(globalIndex < molToProcMap_.size());
708        return molToProcMap_[globalIndex];
709      }
710 <
710 >    
711      /**
712       * Set MolToProcMap array
620     * @see #SimCreator::divideMolecules
713       */
714 <    void setMolToProcMap(const std::vector<int>& molToProcMap) {
714 >    void setMolToProcMap(const vector<int>& molToProcMap) {
715        molToProcMap_ = molToProcMap;
716      }
717          
718    private:
627
628    void setupFortranParallel();
719          
720      /**
721       * The size of molToProcMap_ is equal to total number of molecules
722       * in the system.  It maps a molecule to the processor on which it
723       * resides. it is filled by SimCreator once and only once.
724       */        
725 <    std::vector<int> molToProcMap_;
725 >    vector<int> molToProcMap_;
726  
637
727    };
728  
729 < } //namespace oopse
729 > } //namespace OpenMD
730   #endif //BRAINS_SIMMODEL_HPP
731  

Comparing trunk/src/brains/SimInfo.hpp (property svn:keywords):
Revision 1386 by gezelter, Fri Oct 23 18:41:09 2009 UTC vs.
Revision 1983 by gezelter, Tue Apr 15 20:36:19 2014 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines