Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
61031c7
Update constants to use values from CODATA2022
dpgrote Feb 12, 2025
bc01ca7
Update 3d benchmarks
dpgrote Feb 12, 2025
2de9547
Update 1d benchmarks
dpgrote Feb 12, 2025
5471faf
Update 2d CI benchmarks
dpgrote Feb 12, 2025
26243d8
Update RZ CI benchmarks
dpgrote Feb 12, 2025
23b4cf7
Needed to increase tolerance of test_rz_galilean_psatd_current_correc…
dpgrote Feb 13, 2025
18b993f
Update constants in various input files and scripts
dpgrote Feb 13, 2025
1087f55
Replaced hardwired constants with values from scipy or parser
dpgrote Mar 4, 2025
4ffcb36
Update more CI benchmarks
dpgrote Mar 4, 2025
ee61a25
Update Ubuntu to 24.04 for the Azure tests
dpgrote Mar 6, 2025
eeac26c
Merge branch 'development' into update_constants_to_CODATA2022
dpgrote Mar 6, 2025
e962ec8
For update of Ubuntu, remove system version of matplotlib to avoid co…
dpgrote Mar 7, 2025
a22e552
Fix hardwired constant in Examples/Tests/collision/analysis_collision…
dpgrote Mar 7, 2025
36190b9
Various fixes of CI tests
dpgrote Mar 7, 2025
2343f15
Update CI benchmark test_1d_collision_z.json
dpgrote Mar 7, 2025
7e291a1
Merge branch 'development' into update_constants_to_CODATA2022
dpgrote Mar 24, 2025
450a486
Update some 2D CI benchmarks
dpgrote Mar 24, 2025
383bae0
Update the tolerance for the energy check in test_2d_proton_boron_fusion
dpgrote Mar 24, 2025
5fff1e9
Update test values for test_1d_ohm_solver_ion_beam_picmi
dpgrote Mar 25, 2025
a5b04f7
Updated saved values in CI test test_2d_pml_x_galilean
dpgrote Mar 25, 2025
3b01078
Fix in test_2d_rigid_injection_lab CI
dpgrote Mar 25, 2025
f0d597c
Update fixed value in test_3d_load_external_field_grid_picmi
dpgrote Mar 25, 2025
2065390
Fix analysis script for test_3d_deuterium_deuterium_fusion
dpgrote Mar 25, 2025
0c5c68a
Updated benchmarks test_3d_deuterium_deuterium_fusion.json
dpgrote Mar 25, 2025
34b50ea
Update benchmarks test_3d_deuterium_deuterium_fusion_intraspecies.json
dpgrote Mar 25, 2025
6818f9a
Update benchmarks test_3d_deuterium_tritium_fusion.json
dpgrote Mar 25, 2025
0291a9c
Update benchmark test_3d_proton_boron_fusion.json
dpgrote Mar 25, 2025
549718e
Update benchmark test_3d_open_bc_poisson_solver.json
dpgrote Mar 25, 2025
178e831
Update benchmark test_rz_langmuir_multi_psatd.json
dpgrote Mar 25, 2025
47fcfac
Update benchmark test_rz_langmuir_multi_psatd_current_correction.json
dpgrote Mar 25, 2025
3a846af
Update benchmark test_rz_laser_injection_from_lasy_file.json
dpgrote Mar 25, 2025
9096006
Update benchmark test_rz_laser_injection_from_RZ_lasy_file.json
dpgrote Mar 25, 2025
7bfb51f
Update benchmark test_rz_deuterium_tritium_fusion.json
dpgrote Mar 25, 2025
74dcace
Fix analysis file for test_rz_ohm_solver_em_modes_picmi
dpgrote Mar 25, 2025
98dae2a
Merge branch 'development' into update_constants_to_CODATA2022
dpgrote Mar 25, 2025
8bcac52
Update 3d CI tests
dpgrote Mar 26, 2025
349a0ab
Update mu0 and alpha to get exact consistency between constants
dpgrote Apr 1, 2025
d690296
Update CI benchmarks
dpgrote Apr 1, 2025
a3ab35f
Fix a few more CI tests
dpgrote Apr 2, 2025
6edebb4
Revert change in tolerance in implicit/analysis_vandb_jfnk_2d.py
dpgrote Apr 2, 2025
ce0f2b9
Reverted change in tolerance in nci_psatd_stability/analysis_galilean.py
dpgrote Apr 2, 2025
fc2ee5b
Revert change in tolerance in nuclear_fusion/analysis_proton_boron_fu…
dpgrote Apr 2, 2025
3578a93
Fetch PICSAR commit with latest update of constants
EZoni Apr 2, 2025
3098538
Update CI benchmarks and test tolerance
dpgrote Apr 2, 2025
13c764b
Fix momentum tolerance in CI test test_3d_photon_pusher
dpgrote Apr 3, 2025
205d75a
Update test_3d_ionization_ion_dsmc benchmarks again
dpgrote Apr 4, 2025
750da6a
Reset test_3d_ionization_ion_dsmc benchmark and set warpx.synchronize…
dpgrote Apr 7, 2025
071471d
Update Source/ablastr/constant.H
lucafedeli88 Apr 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- mode: yaml -*-

