Space charge grid sizing #969
-
Hi ImpactX developers, I'm comparing ImpactX to PyORBIT in some simple cases. For example, this simulation tracks a spherical Gaussian distribution through a drift with 3D space charge forces: https://github.com/austin-hoover/pyorbit-benchmarks/blob/main/free-expansion/impactx/run.py. For PyORBIT space charge calculations, I'm using a grid of constant size ( Here are some settings which were adapted from the examples repo. If I understand sim = impactx.ImpactX()
sim.max_level = 1
sim.n_cell = [16, 16, 20]
sim.blocking_factor_x = [16] # grid size must be divisible by this
sim.blocking_factor_y = [16]
sim.blocking_factor_z = [4]
sim.particle_shape = 2 # B-spline order
sim.space_charge = "3D"
sim.poisson_solver = "fft"
sim.dynamic_size = True # ?
sim.prob_relative = [1.05, 1.05, 1.05] # mesh size relative to beam extent Also, any references to help understand the adaptive grid sizing would be appreciated. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@austin-hoover Thanks for your question. A high-level description of parameters related to the grid size (and other space charge inputs) appears in the Usage > Parameters > Collective Effects section of the documentation. Several of these parameters are related to the multi-level multi-grid (MLMG) solver and the support for adaptive mesh refinement. As a start, to avoid confusion, I recommend using the FFT solver, as you do above, and disabling adaptive mesh refinement by setting |
Beta Was this translation helpful? Give feedback.
-
@cemitch99 Thanks for the help! |
Beta Was this translation helpful? Give feedback.
@austin-hoover Thanks for your question. A high-level description of parameters related to the grid size (and other space charge inputs) appears in the Usage > Parameters > Collective Effects section of the documentation. Several of these parameters are related to the multi-level multi-grid (MLMG) solver and the support for adaptive mesh refinement.
As a start, to avoid confusion, I recommend using the FFT solver, as you do above, and disabling adaptive mesh refinement by setting
sim.max_level = 0
(or commenting this input line entirely, since this setting is the internal default). The number of grid cells in each dimension is then set bysim.n_cell = [N_x,N_y,N_z]
. The physical dimension…