--- trunk/src/brains/SimInfo.hpp 2007/04/20 18:15:48 1129 +++ branches/development/src/brains/SimInfo.hpp 2010/10/02 19:54:41 1503 @@ -6,19 +6,10 @@ * redistribute this software in source and binary code form, provided * that the following conditions are met: * - * 1. Acknowledgement of the program authors must be made in any - * publication of scientific results based in part on use of the - * program. An acceptable form of acknowledgement is citation of - * the article in which the program was described (Matthew - * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher - * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented - * Parallel Simulation Engine for Molecular Dynamics," - * J. Comput. Chem. 26, pp. 252-271 (2005)) - * - * 2. Redistributions of source code must retain the above copyright + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 3. Redistributions in binary form must reproduce the above copyright + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. @@ -37,6 +28,15 @@ * arising out of the use of or inability to use software, even if the * University of Notre Dame has been advised of the possibility of * such damages. + * + * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your + * research, please cite the appropriate papers when you publish your + * work. Good starting points are: + * + * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). + * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [4] Vardeman & Gezelter, in progress (2009). */ /** @@ -54,7 +54,7 @@ #include #include -#include "brains/Exclude.hpp" +#include "brains/PairList.hpp" #include "io/Globals.hpp" #include "math/Vector3.hpp" #include "math/SquareMatrix3.hpp" @@ -62,27 +62,29 @@ #include "UseTheForce/ForceField.hpp" #include "utils/PropertyMap.hpp" #include "utils/LocalIndexManager.hpp" +#include "nonbonded/Electrostatic.hpp" //another nonsense macro declaration -#define __C +#define __OPENMD_C #include "brains/fSimulation.h" -namespace oopse{ +namespace OpenMD{ //forward decalration class SnapshotManager; class Molecule; class SelectionManager; class StuntDouble; + class Electrostatic; /** * @class SimInfo SimInfo.hpp "brains/SimInfo.hpp" - * @brief One of the heavy weight classes of OOPSE, SimInfo maintains a list of molecules. - * The Molecule class maintains all of the concrete objects - * (atoms, bond, bend, torsions, rigid bodies, cutoff groups, constrains). - * In both the single and parallel versions, atoms and - * rigid bodies have both global and local indices. The local index is - * not relevant to molecules or cutoff groups. - */ + * @brief One of the heavy weight classes of OpenMD, SimInfo maintains a list of molecules. + * The Molecule class maintains all of the concrete objects + * (atoms, bond, bend, torsions, inversions, rigid bodies, cutoff groups, + * constraints). In both the single and parallel versions, atoms and + * rigid bodies have both global and local indices. The local index is + * not relevant to molecules or cutoff groups. + */ class SimInfo { public: typedef std::map::iterator MoleculeIterator; @@ -171,6 +173,10 @@ namespace oopse{ return nTorsions_; } + /** Returns the number of local torsions */ + unsigned int getNInversions() { + return nInversions_; + } /** Returns the number of local rigid bodies */ unsigned int getNRigidBodies() { return nRigidBodies_; @@ -310,6 +316,10 @@ namespace oopse{ return i != molecules_.end() ? i->second : NULL; } + int getGlobalMolMembership(int id){ + return globalMolMembership_[id]; + } + RealType getRcut() { return rcut_; } @@ -366,7 +376,7 @@ namespace oopse{ * @see #SimCreator::setGlobalIndex */ void setGlobalGroupMembership(const std::vector& globalGroupMembership) { - assert(globalGroupMembership.size() == nGlobalAtoms_); + assert(globalGroupMembership.size() == static_cast(nGlobalAtoms_)); globalGroupMembership_ = globalGroupMembership; } @@ -375,7 +385,7 @@ namespace oopse{ * @see #SimCreator::setGlobalIndex */ void setGlobalMolMembership(const std::vector& globalMolMembership) { - assert(globalMolMembership.size() == nGlobalAtoms_); + assert(globalMolMembership.size() == static_cast(nGlobalAtoms_)); globalMolMembership_ = globalMolMembership; } @@ -433,17 +443,18 @@ namespace oopse{ GenericData* getPropertyByName(const std::string& propName); /** - * add all exclude pairs of a molecule into exclude list. + * add all special interaction pairs (including excluded + * interactions) in a molecule into the appropriate lists. */ - void addExcludePairs(Molecule* mol); + void addInteractionPairs(Molecule* mol); /** - * remove all exclude pairs which belong to a molecule from exclude list + * remove all special interaction pairs which belong to a molecule + * from the appropriate lists. */ + void removeInteractionPairs(Molecule* mol); - void removeExcludePairs(Molecule* mol); - /** Returns the unique atom types of local processor in an array */ std::set getUniqueAtomTypes(); @@ -512,7 +523,7 @@ namespace oopse{ std::vector globalGroupMembership_; /** - * the size of globalGroupMembership_ is nGlobalAtoms. Its index is global index of an atom, and the + * the size of globalMolMembership_ is nGlobalAtoms. Its index is global index of an atom, and the * corresponding content is the global index of molecule this atom belong to. * It is filled by SimCreator once and only once, since it is never changed during the simulation. */ @@ -523,17 +534,21 @@ namespace oopse{ std::vector moleculeStamps_; /**< molecule stamps array */ //number of local objects - int nAtoms_; /**< number of atoms in local processor */ - int nBonds_; /**< number of bonds in local processor */ - int nBends_; /**< number of bends in local processor */ - int nTorsions_; /**< number of torsions in local processor */ - int nRigidBodies_; /**< number of rigid bodies in local processor */ - int nIntegrableObjects_; /**< number of integrable objects in local processor */ - int nCutoffGroups_; /**< number of cutoff groups in local processor */ - int nConstraints_; /**< number of constraints in local processors */ + int nAtoms_; /**< number of atoms in local processor */ + int nBonds_; /**< number of bonds in local processor */ + int nBends_; /**< number of bends in local processor */ + int nTorsions_; /**< number of torsions in local processor */ + int nInversions_; /**< number of inversions in local processor */ + int nRigidBodies_; /**< number of rigid bodies in local processor */ + int nIntegrableObjects_; /**< number of integrable objects in local processor */ + int nCutoffGroups_; /**< number of cutoff groups in local processor */ + int nConstraints_; /**< number of constraints in local processors */ simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/ - Exclude exclude_; + PairList excludedInteractions_; + PairList oneTwoInteractions_; + PairList oneThreeInteractions_; + PairList oneFourInteractions_; PropertyMap properties_; /**< Generic Property */ SnapshotManager* sman_; /**< SnapshotManager */ @@ -558,11 +573,10 @@ namespace oopse{ RealType rsw_; /**< radius of switching function*/ RealType rlist_; /**< neighbor list radius */ - bool ljsp_; /**< use shifted potential for LJ*/ - bool ljsf_; /**< use shifted force for LJ*/ + int ljsp_; /**< use shifted potential for LJ*/ + int ljsf_; /**< use shifted force for LJ*/ - bool fortranInitialized_; /**< flag indicate whether fortran side - is initialized */ + bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */ bool calcBoxDipole_; /**< flag to indicate whether or not we calculate the simulation box dipole moment */ @@ -589,7 +603,6 @@ namespace oopse{ //private: //std::vector sdByGlobalIndex_; -#ifdef IS_MPI //in Parallel version, we need MolToProc public: @@ -610,24 +623,21 @@ namespace oopse{ void setMolToProcMap(const std::vector& molToProcMap) { molToProcMap_ = molToProcMap; } - - private: void setupFortranParallel(); /** - * The size of molToProcMap_ is equal to total number of molecules in the system. - * It maps a molecule to the processor on which it resides. it is filled by SimCreator once and only - * once. + * The size of molToProcMap_ is equal to total number of molecules + * in the system. It maps a molecule to the processor on which it + * resides. it is filled by SimCreator once and only once. */ std::vector molToProcMap_; -#endif }; -} //namespace oopse +} //namespace OpenMD #endif //BRAINS_SIMMODEL_HPP