# | Line 1 | Line 1 | |
---|---|---|
1 | < | /** |
2 | < | * @file ForceDecomposition.cpp |
3 | < | * @author Charles Vardeman <cvardema.at.nd.edu> |
4 | < | * @date 08/18/2010 |
5 | < | * @time 11:56am |
6 | < | * @version 1.0 |
1 | > | /* |
2 | > | * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 | * | |
8 | – | * @section LICENSE |
9 | – | * Copyright (c) 2010 The University of Notre Dame. All Rights Reserved. |
10 | – | * |
4 | * The University of Notre Dame grants you ("Licensee") a | |
5 | * non-exclusive, royalty free, license to use, modify and | |
6 | * redistribute this software in source and binary code form, provided | |
# | Line 45 | Line 38 | |
38 | * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). | |
39 | * [4] Vardeman & Gezelter, in progress (2009). | |
40 | */ | |
41 | + | |
42 | + | #ifndef PARALLEL_FORCEDECOMPOSITION_HPP |
43 | + | #define PARALLEL_FORCEDECOMPOSITION_HPP |
44 | ||
45 | + | #include "Parallel/Decomposition.hpp" |
46 | + | #include "math/SquareMatrix3.hpp" |
47 | ||
48 | < | /* -*- c++ -*- */ |
49 | < | #ifndef FORCEDECOMPOSITION_PARALLEL_HPP |
50 | < | #define FORCEDECOMPOSITION_PARALLEL_HPP |
48 | > | #ifdef IS_MPI |
49 | > | #include "Parallel/Communicator.hpp" |
50 | > | #endif |
51 | ||
52 | < | |
53 | < | namespace OpenMD{ |
56 | < | |
57 | < | class ForceDecomposition |
58 | < | { |
59 | < | public: |
60 | < | ForceDecomposition(); |
61 | < | virtual ~ForceDecomposition(); |
62 | < | void gather(); |
63 | < | void scatter(); |
52 | > | using namespace std; |
53 | > | namespace OpenMD { |
54 | ||
55 | < | protected: |
56 | < | private: |
57 | < | int myRank_; |
58 | < | static bool isColumn_; |
59 | < | static int myIndex_: |
60 | < | }; |
55 | > | class ForceDecomposition : public Decomposition { |
56 | > | public: |
57 | > | ForceDecomposition(SimInfo* info) : Decomposition(info) {sman_ = info_->getSnapshotManager();} |
58 | > | void distributeInitialData(); |
59 | > | void distributeData(); |
60 | > | void collectIntermediateData(); |
61 | > | void distributeIntermediateData(); |
62 | > | void collectData(); |
63 | ||
64 | + | unsigned int getNcutoffGroupsI(); |
65 | + | unsigned int getNcutoffGroupsJ(); |
66 | ||
67 | + | vector<int> getAtomsInGroupI(int whichCGI); |
68 | + | vector<int> getAtomsInGroupJ(int whichCGJ); |
69 | ||
70 | < | } |
70 | > | AtomType* getAtomTypeI(int whichAtomI); |
71 | > | AtomType* getAtomTypeJ(int whichAtomJ); |
72 | ||
73 | + | private: |
74 | + | SnapshotManager* sman_; |
75 | + | #ifdef IS_MPI |
76 | + | Communicator<Row, int>* AtomCommIntI; |
77 | + | Communicator<Row, RealType>* AtomCommRealI; |
78 | + | Communicator<Row, Vector3d>* AtomCommVectorI; |
79 | + | Communicator<Row, Mat3x3d>* AtomCommMatrixI; |
80 | ||
81 | + | Communicator<Column, int>* AtomCommIntJ; |
82 | + | Communicator<Column, RealType>* AtomCommRealJ; |
83 | + | Communicator<Column, Vector3d>* AtomCommVectorJ; |
84 | + | Communicator<Column, Mat3x3d>* AtomCommMatrixJ; |
85 | ||
86 | + | Communicator<Row, int>* cgCommIntI; |
87 | + | Communicator<Row, Vector3d>* cgCommVectorI; |
88 | + | Communicator<Column, int>* cgCommIntJ; |
89 | + | Communicator<Column, Vector3d>* cgCommVectorJ; |
90 | ||
91 | + | vector<vector<RealType> > pot_row; |
92 | + | vector<vector<RealType> > pot_col; |
93 | + | vector<int> identRow; |
94 | + | vector<int> identCol; |
95 | ||
96 | + | vector<int> AtomLocalToGlobal; |
97 | + | vector<int> AtomRowToGlobal; |
98 | + | vector<int> AtomColToGlobal; |
99 | + | vector<int> cgLocalToGlobal; |
100 | + | vector<int> cgRowToGlobal; |
101 | + | vector<int> cgColToGlobal; |
102 | + | #endif |
103 | + | vector<RealType> pot_local; |
104 | + | }; |
105 | ||
106 | < | |
82 | < | |
106 | > | } |
107 | #endif | |
108 | ||
85 | – |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |