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 |
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 "Parallel/Communicator.hpp" |
47 |
+ |
#include "math/SquareMatrix3.hpp" |
48 |
|
|
49 |
< |
/* -*- c++ -*- */ |
50 |
< |
#ifndef FORCEDECOMPOSITION_PARALLEL_HPP |
52 |
< |
#define FORCEDECOMPOSITION_PARALLEL_HPP |
53 |
< |
|
54 |
< |
|
55 |
< |
namespace OpenMD{ |
56 |
< |
|
57 |
< |
class ForceDecomposition |
58 |
< |
{ |
59 |
< |
public: |
60 |
< |
ForceDecomposition(); |
61 |
< |
virtual ~ForceDecomposition(); |
62 |
< |
void gather(); |
63 |
< |
void scatter(); |
49 |
> |
using namespace std; |
50 |
> |
namespace OpenMD { |
51 |
|
|
52 |
< |
protected: |
53 |
< |
private: |
54 |
< |
int myRank_; |
55 |
< |
static bool isColumn_; |
56 |
< |
static int myIndex_: |
57 |
< |
}; |
52 |
> |
class ForceDecomposition : public Decomposition { |
53 |
> |
public: |
54 |
> |
ForceDecomposition(Snapshot* sman); |
55 |
> |
void distributeInitialData(); |
56 |
> |
void distributeData(); |
57 |
> |
void collectIntermediateData(); |
58 |
> |
void distributeIntermediateData(); |
59 |
> |
void collectData(); |
60 |
|
|
61 |
+ |
unsigned int getNcutoffGroupsI(); |
62 |
+ |
unsigned int getNcutoffGroupsJ(); |
63 |
|
|
64 |
+ |
vector<int> getAtomsInGroupI(int whichCGI); |
65 |
+ |
vector<int> getAtomsInGroupJ(int whichCGJ); |
66 |
|
|
67 |
< |
} |
67 |
> |
AtomType* getAtomTypeI(int whichAtomI); |
68 |
> |
AtomType* getAtomTypeJ(int whichAtomJ); |
69 |
|
|
70 |
+ |
#ifdef IS_MPI |
71 |
+ |
|
72 |
+ |
Communicator<Row, RealType>* AtomCommRealI; |
73 |
+ |
Communicator<Row, Vector3d>* AtomCommVectorI; |
74 |
+ |
Communicator<Row, Mat3x3d>* AtomCommMatrixI; |
75 |
|
|
76 |
+ |
Communicator<Column, RealType>* AtomCommRealJ; |
77 |
+ |
Communicator<Column, Vector3d>* AtomCommVectorJ; |
78 |
+ |
Communicator<Column, Mat3x3d>* AtomCommMatrixJ; |
79 |
|
|
80 |
+ |
Communicator<Row, Vector3d>* cgCommVectorI; |
81 |
+ |
Communicator<Column, Vector3d>* cgCommVectorJ; |
82 |
|
|
83 |
+ |
private: |
84 |
+ |
vector<vector<RealType> > pot_row; |
85 |
+ |
vector<vector<RealType> > pot_col; |
86 |
+ |
vector<vector<RealType> > pot_local; |
87 |
+ |
#endif |
88 |
+ |
}; |
89 |
|
|
90 |
< |
|
81 |
< |
|
82 |
< |
|
90 |
> |
} |
91 |
|
#endif |
92 |
|
|
85 |
– |
|