-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommute.h
116 lines (81 loc) · 3.59 KB
/
commute.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//----------------------------------------------------------------------------------||
//------------------- commute.h -------------------||
//----------------------------------------------------------------------------------||
// ||
// __ ___ _ _ ____ ____ ___ ____ ||
// \ \ / / \ | \ | | _ \ | _ \_ _/ ___| ||
// \ \ /\ / / _ \ | \| | | | |_____| |_) | | | ||
// \ V V / ___ \| |\ | |_| |_____| __/| | |___ ||
// \_/\_/_/ \_\_| \_|____/ |_| |___\____| ||
// ||
//----------------------------------------------------------------------------------||
//-- (W)akefield (A)cceleration a(n)d (D)LA - (P)article (i)n (C)ell Simulation --||
//----------------------------------------------------------------------------------||
//---Author----------- : Tianhong Wang --------------------||
//---Starting--------- : Feb-05-2019 --------------------||
//---Email------------ : [email protected] --------------------||
//---Group------------ : Dr. Gennady Shvets' Group --------------------||
//---Copyright-------- : (C) 2019 by Tianhong Wang --------------------||
//----------------------------------------------------------------------------------||
//----------------------------------------------------------------------------------||
#ifndef H_COMM
#define H_COMM
#include<vector>
//---------------------------- Mesh class -----------------------
class Commute
{
friend class Domain;
friend class Mesh;
private:
Domain *p_domain() {return Domain::p_Domain;}; // pointer to domain class.
int bufsize;
WDOUBLE *SendSourceXm; //Array to send for the sources;
WDOUBLE *SendSourceYm; //Array to send for the sources;
WDOUBLE *SendSourceXp; //Array to send for the sources;
WDOUBLE *SendSourceYp; //Array to send for the sources;
WDOUBLE *ReceSourceXm; //Array for Rece
WDOUBLE *ReceSourceYm; //Array for Rece
WDOUBLE *ReceSourceXp; //Array for Rece
WDOUBLE *ReceSourceYp; //Array for Rece
// diagonal
WDOUBLE *SendSourcemm; //Array to send for the sources;
WDOUBLE *SendSourcemp; //Array to send for the sources;
WDOUBLE *SendSourcepm; //Array to send for the sources;
WDOUBLE *SendSourcepp; //Array to send for the sources;
WDOUBLE *ReceSourcemm; //Array for Rece
WDOUBLE *ReceSourcemp; //Array for Rece
WDOUBLE *ReceSourcepm; //Array for Rece
WDOUBLE *ReceSourcepp; //Array for Rece
//WDOUBLE *SendFields; //Array to send for the fields;
int SendSouSizeX;
int SendSouSizeY;
int SendFieSizeX;
int Rank;
int RankIdx_X;
int RankIdx_Y;
int Xpa;
int Ypa;
int XmPE;
int XpPE;
int YmPE;
int YpPE;
int mmPE;
int mpPE;
int pmPE;
int ppPE;
int GridX;
int GridY;
int kold;
std::vector<WDOUBLE> CellAccX;
std::vector<WDOUBLE> CellAccY;
public:
void DoCommuteT(exchange what, std::vector<int> SendN);
void UnPackT(exchange what, std::vector<int> ReceN);
void DoCommute(exchange what, int k);
void DoPack(exchange what, int k);
void UnPack(exchange what, int k);
int Get_bufsize() {return bufsize;};
Commute(int XGridN, int YGridN);
~Commute();
};
#endif