-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcell.h
109 lines (81 loc) · 3.18 KB
/
cell.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
//----------------------------------------------------------------------------------||
//------------------- cell.h -------------------||
//----------------------------------------------------------------------------------||
// ||
// __ ___ _ _ ____ ____ ___ ____ ||
// \ \ / / \ | \ | | _ \ | _ \_ _/ ___| ||
// \ \ /\ / / _ \ | \| | | | |_____| |_) | | | ||
// \ V V / ___ \| |\ | |_| |_____| __/| | |___ ||
// \_/\_/_/ \_\_| \_|____/ |_| |___\____| ||
// ||
//----------------------------------------------------------------------------------||
//-- (W)akefield (A)cceleration a(n)d (D)LA - (P)article (i)n (C)ell Simulation --||
//----------------------------------------------------------------------------------||
//---Author----------- : Tianhong Wang --------------------||
//---Starting--------- : Jan-27-2019 --------------------||
//---Email------------ : [email protected] --------------------||
//---Group------------ : Dr. Gennady Shvets' Group --------------------||
//---Copyright-------- : (C) 2019 by Tianhong Wang --------------------||
//----------------------------------------------------------------------------------||
//----------------------------------------------------------------------------------||
#ifndef H_CELLS
#define H_CELLS
#include "wand_PIC.h"
//class Domain; // forward declaration of Domain
class Mesh;
class Cell
{
friend class Mesh;
friend class Commute;
friend class Domain;
friend class MultiGrid;
private:
Domain *p_domain() {return Domain::p_Domain;}; // pointer to domain class.
//=====Wake Fields=======
union
{
WDOUBLE W_Fields[1];
WDOUBLE W_Psi;
};
// Ex and Ey here is actually d\psi/dx and d\psi/dy
// Ponx is the pondermotive force.
// Psi Ez, Bz, Bx, By is solved by MG.
WDOUBLE W_Ez, W_Bz, W_Bx, W_By;
WDOUBLE W_Ex, W_Ey, W_Ponx, W_Pony, W_Asq;
//=====Wake Currents and Densities=======
union
{
WDOUBLE W_Source[1];
WDOUBLE W_Denn;
};
WDOUBLE W_Jx, W_Jy, W_Jxx, W_Jyy, W_Jxy;
WDOUBLE B_Den, B_Jx, B_Jy, B_Jz, B_Chi; // beam density and current
WDOUBLE W_Deni; // ion macro density
WDOUBLE W_Chi;
WDOUBLE W_Jz;
// Variable Grid Size.
WDOUBLE dx;
WDOUBLE dy;
WDOUBLE Xcord;
WDOUBLE Ycord;
dcomplex *Acomx;
dcomplex *Acomy;
dcomplex *Acomxm; //old value;
dcomplex *Acomym; //old value;
//=====Laser Fields=======
dcomplex *L_Ex;
dcomplex *L_Ey, *L_Ez, *L_Bx, *L_By, *L_Bz;
public:
int InoState;
WDOUBLE Z_shifted;
void AddAComs(dcomplex acomx, dcomplex acomy, int NF)
{
Acomx[NF] += acomx;
Acomy[NF] += acomy;
Acomxm[NF] = Acomx[NF];
Acomym[NF] = Acomy[NF];
}
Cell();
~Cell();
};
#endif