--- branches/development/src/parallel/ForceDecomposition.hpp 2011/05/26 13:55:04 1569 +++ branches/development/src/parallel/ForceDecomposition.hpp 2011/06/09 20:26:29 1579 @@ -45,10 +45,15 @@ #include "brains/SimInfo.hpp" #include "brains/SnapshotManager.hpp" #include "nonbonded/NonBondedInteraction.hpp" +#include "nonbonded/Cutoffs.hpp" +#include "nonbonded/InteractionManager.hpp" +#include "utils/Tuple.hpp" using namespace std; namespace OpenMD { + typedef tuple3 groupCutoffs; + /** * @class ForceDecomposition * @@ -86,21 +91,27 @@ namespace OpenMD { class ForceDecomposition { public: - ForceDecomposition(SimInfo* info); + ForceDecomposition(SimInfo* info, InteractionManager* iMan); virtual ~ForceDecomposition() {} virtual void distributeInitialData() = 0; virtual void distributeData() = 0; + virtual void zeroWorkArrays() = 0; virtual void collectIntermediateData() = 0; virtual void distributeIntermediateData() = 0; virtual void collectData() = 0; + virtual potVec getLongRangePotential() { return longRangePot_; } // neighbor list routines virtual bool checkNeighborList(); virtual vector > buildNeighborList() = 0; + // how to handle cutoffs: + void setCutoffPolicy(CutoffPolicy cp) {cutoffPolicy_ = cp;} + void setUserCutoff(RealType rcut) {userCutoff_ = rcut; userChoseCutoff_ = true; } + // group bookkeeping - virtual pair getGroupTypes(int cg1, int cg2) = 0; + virtual groupCutoffs getGroupCutoffs(int cg1, int cg2) = 0; // Group->atom bookkeeping virtual vector getAtomsInGroupRow(int cg1) = 0; @@ -116,14 +127,16 @@ namespace OpenMD { virtual Vector3d getInteratomicVector(int atom1, int atom2) = 0; // atom bookkeeping - virtual vector getAtomList() = 0; + virtual int getNAtomsInRow() = 0; virtual vector getSkipsForAtom(int atom1) = 0; virtual bool skipAtomPair(int atom1, int atom2) = 0; virtual void addForceToAtomRow(int atom1, Vector3d fg) = 0; virtual void addForceToAtomColumn(int atom2, Vector3d fg) = 0; + virtual int getTopologicalDistance(int atom1, int atom2) = 0; // filling interaction blocks with pointers virtual InteractionData fillInteractionData(int atom1, int atom2) = 0; + virtual void unpackInteractionData(InteractionData idat, int atom1, int atom2) = 0; virtual InteractionData fillSkipData(int atom1, int atom2) = 0; virtual SelfData fillSelfData(int atom1); @@ -131,36 +144,40 @@ namespace OpenMD { SimInfo* info_; SnapshotManager* sman_; Snapshot* snap_; + ForceField* ff_; + InteractionManager* interactionMan_; + int storageLayout_; RealType skinThickness_; /**< Verlet neighbor list skin thickness */ + RealType largestRcut_; - map, int> topoDist; //< topoDist gives the - //topological distance between - //two atomic sites. This - //declaration is agnostic - //regarding the parallel - //decomposition. The two - //indices could be local or row - //& column. It will be up to - //the specific decomposition - //method to fill this. - map, bool> exclude; //< exclude is the set of pairs - //to leave out of non-bonded - //force evaluations. This - //declaration is agnostic - //regarding the parallel - //decomposition. The two - //indices could be local or row - //& column. It will be up to - //the specific decomposition - //method to fill this. + /** + * The topological distance between two atomic sites is handled + * via two vector structures for speed. These structures agnostic + * regarding the parallel decomposition. The index for + * toposForAtom could be local or row, while the values could be + * local or column. It will be up to the specific decomposition + * method to fill these. + */ + vector > toposForAtom; + vector > topoDist; + + vector > skipsForAtom; vector > groupList_; + vector cellOffsets_; Vector3i nCells_; vector > cellList_; vector saved_CG_positions_; + potVec longRangePot_; + bool userChoseCutoff_; + RealType userCutoff_; + CutoffPolicy cutoffPolicy_; + + map, tuple3 > gTypeCutoffMap; + }; } #endif