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 598 by chrisfen, Thu Sep 15 00:14:35 2005 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 54 | Line 55
55   #include <utility>
56   #include <vector>
57  
58 < #include "brains/Exclude.hpp"
58 > #include "brains/PairList.hpp"
59   #include "io/Globals.hpp"
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 __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 As one of the heavy weight class of OOPSE, SimInfo
79 <   * One of the major changes in SimInfo class is the data struct. It only maintains a list of molecules.
80 <   * And the Molecule class will maintain all of the concrete objects (atoms, bond, bend, torsions, rigid bodies,
81 <   * cutoff groups, constrains).
82 <   * Another major change is the index. No matter single version or parallel version,  atoms and
83 <   * rigid bodies have both global index and local index. Local index is not important to molecule as well as
84 <   * cutoff group.
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(MakeStamps* stamps, std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs, ForceField* ff, Globals* simParams);
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 inversions */        
208 +    unsigned int getNInversions() {
209 +      return nInversions_;
210 +    }
211      /** Returns the number of local rigid bodies */        
212      unsigned int getNRigidBodies() {
213        return nRigidBodies_;
# Line 205 | 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_;
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 220 | Line 267 | namespace oopse{
267        return ndfTrans_;
268      }
269  
270 <    //getNZconstraint and setNZconstraint ruin the coherent of SimInfo class, need refactorying
270 >    /** sets the current number of frozen degrees of freedom */
271 >    void setFdf(int fdf) {
272 >      fdf_local = fdf;
273 >    }
274 >
275 >    int getFdf();
276 >    
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 238 | 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 251 | Line 314 | namespace oopse{
314        return simParams_;
315      }
316  
254    /** Returns the velocity of center of mass of the whole system.*/
255    Vector3d getComVel();
256
257    /** Returns the center of the mass of the whole system.*/
258    Vector3d getCom();
259   /** Returns the center of the mass and Center of Mass velocity of the whole system.*/
260    void getComAll(Vector3d& com,Vector3d& comVel);
261
262    /** Returns intertia tensor for the entire system and system Angular Momentum.*/
263    void getInertiaTensor(Mat3x3d &intertiaTensor,Vector3d &angularMomentum);
264    
265    /** Returns system angular momentum */
266    Vector3d getAngularMomentum();
267
268    /** 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 299 | Line 352 | namespace oopse{
352        return i != molecules_.end() ? i->second : NULL;
353      }
354  
355 <    /** Calculate the maximum cutoff radius based on the atom types */
356 <    double calcMaxCutoffRadius();
304 <
305 <    double getRcut() {
306 <      return rcut_;
355 >    int getGlobalMolMembership(int id){
356 >      return globalMolMembership_[id];
357      }
358  
359 <    double getRsw() {
360 <      return rsw_;
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 >    /**
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 >
373          
374 <    std::string getFinalConfigFileName() {
374 >    string getFinalConfigFileName() {
375        return finalConfigFileName_;
376      }
377 <        
378 <    void setFinalConfigFileName(const std::string& fileName) {
377 >
378 >    void setFinalConfigFileName(const string& fileName) {
379        finalConfigFileName_ = fileName;
380      }
381  
382 <    std::string getDumpFileName() {
382 >    string getRawMetaData() {
383 >      return rawMetaData_;
384 >    }
385 >    void setRawMetaData(const string& rawMetaData) {
386 >      rawMetaData_ = rawMetaData;
387 >    }
388 >        
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
347     * @see #SimCreator::setGlobalIndex
415       */  
416 <    void setGlobalGroupMembership(const std::vector<int>& globalGroupMembership) {
417 <      assert(globalGroupMembership.size() == 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
356     * @see #SimCreator::setGlobalIndex
423       */        
424 <    void setGlobalMolMembership(const std::vector<int>& globalMolMembership) {
425 <      assert(globalMolMembership.size() == 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 <    //below functions are just forward functions
436 <    //To compose or to inherit is always a hot debate. In general, is-a relation need subclassing, in the
437 <    //the other hand, has-a relation need composing.
435 >    bool getCalcBoxDipole() {
436 >      return calcBoxDipole_;
437 >    }
438 >
439 >    bool getUseAtomicVirial() {
440 >      return useAtomicVirial_;
441 >    }
442 >
443      /**
444       * Adds property into property map
445       * @param genData GenericData to be added into PropertyMap
# Line 378 | 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 389 | 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 403 | 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 exclude pairs of a molecule into exclude list.
481 >     * add all special interaction pairs (including excluded
482 >     * interactions) in a molecule into the appropriate lists.
483       */
484 <    void addExcludePairs(Molecule* mol);
484 >    void addInteractionPairs(Molecule* mol);
485  
486      /**
487 <     * remove all exclude pairs which belong to a molecule from exclude list
487 >     * remove all special interaction pairs which belong to a molecule
488 >     * from the appropriate lists.
489       */
490 +    void removeInteractionPairs(Molecule* mol);
491  
492 <    void removeExcludePairs(Molecule* mol);
492 >    /** Returns the set of atom types present in this simulation */
493 >    set<AtomType*> getSimulatedAtomTypes();
494  
495 <
496 <    /** Returns the unique atom types of local processor in an array */
421 <    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(double& rcut, double& rsw);
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  
432    /**
433     * Setup Fortran Simulation
434     * @see #setupFortranParallel
435     */
436    void setupFortranSim();
507  
508 <    /** Figure out the radius of cutoff, radius of switching function and pass them to fortran */
509 <    void setupCutoff();
508 >    /** Determine if we need to accumulate the simulation box dipole */
509 >    void setupAccumulateBoxDipole();
510  
441    /** Figure out which coulombic correction method to use and pass to fortran */
442    void setupCoulombicCorrection( int isError );
443
511      /** Calculates the number of degress of freedom in the whole system */
512      void calcNdf();
513      void calcNdfRaw();
514      void calcNdfTrans();
515 +    void calcNConstraints();
516  
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);
522  
523 <    MakeStamps* stamps_;
524 <    ForceField* forceField_;      
525 <    Globals* simParams_;
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 <    std::map<int, Molecule*>  molecules_; /**< Molecule array */
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 */
531 >    int nTorsions_;           /**< number of torsions in local processor */
532 >    int nInversions_;         /**< number of inversions in local processor */
533 >    int nRigidBodies_;        /**< number of rigid bodies in local processor */
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 <    //degress of freedom
540 <    int ndf_;           /**< number of degress of freedom (excludes constraints),  ndf_ is local */
541 <    int ndfRaw_;    /**< number of degress of freedom (includes constraints),  ndfRaw_ is local */
542 <    int ndfTrans_; /**< number of translation degress of freedom, ndfTrans_ is local */
465 <    int nZconstraint_; /** number of  z-constraint molecules, nZconstraint_ is global */
466 <        
467 <    //number of global objects
468 <    int nGlobalMols_;       /**< number of molecules in the system */
469 <    int nGlobalAtoms_;   /**< number of atoms in the system */
470 <    int nGlobalCutoffGroups_; /**< number of cutoff groups in this system */
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 */
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 >    /// 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 <     * the size of globalGroupMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
596 <     * corresponding content is the global index of cutoff group this atom belong to.
597 <     * It is filled by SimCreator once and only once, since it never changed during the simulation.
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 <    std::vector<int> globalGroupMembership_;
600 >    vector<int> globalGroupMembership_;
601 >  public:
602 >    vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
603 >  private:
604  
605      /**
606 <     * the size of globalGroupMembership_  is nGlobalAtoms. Its index is  global index of an atom, and the
607 <     * corresponding content is the global index of molecule this atom belong to.
608 <     * It is filled by SimCreator once and only once, since it is never changed during the simulation.
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 <    std::vector<int> globalMolMembership_;        
611 >    vector<int> globalMolMembership_;
612  
613 <        
614 <    std::vector<int> molStampIds_;                                /**< stamp id array of all molecules in the system */
615 <    std::vector<MoleculeStamp*> moleculeStamps_;      /**< molecule stamps array */        
616 <        
617 <    //number of local objects
618 <    int nAtoms_;                        /**< number of atoms in local processor */
619 <    int nBonds_;                        /**< number of bonds in local processor */
494 <    int nBends_;                        /**< number of bends in local processor */
495 <    int nTorsions_;                    /**< number of torsions in local processor */
496 <    int nRigidBodies_;              /**< number of rigid bodies in local processor */
497 <    int nIntegrableObjects_;    /**< number of integrable objects in local processor */
498 <    int nCutoffGroups_;             /**< number of cutoff groups in local processor */
499 <    int nConstraints_;              /**< number of constraints in local processors */
613 >    /**
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 <    simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/
622 <    Exclude exclude_;      
623 <    PropertyMap properties_;                  /**< Generic Property */
624 <    SnapshotManager* sman_;               /**< SnapshotManager */
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 is migrating to other processors,
660 <     * the atoms and the rigid-bodies will release their local indices to LocalIndexManager. Combining the
661 <     * information of molecule migrating to current processor, Migrator class can query  the LocalIndexManager
662 <     * to make a efficient data moving plan.
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 <    //file names
669 <    std::string finalConfigFileName_;
516 <    std::string dumpFileName_;
517 <    std::string statFileName_;
518 <    std::string restFileName_;
519 <        
520 <    double rcut_;       /**< cutoff radius*/
521 <    double rsw_;        /**< radius of switching function*/
668 >    // unparsed MetaData block for storing in Dump and EOR files:
669 >    string rawMetaData_;
670  
671 <    bool fortranInitialized_; /**< flag indicate whether fortran side is initialized */
671 >    // file names
672 >    string finalConfigFileName_;
673 >    string dumpFileName_;
674 >    string statFileName_;
675 >    string restFileName_;
676  
677 < #ifdef IS_MPI
678 <    //in Parallel version, we need MolToProc
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:
688 +    /**
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 +  private:
697 +    vector<StuntDouble*> IOIndexToIntegrableObject;
698 +    
699 +  public:
700                  
701      /**
702       * Finds the processor where a molecule resides
# Line 535 | Line 707 | namespace oopse{
707        //assert(globalIndex < molToProcMap_.size());
708        return molToProcMap_[globalIndex];
709      }
710 <
710 >    
711      /**
712       * Set MolToProcMap array
541     * @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:
548
549    void setupFortranParallel();
719          
720      /**
721 <     * The size of molToProcMap_ is equal to total number of molecules in the system.
722 <     *  It maps a molecule to the processor on which it resides. it is filled by SimCreator once and only
723 <     * once.
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  
558 #endif
559
727    };
728  
729 < } //namespace oopse
729 > } //namespace OpenMD
730   #endif //BRAINS_SIMMODEL_HPP
731  

Comparing trunk/src/brains/SimInfo.hpp (property svn:keywords):
Revision 598 by chrisfen, Thu Sep 15 00:14:35 2005 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