Skip to content

Commit

Permalink
Add CI test for velocity coincidence thinning (#4919)
Browse files Browse the repository at this point in the history
* add CI test for Cartesian velocity grid in resampling

* avoid unneeded picmi input parameters

* set checksum values for new test

* use seperate input file for new example
  • Loading branch information
roelof-groenewald authored May 10, 2024
1 parent 4a6ccdc commit 98bd725
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
max_step = 4
warpx.verbose = 1
warpx.const_dt = 1e-10
amr.n_cell = 256
amr.max_grid_size = 64
amr.max_level = 0
geometry.dims = 1
geometry.prob_lo = 0
geometry.prob_hi = 0.1

# Boundary condition and field solver
boundary.field_lo = periodic
boundary.field_hi = periodic
boundary.particle_lo = periodic
boundary.particle_hi = periodic
algo.particle_shape = 1
algo.maxwell_solver = none

particles.species_names = hydrogen
hydrogen.mass = 1.67262192369e-27
hydrogen.charge = 1.602176634e-19
hydrogen.injection_style = nrandompercell
hydrogen.initialize_self_fields = 0
hydrogen.do_not_push = 1
hydrogen.do_resampling = 1
hydrogen.resampling_min_ppc = 10
hydrogen.resampling_trigger_intervals = 1::2
hydrogen.resampling_algorithm = velocity_coincidence_thinning
hydrogen.resampling_algorithm_velocity_grid_type = cartesian
hydrogen.resampling_algorithm_delta_u = 10000000.0 5000000.0 7000000.0
hydrogen.num_particles_per_cell = 2500
hydrogen.momentum_distribution_type = gaussian
hydrogen.ux_m = 0.0
hydrogen.uy_m = 0.0
hydrogen.uz_m = 0.0
hydrogen.ux_th = 0.000326
hydrogen.uy_th = 0.000326
hydrogen.uz_th = 0.000326
hydrogen.profile = constant
hydrogen.density = 1e+19

# Diagnostics
diagnostics.diags_names = diag1
diag1.intervals = 4
diag1.diag_type = Full
2 changes: 1 addition & 1 deletion Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def init(self, kw):
self.resampling_algorithm_n_theta = kw.pop('warpx_resampling_algorithm_n_theta', None)
self.resampling_algorithm_n_phi = kw.pop('warpx_resampling_algorithm_n_phi', None)
self.resampling_algorithm_delta_u = kw.pop('warpx_resampling_algorithm_delta_u', None)
if np.size(self.resampling_algorithm_delta_u) == 1:
if self.resampling_algorithm_delta_u is not None and np.size(self.resampling_algorithm_delta_u) == 1:
self.resampling_algorithm_delta_u = [self.resampling_algorithm_delta_u]*3

def species_initialize_inputs(self, layout,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"lev=0": {
"Bx": 0.0,
"By": 0.0,
"Bz": 0.0,
"Ex": 0.0,
"Ey": 0.0,
"Ez": 0.0,
"jx": 434240.88525516074,
"jy": 315768.9402331213,
"jz": 642846.5589763735
},
"hydrogen": {
"particle_momentum_x": 6.919253235905925e-20,
"particle_momentum_y": 7.069867215063566e-20,
"particle_momentum_z": 7.606884436016626e-20,
"particle_position_x": 25.60006676227001,
"particle_weight": 1.0000000000000001e+18
}
}
17 changes: 17 additions & 0 deletions Regression/WarpX-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4206,6 +4206,23 @@ doVis = 0
compareParticles = 0
analysisRoutine = Examples/analysis_default_regression.py

[resample_velocity_coincidence_thinning_cartesian]
buildDir = .
inputFile = Examples/Tests/resampling/inputs_1d_velocity_coincidence_thinning_cartesian
runtime_params =
dim = 1
addToCompileString =
cmakeSetupOpts = -DWarpX_DIMS=1
restartTest = 0
useMPI = 1
numprocs = 2
useOMP = 1
numthreads = 1
compileTest = 0
doVis = 0
compareParticles = 0
analysisRoutine = Examples/analysis_default_regression.py

[restart]
buildDir = .
inputFile = Examples/Tests/restart/inputs
Expand Down

0 comments on commit 98bd725

Please sign in to comment.