Skip to content

Commit 62918df

Browse files
committed
Attempt 10 (Executes!)
1 parent 73bceb9 commit 62918df

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

Examples/Physics_applications/plasma_mirror/inputs_test_2d_plasma_mirror_picmi.py

+16-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
max_steps = 20
99

1010
# -----------------------------
11-
# User-defined Constants (from my_constants)
11+
# User-defined Constants (from your inputs file)
1212
# -----------------------------
1313
zc = 20.e-6
1414
zp = 20.05545177444479562e-6
@@ -24,7 +24,7 @@
2424
xmin, zmin = -100e-6, 0.0
2525
xmax, zmax = 100e-6, 100e-6
2626

27-
# Set moving_window_velocity so that the window moves along z
27+
# Use 'open' as boundary conditions since PICMI does not support 'pml'
2828
grid = picmi.Cartesian2DGrid(
2929
number_of_cells=[nx, nz],
3030
lower_bound=[xmin, zmin],
@@ -33,7 +33,7 @@
3333
upper_boundary_conditions=['open', 'open'],
3434
warpx_max_grid_size=128,
3535
warpx_blocking_factor=32,
36-
moving_window_velocity=[0.0, picmi.constants.c] # window moving along z
36+
# No moving window is specified
3737
)
3838

3939
# -----------------------------
@@ -50,9 +50,9 @@
5050
# electrons.zmin = zc - lgrad*log(400), zmax = 25.47931e-6
5151
zmin_e = zc - lgrad * math.log(400)
5252
zmax_e = 25.47931e-6
53-
# For species initialization, supply 3-element bounds (x, dummy y, z)
53+
# PICMI requires 3-element bounds for species even in 2D (dummy y coordinate = 0)
5454
electrons_distribution = picmi.UniformDistribution(
55-
density=nc,
55+
density=nc,
5656
lower_bound=[xmin, 0.0, zmin_e],
5757
upper_bound=[xmax, 0.0, zmax_e],
5858
fill_in=True,
@@ -84,22 +84,23 @@
8484
)
8585

8686
# -----------------------------
87-
# Laser Initialization (2D version)
87+
# Laser Initialization
8888
# -----------------------------
89-
# For a 2D simulation, define laser parameters with 2-element vectors (x,z)
89+
# Supply full 3-element vectors for laser parameters.
9090
laser1 = picmi.GaussianLaser(
9191
wavelength=0.8e-6,
9292
waist=5e-6,
9393
duration=15e-15,
94-
focal_position=[0.0, 15e-6 + 5e-6], # (x, z)
95-
centroid_position=[0.0, 5e-6 - picmi.constants.c * 25e-15],
96-
propagation_direction=[0, 1], # along z
97-
polarization_direction=[1, 0], # along x
94+
focal_position=[0.0, 0.0, 15e-6 + 5e-6], # [x, y, z]
95+
centroid_position=[0.0, 0.0, 5e-6 - picmi.constants.c * 25e-15],
96+
propagation_direction=[0, 0, 1],
97+
polarization_direction=[1, 0, 0],
9898
E0=4.e12,
99+
fill_in=False, # Disable continuous injection
99100
)
100101
laser_antenna = picmi.LaserAntenna(
101-
position=[0.0, 5e-6],
102-
normal_vector=[0, 1],
102+
position=[0.0, 0.0, 5e-6],
103+
normal_vector=[0, 0, 1],
103104
)
104105

105106
# -----------------------------
@@ -119,12 +120,12 @@
119120
solver=solver,
120121
max_steps=max_steps,
121122
verbose=1,
122-
particle_shape="cubic",
123+
particle_shape="cubic", # corresponds to order 3 particle shape
123124
warpx_use_filter=1,
124125
warpx_serialize_initial_conditions=1,
125126
)
126127

127-
# For species, use GriddedLayout with 2 macroparticles per cell (2D)
128+
# Use GriddedLayout with 2 macroparticles per cell (2D layout)
128129
sim.add_species(
129130
electrons,
130131
layout=picmi.GriddedLayout(grid=grid, n_macroparticle_per_cell=[2, 2])

0 commit comments

Comments
 (0)