--- branches/development/src/brains/SimInfo.hpp 2010/12/17 20:11:05 1528 +++ branches/development/src/brains/SimInfo.hpp 2011/05/26 13:55:04 1569 @@ -62,22 +62,11 @@ #include "UseTheForce/ForceField.hpp" #include "utils/PropertyMap.hpp" #include "utils/LocalIndexManager.hpp" +#include "nonbonded/SwitchingFunction.hpp" -//another nonsense macro declaration -#define __OPENMD_C -#include "brains/fSimulation.h" - using namespace std; namespace OpenMD{ - - enum CutoffMethod { - HARD, - SWITCHING_FUNCTION, - SHIFTED_POTENTIAL, - SHIFTED_FORCE - }; - - //forward decalration + //forward declaration class SnapshotManager; class Molecule; class SelectionManager; @@ -306,10 +295,14 @@ namespace OpenMD{ /** Overloaded version of gyrational volume that also returns det(I) so dV/dr can be calculated*/ void getGyrationalVolume(RealType &vol, RealType &detI); - /** main driver function to interact with fortran during the - initialization and molecule migration */ + void update(); + /** + * Do final bookkeeping before Force managers need their data. + */ + void prepareTopology(); + /** Returns the local index manager */ LocalIndexManager* getLocalIndexManager() { return &localIndexMan_; @@ -345,17 +338,20 @@ namespace OpenMD{ return globalMolMembership_[id]; } - RealType getCutoffRadius() { - return cutoffRadius_; - } + /** + * returns a vector which maps the local atom index on this + * processor to the global atom index. With only one processor, + * these should be identical. + */ + vector getGlobalAtomIndices(); - RealType getSwitchingRadius() { - return switchingRadius_; - } + /** + * returns a vector which maps the local cutoff group index on + * this processor to the global cutoff group index. With only one + * processor, these should be identical. + */ + vector getGlobalGroupIndices(); - RealType getListRadius() { - return listRadius_; - } string getFinalConfigFileName() { return finalConfigFileName_; @@ -415,8 +411,8 @@ namespace OpenMD{ } - bool isFortranInitialized() { - return fortranInitialized_; + bool isTopologyDone() { + return topologyDone_; } bool getCalcBoxDipole() { @@ -476,10 +472,6 @@ namespace OpenMD{ */ void removeInteractionPairs(Molecule* mol); - - /** Returns the unique atom types of local processor in an array */ - set getUniqueAtomTypes(); - /** Returns the set of atom types present in this simulation */ set getSimulatedAtomTypes(); @@ -489,26 +481,10 @@ namespace OpenMD{ private: - /** fill up the simtype struct*/ - void setupSimType(); + /** fill up the simtype struct and other simulation-related variables */ + void setupSimVariables(); - /** - * Setup Fortran Simulation - * @see #setupFortranParallel - */ - void setupFortranSim(); - /** Figure out the cutoff radius */ - void setupCutoffRadius(); - /** Figure out the cutoff method */ - void setupCutoffMethod(); - /** Figure out the switching radius */ - void setupSwitchingRadius(); - /** Figure out the neighbor list skin thickness */ - void setupSkinThickness(); - /** Figure out which polynomial type to use for the switching function */ - void setupSwitchingFunction(); - /** Determine if we need to accumulate the simulation box dipole */ void setupAccumulateBoxDipole(); @@ -563,14 +539,19 @@ namespace OpenMD{ bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */ bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */ + public: + bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; } + bool usesDirectionalAtoms() { return usesDirectionalAtoms_; } + bool usesMetallicAtoms() { return usesMetallicAtoms_; } + bool usesAtomicVirial() { return usesAtomicVirial_; } + bool requiresPrepair() { return requiresPrepair_; } + bool requiresSkipCorrection() { return requiresSkipCorrection_;} + bool requiresSelfCorrection() { return requiresSelfCorrection_;} + + private: /// Data structures holding primary simulation objects map molecules_; /**< map holding pointers to LOCAL molecules */ - simtype fInfo_; /**< A dual struct shared by C++ - and Fortran to pass - information about what types - of calculation are - required */ - + /// Stamps are templates for objects that are then used to create /// groups of objects. For example, a molecule stamp contains /// information on how to build that molecule (i.e. the topology, @@ -586,6 +567,9 @@ namespace OpenMD{ * the simulation. It should be nGlobalAtoms_ in size. */ vector globalGroupMembership_; + public: + vector getGlobalGroupMembership() { return globalGroupMembership_; } + private: /** * A vector that maps between the global index of an atom and the @@ -593,7 +577,29 @@ namespace OpenMD{ * by SimCreator once and only once, since it is never changed * during the simulation. It shoudl be nGlobalAtoms_ in size. */ - vector globalMolMembership_; + vector globalMolMembership_; + + /** + * A vector that maps between the local index of an atom and the + * index of the AtomType. + */ + vector identArray_; + public: + vector getIdentArray() { return identArray_; } + private: + + /** + * A vector which contains the fractional contribution of an + * atom's mass to the total mass of the cutoffGroup that atom + * belongs to. In the case of single atom cutoff groups, the mass + * factor for that atom is 1. For massless atoms, the factor is + * also 1. + */ + vector massFactors_; + public: + vector getMassFactors() { return massFactors_; } + private: + /// lists to handle atoms needing special treatment in the non-bonded interactions PairList excludedInteractions_; /**< atoms excluded from interacting with each other */ @@ -623,13 +629,10 @@ namespace OpenMD{ string statFileName_; string restFileName_; - RealType cutoffRadius_; /**< cutoff radius for non-bonded interactions */ - RealType switchingRadius_; /**< inner radius of switching function */ - RealType listRadius_; /**< Verlet neighbor list radius */ - RealType skinThickness_; /**< Verlet neighbor list skin thickness */ - CutoffMethod cutoffMethod_; /**< Cutoff Method for most non-bonded interactions */ - bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */ + bool topologyDone_; /** flag to indicate whether the topology has + been scanned and all the relevant + bookkeeping has been done*/ bool calcBoxDipole_; /**< flag to indicate whether or not we calculate the simulation box dipole moment */ @@ -670,8 +673,6 @@ namespace OpenMD{ } private: - - void setupFortranParallel(); /** * The size of molToProcMap_ is equal to total number of molecules