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 1528 by gezelter, Fri Dec 17 20:11:05 2010 UTC vs.
Revision 1577 by gezelter, Wed Jun 8 20:26:56 2011 UTC

# Line 62 | Line 62
62   #include "UseTheForce/ForceField.hpp"
63   #include "utils/PropertyMap.hpp"
64   #include "utils/LocalIndexManager.hpp"
65 + #include "nonbonded/SwitchingFunction.hpp"
66  
66 //another nonsense macro declaration
67 #define __OPENMD_C
68 #include "brains/fSimulation.h"
69
67   using namespace std;
68   namespace OpenMD{
69 <
73 <  enum CutoffMethod {
74 <    HARD,
75 <    SWITCHING_FUNCTION,
76 <    SHIFTED_POTENTIAL,
77 <    SHIFTED_FORCE
78 <  };
79 <
80 <  //forward decalration
69 >  //forward declaration
70    class SnapshotManager;
71    class Molecule;
72    class SelectionManager;
# Line 177 | Line 166 | namespace OpenMD{
166        return nAtoms_;
167      }
168  
169 +    /** Returns the number of effective cutoff groups on local processor */
170 +    unsigned int getNLocalCutoffGroups();
171 +
172      /** Returns the number of local bonds */        
173      unsigned int getNBonds(){
174        return nBonds_;
# Line 306 | Line 298 | namespace OpenMD{
298      /** Overloaded version of gyrational volume that also returns
299          det(I) so dV/dr can be calculated*/
300      void getGyrationalVolume(RealType &vol, RealType &detI);
301 <    /** main driver function to interact with fortran during the
310 <        initialization and molecule migration */
301 >
302      void update();
303 +    /**
304 +     * Do final bookkeeping before Force managers need their data.
305 +     */
306 +    void prepareTopology();
307  
308 +
309      /** Returns the local index manager */
310      LocalIndexManager* getLocalIndexManager() {
311        return &localIndexMan_;
# Line 345 | Line 341 | namespace OpenMD{
341        return globalMolMembership_[id];
342      }
343  
344 <    RealType getCutoffRadius() {
345 <      return cutoffRadius_;
346 <    }
344 >    /**
345 >     * returns a vector which maps the local atom index on this
346 >     * processor to the global atom index.  With only one processor,
347 >     * these should be identical.
348 >     */
349 >    vector<int> getGlobalAtomIndices();
350  
351 <    RealType getSwitchingRadius() {
352 <      return switchingRadius_;
353 <    }
351 >    /**
352 >     * returns a vector which maps the local cutoff group index on
353 >     * this processor to the global cutoff group index.  With only one
354 >     * processor, these should be identical.
355 >     */
356 >    vector<int> getGlobalGroupIndices();
357  
356    RealType getListRadius() {
357      return listRadius_;
358    }
358          
359      string getFinalConfigFileName() {
360        return finalConfigFileName_;
# Line 415 | Line 414 | namespace OpenMD{
414      }
415  
416  
417 <    bool isFortranInitialized() {
418 <      return fortranInitialized_;
417 >    bool isTopologyDone() {
418 >      return topologyDone_;
419      }
420          
421      bool getCalcBoxDipole() {
# Line 476 | Line 475 | namespace OpenMD{
475       */
476      void removeInteractionPairs(Molecule* mol);
477  
479
480    /** Returns the unique atom types of local processor in an array */
481    set<AtomType*> getUniqueAtomTypes();
482
478      /** Returns the set of atom types present in this simulation */
479      set<AtomType*> getSimulatedAtomTypes();
480          
# Line 489 | Line 484 | namespace OpenMD{
484          
485    private:
486  
487 <    /** fill up the simtype struct*/
488 <    void setupSimType();
487 >    /** fill up the simtype struct and other simulation-related variables */
488 >    void setupSimVariables();
489  
495    /**
496     * Setup Fortran Simulation
497     * @see #setupFortranParallel
498     */
499    void setupFortranSim();
500
501    /** Figure out the cutoff radius */
502    void setupCutoffRadius();
503    /** Figure out the cutoff method */
504    void setupCutoffMethod();
505    /** Figure out the switching radius */
506    void setupSwitchingRadius();
507    /** Figure out the neighbor list skin thickness */
508    void setupSkinThickness();
509    /** Figure out which polynomial type to use for the switching function */
510    void setupSwitchingFunction();
490  
491      /** Determine if we need to accumulate the simulation box dipole */
492      void setupAccumulateBoxDipole();
# Line 563 | Line 542 | namespace OpenMD{
542      bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */
543      bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */
544  
545 +  public:
546 +    bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; }
547 +    bool usesDirectionalAtoms() { return usesDirectionalAtoms_; }
548 +    bool usesMetallicAtoms() { return usesMetallicAtoms_; }
549 +    bool usesAtomicVirial() { return usesAtomicVirial_; }
550 +    bool requiresPrepair() { return requiresPrepair_; }
551 +    bool requiresSkipCorrection() { return requiresSkipCorrection_;}
552 +    bool requiresSelfCorrection() { return requiresSelfCorrection_;}
553 +
554 +  private:
555      /// Data structures holding primary simulation objects
556      map<int, Molecule*>  molecules_;  /**< map holding pointers to LOCAL molecules */
557 <    simtype fInfo_;                   /**< A dual struct shared by C++
569 <                                         and Fortran to pass
570 <                                         information about what types
571 <                                         of calculation are
572 <                                         required */
573 <    
557 >
558      /// Stamps are templates for objects that are then used to create
559      /// groups of objects.  For example, a molecule stamp contains
560      /// information on how to build that molecule (i.e. the topology,
# Line 586 | Line 570 | namespace OpenMD{
570       * the simulation.  It should be nGlobalAtoms_ in size.
571       */
572      vector<int> globalGroupMembership_;
573 +  public:
574 +    vector<int> getGlobalGroupMembership() { return globalGroupMembership_; }
575 +  private:
576  
577      /**
578       * A vector that maps between the global index of an atom and the
# Line 593 | Line 580 | namespace OpenMD{
580       * by SimCreator once and only once, since it is never changed
581       * during the simulation. It shoudl be nGlobalAtoms_ in size.
582       */
583 <    vector<int> globalMolMembership_;        
583 >    vector<int> globalMolMembership_;
584 >
585 >    /**
586 >     * A vector that maps between the local index of an atom and the
587 >     * index of the AtomType.
588 >     */
589 >    vector<int> identArray_;
590 >  public:
591 >    vector<int> getIdentArray() { return identArray_; }
592 >  private:
593 >    
594 >    /**
595 >     * A vector which contains the fractional contribution of an
596 >     * atom's mass to the total mass of the cutoffGroup that atom
597 >     * belongs to.  In the case of single atom cutoff groups, the mass
598 >     * factor for that atom is 1.  For massless atoms, the factor is
599 >     * also 1.
600 >     */
601 >    vector<RealType> massFactors_;
602 >  public:
603 >    vector<RealType> getMassFactors() { return massFactors_; }
604 >
605 >    PairList getExcludedInteractions() { return excludedInteractions_; }
606 >    PairList getOneTwoInteractions() { return oneTwoInteractions_; }
607 >    PairList getOneThreeInteractions() { return oneThreeInteractions_; }
608 >    PairList getOneFourInteractions() { return oneFourInteractions_; }
609 >
610 >  private:
611 >
612                
613      /// lists to handle atoms needing special treatment in the non-bonded interactions
614      PairList excludedInteractions_;  /**< atoms excluded from interacting with each other */
# Line 623 | Line 638 | namespace OpenMD{
638      string statFileName_;
639      string restFileName_;
640          
626    RealType cutoffRadius_;         /**< cutoff radius for non-bonded interactions */
627    RealType switchingRadius_;      /**< inner radius of switching function */
628    RealType listRadius_;           /**< Verlet neighbor list radius */
629    RealType skinThickness_;        /**< Verlet neighbor list skin thickness */    
630    CutoffMethod cutoffMethod_;     /**< Cutoff Method for most non-bonded interactions */
641  
642 <    bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */
642 >    bool topologyDone_;  /** flag to indicate whether the topology has
643 >                             been scanned and all the relevant
644 >                             bookkeeping has been done*/
645      
646      bool calcBoxDipole_; /**< flag to indicate whether or not we calculate
647                              the simulation box dipole moment */
# Line 670 | Line 682 | namespace OpenMD{
682      }
683          
684    private:
673
674    void setupFortranParallel();
685          
686      /**
687       * The size of molToProcMap_ is equal to total number of molecules

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines