Line | |
---|
1 | subroutine eh |
---|
2 | c--calculate instantaneous E and H fields a moving charge j at position i |
---|
3 | c-------------------------------------------------------------------------- |
---|
4 | c |
---|
5 | include 'psizescom.h' |
---|
6 | c |
---|
7 | common/ehparm/xi,yi,zi,ex,ey,eez,hx,hy,hz,xj,yj,zj,gbxj,gbyj, |
---|
8 | . gbzj,gamma,qfac |
---|
9 | c-------------------------------------------------------------------------- |
---|
10 | c* |
---|
11 | c r = vector from j to i |
---|
12 | rx = xi - xj |
---|
13 | ry = yi - yj |
---|
14 | rz = zi - zj |
---|
15 | rxsq = rx**2 |
---|
16 | rysq = ry**2 |
---|
17 | rzsq = rz**2 |
---|
18 | rsq = rxsq + rysq + rzsq |
---|
19 | c skip if rsq = 0 |
---|
20 | if (rsq.lt.1.e-10) return |
---|
21 | c scalar product of gamma*beta(j) and r |
---|
22 | cosesq = (gbxj*rx + gbyj*ry + gbzj*rz)**2 |
---|
23 | c calculate field at i of moving charge j, assuming uniform velocity |
---|
24 | c at present value |
---|
25 | crsq = rsq + cosesq |
---|
26 | crsq = crsq*crsq*crsq |
---|
27 | qf = qfac |
---|
28 | c reduce the charge if superparticles are too close |
---|
29 | if (rxsq.lt.xsqsiz.and.rysq.lt.ysqsiz.and.rzsq.lt.zsqsiz) |
---|
30 | . qf = qf*sqrt(rxsq*rysq*rzsq)/xyzvol |
---|
31 | efac = qf/sqrt(crsq) |
---|
32 | exj = efac*rx |
---|
33 | eyj = efac*ry |
---|
34 | ezj = efac*rz |
---|
35 | ex = ex + exj*gamma |
---|
36 | ey = ey + eyj*gamma |
---|
37 | eez=eez + ezj*gamma |
---|
38 | hx = hx + gbyj*ezj - gbzj*eyj |
---|
39 | hy = hy + gbzj*exj - gbxj*ezj |
---|
40 | hz = hz + gbxj*eyj - gbyj*exj |
---|
41 | return |
---|
42 | end |
---|
43 | c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* |
---|
Note: See
TracBrowser
for help on using the repository browser.