-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEfieldSingle.C
More file actions
52 lines (30 loc) · 1.1 KB
/
Copy pathEfieldSingle.C
File metadata and controls
52 lines (30 loc) · 1.1 KB
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
#include "EfieldSingle.h"
#include <math.h>
EfieldSingle::EfieldSingle(const char* name, const double thick, const double pitch, const double width, const double V):
Efield(name,thick,pitch,width,V) { }
double EfieldSingle::getPotential( const double* x, const double*) const {
double chargeeps = chargeEps();
double pot = -chargeeps/(2.*M_PI);
double rz0 = sqrt(pow(x[0],2)+pow(x[1],2));
double rz0bar = sqrt(pow(x[0],2)+pow(2*_thick-x[1],2));
pot *= log(rz0) - log(rz0bar);
return pot;
}
double EfieldSingle::getEz( const double* x, const double*) const {
double chargeeps = chargeEps();
double ez = chargeeps/(2.*M_PI);
double rz0 = sqrt(pow(x[0],2)+pow(x[1],2));
double rz0bar = sqrt(pow(x[0],2)+pow(2*_thick-x[1],2));
ez *= -x[1]/pow(rz0,2) -(2*_thick-x[1])/pow(rz0bar,2);
return ez;
}
double EfieldSingle::getEx( const double*, const double*) const {
double chargeeps = chargeEps();
/*
double ex = chargeeps/(2.*M_PI);
double rz0 = sqrt(pow(x[0],2)+pow(x[1],2));
double rz0bar = sqrt(pow(x[0],2)+pow(2*_thick-x[1],2));
*/
double ex = 0;
return ex;
}