--- branches/development/src/parallel/ForceDecomposition.hpp 2011/01/11 18:58:12 1538 +++ branches/development/src/parallel/ForceDecomposition.hpp 2011/03/18 19:31:52 1544 @@ -1,13 +1,6 @@ -/** - * @file ForceDecomposition.cpp - * @author Charles Vardeman - * @date 08/18/2010 - * @time 11:56am - * @version 1.0 +/* + * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. * - * @section LICENSE - * Copyright (c) 2010 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 * redistribute this software in source and binary code form, provided @@ -45,41 +38,71 @@ * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). * [4] Vardeman & Gezelter, in progress (2009). */ + +#ifndef PARALLEL_FORCEDECOMPOSITION_HPP +#define PARALLEL_FORCEDECOMPOSITION_HPP +#include "Parallel/Decomposition.hpp" +#include "math/SquareMatrix3.hpp" -/* -*- c++ -*- */ -#ifndef FORCEDECOMPOSITION_PARALLEL_HPP -#define FORCEDECOMPOSITION_PARALLEL_HPP +#ifdef IS_MPI +#include "Parallel/Communicator.hpp" +#endif - -namespace OpenMD{ - -class ForceDecomposition -{ - public: - ForceDecomposition(); - virtual ~ForceDecomposition(); - void gather(); - void scatter(); +using namespace std; +namespace OpenMD { - protected: - private: - int myRank_; - static bool isColumn_; - static int myIndex_: -}; + class ForceDecomposition : public Decomposition { + public: + ForceDecomposition(SimInfo* info) : Decomposition(info) {sman_ = info_->getSnapshotManager();} + void distributeInitialData(); + void distributeData(); + void collectIntermediateData(); + void distributeIntermediateData(); + void collectData(); + unsigned int getNcutoffGroupsI(); + unsigned int getNcutoffGroupsJ(); + vector getAtomsInGroupI(int whichCGI); + vector getAtomsInGroupJ(int whichCGJ); -} + AtomType* getAtomTypeI(int whichAtomI); + AtomType* getAtomTypeJ(int whichAtomJ); + private: + SnapshotManager* sman_; +#ifdef IS_MPI + Communicator* AtomCommIntI; + Communicator* AtomCommRealI; + Communicator* AtomCommVectorI; + Communicator* AtomCommMatrixI; + Communicator* AtomCommIntJ; + Communicator* AtomCommRealJ; + Communicator* AtomCommVectorJ; + Communicator* AtomCommMatrixJ; + Communicator* cgCommIntI; + Communicator* cgCommVectorI; + Communicator* cgCommIntJ; + Communicator* cgCommVectorJ; + vector > pot_row; + vector > pot_col; + vector identRow; + vector identCol; + vector AtomLocalToGlobal; + vector AtomRowToGlobal; + vector AtomColToGlobal; + vector cgLocalToGlobal; + vector cgRowToGlobal; + vector cgColToGlobal; +#endif + vector pot_local; + }; - - +} #endif -