forked from lotov/lcode3d
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig_example.py
More file actions
30 lines (21 loc) · 1.16 KB
/
config_example.py
File metadata and controls
30 lines (21 loc) · 1.16 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
grid_steps = 641 #: Transverse grid size in cells
grid_step_size = .025 #: Transverse grid step size in plasma units
xi_step_size = .005 #: Step size in time-space coordinate xi
xi_steps = int(3000 // xi_step_size) #: Amount of xi steps
diagnostics_each_N_steps = int(1 / xi_step_size)
field_solver_subtraction_trick = 1 #: 0 for Laplace eqn., Helmholtz otherwise
field_solver_variant_A = True #: Use Variant A or Variant B for Ex, Ey, Bx, By
reflect_padding_steps = 5 #: Plasma reflection <-> field calculation boundaries
plasma_padding_steps = 10 #: Plasma placement <-> field calculation boundaries
plasma_coarseness = 3 #: Square root of the amount of cells per coarse particle
plasma_fineness = 2 #: Square root of the amount of fine particles per cell
from numpy import cos, exp, pi, sqrt
def beam(xi_i, x, y):
xi = -xi_i * xi_step_size
COMPRESS, BOOST, SIGMA, SHIFT = 1, 1, 1, 0
if xi < -2 * sqrt(2 * pi) / COMPRESS:
return 0
r = sqrt(x**2 + (y - SHIFT)**2)
return (.05 * BOOST * exp(-.5 * (r / SIGMA)**2) *
(1 - cos(xi * COMPRESS * sqrt(pi / 2))))
gpu_index = 0 #: Index of the GPU that should perform the calculations