pool:
vmImage: 'ubuntu-20.04'
vmImage: 'ubuntu-24.04'

trigger:
branches:
Expand Down Expand Up @@ -111,6 +111,10 @@ jobs:
-DCMAKE_CXX_STANDARD=17 \
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
fi
# Remove system copy of Matplotlib to avoid conflict
# with version set in the requirements file - see, e.g.,
# https://github.com/matplotlib/matplotlib/issues/28768.
sudo apt remove python3-matplotlib
# Python modules required for test analysis
python3 -m pip install --upgrade -r Regression/requirements.txt
python3 -m pip cache purge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def get_species_of_accelerator_stage(
density_expression=f"n0*(1.+4.*(x**2+y**2)/(kp**2*Rc**4))*(0.5*(1.-cos(pi*(z-{stage_zmin})/Lplus)))*((z-{stage_zmin})<Lplus)"
+ f"+n0*(1.+4.*(x**2+y**2)/(kp**2*Rc**4))*((z-{stage_zmin})>=Lplus)*((z-{stage_zmin})<(Lplus+Lp))"
+ f"+n0*(1.+4.*(x**2+y**2)/(kp**2*Rc**4))*(0.5*(1.+cos(pi*((z-{stage_zmin})-Lplus-Lp)/Lminus)))*((z-{stage_zmin})>=(Lplus+Lp))*((z-{stage_zmin})<(Lplus+Lp+Lminus))",
pi=3.141592653589793,
n0=n0,
kp=q_e / c * math.sqrt(n0 / (m_e * ep0)),
Rc=Rc,
Expand Down
4 changes: 2 additions & 2 deletions Examples/Tests/collision/analysis_collision_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import numpy as np
import yt
from scipy.constants import e
from scipy.constants import e, m_e, m_u

# this will be the name of the plot file
last_fn = sys.argv[1]
Expand All @@ -29,7 +29,7 @@
)

# carbon 12 ion (mass = 12*amu - 6*me)
mass = 1.992100316897910e-26
mass = 12.0 * m_u - 6.0 * m_e

# Separate macroparticles from group A (low weight) and group B (high weight)
# by sorting based on weight
Expand Down
7 changes: 3 additions & 4 deletions Examples/Tests/collision/analysis_collision_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import numpy
import post_processing_utils
import yt
from scipy.constants import c, m_e

test_name = os.path.split(os.getcwd())[1]

Expand All @@ -41,9 +42,7 @@
ni = ng * 200
np = ne + ni

c = 299792458.0
me = 9.10938356e-31
mi = me * 5.0
mi = m_e * 5.0

## In the first part of the test we verify that the output data is consistent with the exponential
## fit.
Expand Down Expand Up @@ -76,7 +75,7 @@
# get time index j
j = int(fn[-5:])
# compute error
vxe = numpy.mean(px[0:ne]) / me / c
vxe = numpy.mean(px[0:ne]) / m_e / c
vxi = numpy.mean(px[ne:np]) / mi / c
vxd = vxe - vxi
fit = a * math.exp(b * j)
Expand Down
7 changes: 3 additions & 4 deletions Examples/Tests/collision/analysis_collision_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import numpy
import post_processing_utils
import yt
from scipy.constants import c, m_e

