-
Notifications
You must be signed in to change notification settings - Fork 2
/
cell.cpp
90 lines (64 loc) · 2.97 KB
/
cell.cpp
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
//----------------------------------------------------------------------------------||
//------------------- cell.cpp -------------------||
//----------------------------------------------------------------------------------||
// ||
// __ ___ _ _ ____ ____ ___ ____ ||
// \ \ / / \ | \ | | _ \ | _ \_ _/ ___| ||
// \ \ /\ / / _ \ | \| | | | |_____| |_) | | | ||
// \ 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------------ : tw474@cornell.edu --------------------||
//---Group------------ : Dr. Gennady Shvets' Group --------------------||
//---Copyright-------- : (C) 2019 by Tianhong Wang --------------------||
//----------------------------------------------------------------------------------||
//----------------------------------------------------------------------------------||
#include <stdio.h>
#include <stdlib.h>
#include "wand_PIC.h"
//=======Cell Class
Cell::Cell()
{
W_Ex = W_Ey = W_Ez = 0.0;
W_Bx = W_By = W_Bz = 0.0;
W_Denn = W_Jx = W_Jy = 0.0;
W_Jxx = W_Jyy = W_Jxy = 0.0;
B_Den = B_Jx = B_Jy = B_Jz = B_Chi = 0.0;
W_Deni = 1.0;
W_Psi = 0.0;
W_Ponx = W_Pony =0.0;
//===========================================
int NF = p_domain()->NFreqs;
L_Ex = L_Ey = L_Ez = NULL;
L_Bx = L_By = L_Bz = NULL;
Acomx = Acomy = NULL;
Acomxm = Acomym = NULL;
if(NF>0)
{
L_Ex = new dcomplex[ NF];
L_Ey = new dcomplex[ NF];
L_Ez = new dcomplex[ NF];
L_Bx = new dcomplex[ NF];
L_By = new dcomplex[ NF];
L_Bz = new dcomplex[ NF];
Acomx = new dcomplex[ NF];
Acomy = new dcomplex[ NF];
Acomxm = new dcomplex[ NF];
Acomym = new dcomplex[ NF];
for (int i=0;i<NF;i++)
{
L_Ex[i] = L_Ey[i] = L_Ez[i] = 0.0;
L_Bx[i] = L_By[i] = L_Bz[i] = 0.0;
Acomx[i] = Acomy[i] = Acomxm[i] = Acomym[i] = 0.0;
}
}
InoState=1;
};
//---Cell::~Cell--------------------------------------------->
Cell::~Cell()
{}