--- branches/development/src/parallel/Decomposition.hpp 2011/03/18 19:31:52 1544 +++ branches/development/src/parallel/ForceDecomposition.hpp 2011/05/26 13:55:04 1569 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. + * Copyright (c) 2011 The University of Notre Dame. All Rights Reserved. * * The University of Notre Dame grants you ("Licensee") a * non-exclusive, royalty free, license to use, modify and @@ -39,20 +39,23 @@ * [4] Vardeman & Gezelter, in progress (2009). */ -#ifndef PARALLEL_DECOMPOSITION_HPP -#define PARALLEL_DECOMPOSITION_HPP +#ifndef PARALLEL_FORCEDECOMPOSITION_HPP +#define PARALLEL_FORCEDECOMPOSITION_HPP #include "brains/SimInfo.hpp" -#include "types/AtomType.hpp" +#include "brains/SnapshotManager.hpp" +#include "nonbonded/NonBondedInteraction.hpp" using namespace std; namespace OpenMD { /** - * @class Decomposition - * Decomposition is an interface for passing out and collecting information - * from many processors at various stages of the main non-bonded ForceLoop. + * @class ForceDecomposition * + * ForceDecomposition is an interface for passing out and collecting + * information from many processors at various stages of the main + * non-bonded ForceLoop. + * * The pairwise force calculation has an outer-running loop (the "I" * loop) and an inner-running loop (the "J" loop). In parallel * decompositions, these loop over different groups of atoms on @@ -76,15 +79,15 @@ namespace OpenMD { * end * collectData (parallel communication) * - * Decomposition provides the interface for ForceLoop to do the + * ForceDecomposition provides the interface for ForceLoop to do the * communication steps and to iterate using the correct set of atoms * and cutoff groups. */ - class Decomposition { + class ForceDecomposition { public: - Decomposition(SimInfo* info) : info_(info) {} - virtual ~Decomposition() {} + ForceDecomposition(SimInfo* info); + virtual ~ForceDecomposition() {} virtual void distributeInitialData() = 0; virtual void distributeData() = 0; @@ -92,17 +95,45 @@ namespace OpenMD { virtual void distributeIntermediateData() = 0; virtual void collectData() = 0; - virtual unsigned int getNcutoffGroupsI() = 0; - virtual unsigned int getNcutoffGroupsJ() = 0; + // neighbor list routines + virtual bool checkNeighborList(); + virtual vector > buildNeighborList() = 0; - virtual vector getAtomsInGroupI(int whichCGI) = 0; - virtual vector getAtomsInGroupJ(int whichCGJ) = 0; + // group bookkeeping + virtual pair getGroupTypes(int cg1, int cg2) = 0; - virtual AtomType* getAtomTypeI(int whichAtomI) = 0; - virtual AtomType* getAtomTypeJ(int whichAtomJ) = 0; + // Group->atom bookkeeping + virtual vector getAtomsInGroupRow(int cg1) = 0; + virtual vector getAtomsInGroupColumn(int cg2) = 0; + + virtual Vector3d getAtomToGroupVectorRow(int atom1, int cg1) = 0; + virtual Vector3d getAtomToGroupVectorColumn(int atom2, int cg2) = 0; + virtual RealType getMassFactorRow(int atom1) = 0; + virtual RealType getMassFactorColumn(int atom2) = 0; + + // spatial data + virtual Vector3d getIntergroupVector(int cg1, int cg2) = 0; + virtual Vector3d getInteratomicVector(int atom1, int atom2) = 0; + + // atom bookkeeping + virtual vector getAtomList() = 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; + + // filling interaction blocks with pointers + virtual InteractionData fillInteractionData(int atom1, int atom2) = 0; + virtual InteractionData fillSkipData(int atom1, int atom2) = 0; + virtual SelfData fillSelfData(int atom1); protected: SimInfo* info_; + SnapshotManager* sman_; + Snapshot* snap_; + int storageLayout_; + RealType skinThickness_; /**< Verlet neighbor list skin thickness */ + map, int> topoDist; //< topoDist gives the //topological distance between //two atomic sites. This @@ -123,6 +154,13 @@ namespace OpenMD { //& column. It will be up to //the specific decomposition //method to fill this. + + vector > groupList_; + vector cellOffsets_; + Vector3i nCells_; + vector > cellList_; + vector saved_CG_positions_; + }; } #endif