tolerance = 0.001

Expand All @@ -38,9 +39,7 @@
ni = ng * 200
np = ne + ni

c = 299792458.0
me = 9.10938356e-31
mi = me * 5.0
mi = m_e * 5.0

## In the first part of the test we verify that the output data is consistent with the exponential
## fit.
Expand Down Expand Up @@ -69,7 +68,7 @@
# get time index j
j = int(fn[-5:])
# compute error
vxe = numpy.mean(pxe) / me / c
vxe = numpy.mean(pxe) / m_e / c
vxi = numpy.mean(pxi) / mi / c
vxd = vxe - vxi
fit = a * math.exp(b * j)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/collision/inputs_test_2d_collision_xz
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ electron.uz_th = 0.044237441120300
electron.ux_m = 0.044237441120300

ion.charge = q_e
ion.mass = 4.554691780000000e-30
ion.mass = 5*m_e
ion.injection_style = "NRandomPerCell"
ion.num_particles_per_cell = 200
ion.profile = constant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy as np
import yt
from openpmd_viewer import OpenPMDTimeSeries
from scipy.constants import c
from scipy.constants import c, e, epsilon_0, m_e
from scipy.optimize import fsolve

yt.funcs.mylog.setLevel(0)
Expand All @@ -41,10 +41,10 @@

if emass_10:
l2_tolerance = 0.096
m_e = 10
e_mass = 10
else:
l2_tolerance = 0.05
m_e = 9.10938356e-31 # Electron mass in kg
e_mass = m_e # Electron mass in kg
ndims = np.count_nonzero(ds.domain_dimensions > 1)

if ndims == 2:
Expand All @@ -68,8 +68,7 @@
iz0 = round((0.0 - zmin) / dz)

# Constants
eps_0 = 8.8541878128e-12 # Vacuum Permittivity in C/(V*m)
q_e = -1.60217662e-19 # Electron charge in C
q_e = -e # Electron charge in C
pi = np.pi # Circular constant of the universe
r_0 = 0.1 # Initial radius of sphere
q_tot = -1e-15 # Total charge of sphere in C
Expand All @@ -81,15 +80,15 @@
# v(r) and t(r) can be solved analytically.
#
# The solution r(t) solves the ODE: r''(t) = a/(r(t)**2) with initial conditions
# r(0) = r_0, r'(0) = 0, and a = q_e*q_tot/(4*pi*eps_0*m_e)
# r(0) = r_0, r'(0) = 0, and a = q_e*q_tot/(4*pi*epsilon_0*e_mass)
#
# The E was calculated at the end of the last time step
def v_exact(r):
return np.sqrt(q_e * q_tot / (2 * pi * m_e * eps_0) * (1 / r_0 - 1 / r))
return np.sqrt(q_e * q_tot / (2 * pi * e_mass * epsilon_0) * (1 / r_0 - 1 / r))


