-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable general weight scaling for radial particle distributions #5009
base: development
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
This reverts commit 521dc5d.
Trying to fix the error during the test: /home/runner/work/WarpX/WarpX/Source/Initialization/PlasmaInjector.cpp:72:5: warning: 'zmax' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer] zmax = std::numeric_limits<amrex::Real>::max();
for more information, see https://pre-commit.ci
Adding "amrex::Real" to define xmin,ymin,zmin,xmax,ymax,zmax
@@ -142,6 +142,7 @@ def calculate_error(E_axis, xmin, dx, nx): | |||
print("L2 error along x-axis = %s" %L2_error_x) | |||
print("L2 error along y-axis = %s" %L2_error_y) | |||
print("L2 error along z-axis = %s" %L2_error_z) | |||
print("L2 error tolerance = %s" %l2_tolerance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These print statements were added to provide more output in cases when the checks fail. This was helpful in getting the new CI test working.
electron.charge = -q_e | ||
electron.mass = m_e | ||
electron.injection_style = "NUniformPerCell" | ||
electron.num_particles_per_cell_each_dim = 6 2 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note here that more particles are needed in this test compared to the non-uniformly weighted case to get to the same tolerance. This is because the error is being checked on axis which has fewer particles when doing uniform weighting.
@@ -51,7 +51,7 @@ | |||
########################## | |||
|
|||
uniform_plasma = picmi.UniformDistribution(density = density, | |||
upper_bound = [+18e-6, +18e-6, None], | |||
upper_bound = [+18e-6, None, +40e-6], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug found in this input file that made this test fail with the updated code.
for more information, see https://pre-commit.ci
This PR adds the new input parameter
radial_weight_power
which specifies the radial power for the particle weight when using cylindrical geometry. The default value of 1 gives uniform particles per cells with increasing weight with radius, the value 0 gives uniformly weighted particles.Note that this removes the parameter
radially_weighted
which is no longer used and could not be changed from its default value anyway.Several CI benchmarks are updated due to changes in round-off.
Note that this replaces PR #4342