-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathparticles.h
178 lines (111 loc) · 3.64 KB
/
particles.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
//----------------------------------------------------------------------------------||
//------------------- particles.h -------------------||
//----------------------------------------------------------------------------------||
// ||
// __ ___ _ _ ____ ____ ___ ____ ||
// \ \ / / \ | \ | | _ \ | _ \_ _/ ___| ||
// \ \ /\ / / _ \ | \| | | | |_____| |_) | | | ||
// \ V V / ___ \| |\ | |_| |_____| __/| | |___ ||
// \_/\_/_/ \_\_| \_|____/ |_| |___\____| ||
// ||
//----------------------------------------------------------------------------------||
//-- (W)akefield (A)cceleration a(n)d (D)LA - (P)article (i)n (C)ell Simulation --||
//----------------------------------------------------------------------------------||
//---Author----------- : Tianhong Wang --------------------||
//---Starting--------- : Apr-23-2019 --------------------||
//---Email------------ : [email protected] --------------------||
//---Group------------ : Dr. Gennady Shvets' Group --------------------||
//---Copyright-------- : (C) 2019 by Tianhong Wang --------------------||
//----------------------------------------------------------------------------------||
//----------------------------------------------------------------------------------||
#ifndef H_PARTS
#define H_PARTS
#define ELECTRON 0
#define ION 1
class Particle{
friend class Domain;
friend class Mesh;
friend class Commute;
public:
WDOUBLE x;
WDOUBLE y;
WDOUBLE z;
WDOUBLE x0;
WDOUBLE y0;
WDOUBLE z0;
WDOUBLE Ex0;
WDOUBLE Ey0;
WDOUBLE Ez0;
int type;
int idx_i;
int idx_j;
WDOUBLE sx;
WDOUBLE sy;
union
{
WDOUBLE P_Source[1];
WDOUBLE unitm;
};
WDOUBLE px, py, pz, gamma, q2m, weight, Q;
WDOUBLE Wxw, Wyw, Wzw, Wxl, Wyl, Wzl;
Domain *p_domain() {return Domain::p_Domain;};
Particle *p_PrevPart;
Particle *p_NextPart;
public:
Particle(WDOUBLE x0p, WDOUBLE y0p, WDOUBLE z0p,
WDOUBLE pxp, WDOUBLE pyp, WDOUBLE pzp,
WDOUBLE Ex0p, WDOUBLE Ey0p, WDOUBLE Ez0p,
WDOUBLE q2mp, WDOUBLE weightp);
virtual ~Particle() {;};
};
class Electron : public Particle {
public:
Electron(WDOUBLE x0p, WDOUBLE y0p, WDOUBLE z0p,
WDOUBLE pxp, WDOUBLE pyp, WDOUBLE pzp,
WDOUBLE Ex0p, WDOUBLE Ey0p, WDOUBLE Ez0p,
WDOUBLE q2mp, WDOUBLE weightp);
~Electron();
};
class Ion : public Particle {
public:
Ion(WDOUBLE x0p, WDOUBLE y0p, WDOUBLE z0p,
WDOUBLE pxp, WDOUBLE pyp, WDOUBLE pzp,
WDOUBLE Ex0p, WDOUBLE Ey0p, WDOUBLE Ez0p,
WDOUBLE q2mp, WDOUBLE weightp);
~Ion();
};
class Specie : public NList {
friend class Domain;
friend class Mesh;
public:
Domain *p_domain() {return Domain::p_Domain;};
// 0 - Electron; 1 - ion
int P_type;
int P_profile;
WDOUBLE density;
int PpCellx;
int PpCelly;
int PpCellz;
int Seed_type;
WDOUBLE P_Centerx;
WDOUBLE P_Centery;
WDOUBLE P_Centerz;
WDOUBLE P_Sizex;
WDOUBLE P_Sizey;
WDOUBLE P_Sizez;
int P_order;
WDOUBLE P_deltaZ;
WDOUBLE P_px0;
WDOUBLE P_py0;
WDOUBLE P_pz0;
WDOUBLE pxspread;
WDOUBLE pyspread;
WDOUBLE pzspread;
WDOUBLE p_q2m;
public:
WDOUBLE Density(WDOUBLE x0, WDOUBLE y0, WDOUBLE z0);
int Get_NParts();
Specie(char *name, FILE *f);
~Specie();
};
#endif