def t_exact(r):
return np.sqrt(r_0**3 * 2 * pi * m_e * eps_0 / (q_e * q_tot)) * (
return np.sqrt(r_0**3 * 2 * pi * e_mass * epsilon_0 / (q_e * q_tot)) * (
np.sqrt(r / r_0 - 1) * np.sqrt(r / r_0)
+ np.log(np.sqrt(r / r_0 - 1) + np.sqrt(r / r_0))
)
Expand All @@ -104,8 +103,8 @@ def func(rho):

def E_exact(r):
return np.sign(r) * (
q_tot / (4 * pi * eps_0 * r**2) * (abs(r) >= r_end)
+ q_tot * abs(r) / (4 * pi * eps_0 * r_end**3) * (abs(r) < r_end)
q_tot / (4 * pi * epsilon_0 * r**2) * (abs(r) >= r_end)
+ q_tot * abs(r) / (4 * pi * epsilon_0 * r_end**3) * (abs(r) < r_end)
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FILE = inputs_base_3d

# test input parameters
algo.em_solver_medium = macroscopic
macroscopic.epsilon = 1.5*8.8541878128e-12
macroscopic.mu = 1.25663706212e-06
macroscopic.epsilon = 1.5*epsilon0
macroscopic.mu = mu0
macroscopic.sigma = 0
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ my_constants.xmin = -0.53
my_constants.zmin = -0.53
my_constants.xmax = 0.53
my_constants.zmax = 0.53
my_constants.pi = 3.141592653589793
my_constants.theta = pi/8

warpx.eb_implicit_function = "xr=x*cos(-theta)+z*sin(-theta); zr=-x*sin(-theta)+z*cos(-theta); max(max(xr+xmin,-(xr+xmax)), max(zr+zmin,-(zr+zmax)))"
Expand All @@ -29,12 +28,11 @@ my_constants.Lx = 1.06
my_constants.Lz = 1.06
my_constants.x_cent = 0.
my_constants.z_cent = 0.
my_constants.mu_0 = 1.25663706212e-06

warpx.B_ext_grid_init_style = parse_B_ext_grid_function

warpx.Bx_external_grid_function(x,y,z) = 0
warpx.By_external_grid_function(x,y,z) = "mu_0 *
warpx.By_external_grid_function(x,y,z) = "mu0 *
cos(m * pi / Lx * (x*cos(-theta)+z*sin(-theta) - Lx / 2 - x_cent)) *
cos(p * pi / Lz * (-x*sin(-theta)+z*cos(-theta) - Lz / 2 - z_cent))"
warpx.Bz_external_grid_function(x,y,z) = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ my_constants.zmin = -0.5
my_constants.xmax = 0.5
my_constants.ymax = 0.5
my_constants.zmax = 0.5
my_constants.pi = 3.141592653589793
my_constants.theta = pi/6

warpx.eb_implicit_function = "max(max(max(x+xmin,-(x+xmax)), max(y*cos(-theta)-z*sin(-theta)+ymin,-(y*cos(-theta)-z*sin(-theta)+ymax))), max(y*sin(-theta)+z*cos(-theta)+zmin,-(y*sin(-theta)+z*cos(-theta)+zmax)))"
Expand All @@ -35,31 +34,30 @@ my_constants.x_cent = 0.
my_constants.y_cent = 0.
my_constants.z_cent = 0.
my_constants.h_2 = (m * pi / Lx) ** 2 + (n * pi / Ly) ** 2 + (p * pi / Lz) ** 2
my_constants.mu_0 = 1.25663706212e-06

warpx.B_ext_grid_init_style = parse_B_ext_grid_function
warpx.Bx_external_grid_function(x,y,z) = "-2/h_2 * mu_0 * (m * pi / Lx) * (p * pi / Lz) *
warpx.Bx_external_grid_function(x,y,z) = "-2/h_2 * mu0 * (m * pi / Lx) * (p * pi / Lz) *
sin(m * pi / Lx * (x - Lx / 2 - x_cent)) *
cos(n * pi / Ly * (y*cos(-theta)-z*sin(-theta) - Ly / 2 - y_cent)) *
cos(p * pi / Lz * (y*sin(-theta)+z*cos(-theta) - Lz / 2 - z_cent))"

warpx.By_external_grid_function(x,y,z) = "-2/h_2 * mu_0 * (n * pi / Ly) * (p * pi / Lz) *
warpx.By_external_grid_function(x,y,z) = "-2/h_2 * mu0 * (n * pi / Ly) * (p * pi / Lz) *
cos(m * pi / Lx * (x - Lx / 2 - x_cent)) *
sin(n * pi / Ly * (y*cos(-theta)-z*sin(-theta) - Ly / 2 - y_cent)) *
cos(p * pi / Lz * (y*sin(-theta)+z*cos(-theta) - Lz / 2 - z_cent)) *
cos(theta) -
mu_0 *
mu0 *
cos(m * pi / Lx * (x - Lx / 2 - x_cent)) *
cos(n * pi / Ly * (y*cos(-theta)-z*sin(-theta) - Ly / 2 - y_cent)) *
sin(p * pi / Lz * (y*sin(-theta)+z*cos(-theta) - Lz / 2 - z_cent)) *
sin(theta)"

warpx.Bz_external_grid_function(x,y,z) = "mu_0 *
warpx.Bz_external_grid_function(x,y,z) = "mu0 *
cos(m * pi / Lx * (x - Lx / 2 - x_cent)) *
cos(n * pi / Ly * (y*cos(-theta)-z*sin(-theta) - Ly / 2 - y_cent)) *
sin(p * pi / Lz * (y*sin(-theta)+z*cos(-theta) - Lz / 2 - z_cent)) *
cos(theta) -
2/h_2 * mu_0 * (n * pi / Ly) * (p * pi / Lz) *
2/h_2 * mu0 * (n * pi / Ly) * (p * pi / Lz) *
cos(m * pi / Lx * (x - Lx / 2 - x_cent)) *
sin(n * pi / Ly * (y*cos(-theta)-z*sin(-theta) - Ly / 2 - y_cent)) *
cos(p * pi / Lz * (y*sin(-theta)+z*cos(-theta) - Lz / 2 - z_cent)) *
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/implicit/analysis_2d_psatd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
max_delta_E = np.abs(delta_E).max()

# This case should have near machine precision conservation of energy
tolerance_rel_energy = 2.1e-14
tolerance_rel_energy = 2.4e-14

print(f"max change in energy: {max_delta_E}")
print(f"tolerance: {tolerance_rel_energy}")
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/initial_distribution/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
x_rms = 0.25
z_cut = 2.0
q_tot = -1.0e-20
q_e = -1.602176634e-19
q_e = -scc.e
npart = q_tot / q_e
db = bin_value[1] - bin_value[0]

Expand Down
2 changes: 2 additions & 0 deletions Examples/Tests/ionization_dsmc/inputs_base_3d
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ counts.intervals = 5
counts.path = diags/
counts.type = ParticleNumber

warpx.synchronize_velocity_for_diagnostics = 1

# Diagnostics
diag1.intervals = 250
diag1.diag_type = Full
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/load_external_field/analysis_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

tolerance = 1.0e-8
x0 = 0.12238072
y0 = 0.00965394
y0 = 0.00965395
z0 = 4.31754477

filename = sys.argv[1]
Expand Down
7 changes: 5 additions & 2 deletions Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

## Checks whether this is the 2D or the 3D test
with open("./warpx_used_inputs") as warpx_used_inputs:
is_2D = re.search("geometry.dims\s*=\s*2", warpx_used_inputs.read())
is_2D = re.search(r"geometry.dims\s*=\s*2", warpx_used_inputs.read())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think it would be also safe to remove the \s*, since warpx_used_inputs is generated automatically and uses only one white space, as in key = value, but up to you. It might make it more readable overall:

Suggested change
is_2D = re.search(r"geometry.dims\s*=\s*2", warpx_used_inputs.read())
is_2D = re.search("geometry.dims = 2", warpx_used_inputs.read())

warpx_used_inputs.close()

## Some numerical parameters for this test
Expand Down Expand Up @@ -697,8 +697,11 @@ def check_initial_energy2(data):
## Tolerance is quite high because we don't have a lot of alphas to produce good
## statistics and an event like alpha1 emitted exactly in direction of proton & alpha2
## emitted exactly in direction opposite to Beryllium is somewhat rare.
print(
f"Check energy max: {np.amax(energy_alpha2_simulation)} {max_energy_alpha23} {(np.amax(energy_alpha2_simulation) - max_energy_alpha23) / max_energy_alpha23}"
)
assert is_close(
np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=5e-2
np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=5.1e-2
)
assert is_close(
np.amin(energy_alpha2_simulation), min_energy_alpha23, atol=3.218e-14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"helium4": 4.00260325413 * scc.m_u,
"neutron": 1.0013784193052508 * scc.m_p,
}
m_reduced = np.product([mass[s] for s in reactant_species]) / np.sum(
m_reduced = np.prod([mass[s] for s in reactant_species]) / np.sum(
[mass[s] for s in reactant_species]
)

Expand Down
18 changes: 9 additions & 9 deletions Examples/Tests/ohm_solver_em_modes/analysis_rz.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ def process(it):
omega_fast = sim.vA * np.sqrt(R2 + np.sqrt(R2**2 - P4))
omega_slow = sim.vA * np.sqrt(R2 - np.sqrt(R2**2 - P4))
# Upper right corner
ax.plot(k * sim.l_i, omega_fast / sim.w_ci, "w--", label="$\omega_{fast}$")
ax.plot(k * sim.l_i, omega_fast / sim.w_ci, "w--", label=r"$\omega_{fast}$")
ax.plot(
k * sim.l_i,
omega_slow / sim.w_ci,
color="white",
linestyle="--",
label="$\omega_{slow}$",
label=r"$\omega_{slow}$",
)
# Thermal resonance
thermal_res = sim.w_ci + 3 * sim.v_ti * k
Expand All @@ -142,7 +142,7 @@ def process(it):
thermal_res / sim.w_ci,
color="magenta",
linestyle="--",
label="$\omega = \Omega_i + 3v_{th,i}k$",
label=r"$\omega = \Omega_i + 3v_{th,i}k$",
)
ax.plot(
-k * sim.l_i, thermal_res / sim.w_ci, color="magenta", linestyle="--", label=""
Expand All @@ -153,7 +153,7 @@ def process(it):
thermal_res / sim.w_ci,
color="magenta",
linestyle="--",
label="$\omega = \Omega_i + 3v_{th,i}k$",
label=r"$\omega = \Omega_i + 3v_{th,i}k$",
)
ax.plot(
-k * sim.l_i, thermal_res / sim.w_ci, color="magenta", linestyle="--", label=""
Expand All @@ -164,10 +164,10 @@ def process(it):
ax.set_xlim(-1.75, 1.75)
ax.set_ylim(0, 1.6)

axes[0, 0].set_ylabel("$\omega/\Omega_{ci}$")
axes[1, 0].set_ylabel("$\omega/\Omega_{ci}$")
axes[1, 0].set_xlabel("$k_zl_i$")
axes[1, 1].set_xlabel("$k_zl_i$")
axes[0, 0].set_ylabel(r"$\omega/\Omega_{ci}$")
axes[1, 0].set_ylabel(r"$\omega/\Omega_{ci}$")
axes[1, 0].set_xlabel(r"$k_zl_i$")
axes[1, 1].set_xlabel(r"$k_zl_i$")

plt.savefig("normal_modes_disp.png", dpi=600)
if not sim.test:
Expand All @@ -179,5 +179,5 @@ def process(it):
amps = np.abs(F_kw[2, 1, len(kz) // 2 - 2 : len(kz) // 2 + 2])
print("Amplitude sample: ", amps)
assert np.allclose(
amps, np.array([59.23850009, 19.26746169, 92.65794174, 10.83627164])
amps, np.array([79.98358457, 27.24783417, 213.15227656, 24.12800388])
)
8 changes: 4 additions & 4 deletions Examples/Tests/ohm_solver_ion_beam_instability/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
)

# The theoretical growth rates for the 4th, 5th and 6th Fourier modes of
# the By-field was obtained from Fig. 12a of Munoz et al.
# the By-field was obtained from Fig. 12a of Munoz et al., https://doi.org/10.1016/j.cpc.2017.10.012
# Note the rates here are gamma / w_ci
gamma4 = 0.1915611861780133
gamma5 = 0.20087036355662818
Expand Down Expand Up @@ -227,6 +227,6 @@
# compared to the theoretical ones to determine if the physics test passes.
# At creation, the full test (3d) had the following errors (ran on 1 V100):
# m4_rms_error = 3.329; m5_rms_error = 1.052; m6_rms_error = 2.583
assert np.isclose(m4_rms_error, 1.515, atol=0.01)
assert np.isclose(m5_rms_error, 0.718, atol=0.01)
assert np.isclose(m6_rms_error, 0.357, atol=0.01)
assert np.isclose(m4_rms_error, 1.546, atol=0.01)
assert np.isclose(m5_rms_error, 0.734, atol=0.01)
assert np.isclose(m6_rms_error, 0.367, atol=0.01)
Loading
Loading