-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,729 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
816 changes: 816 additions & 0 deletions
816
tests/regression_tests/answers/answer_hall_adiabatic_homo.log
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
816 changes: 816 additions & 0 deletions
816
tests/regression_tests/answers/answer_hall_harris_sheet.log
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import numpy as np | ||
|
||
hall_adiabatic_homo = { | ||
"name": "hall_adiabatic_homo", | ||
"config": { | ||
"geometry": "Cartesian", | ||
"x_start": 0, | ||
"x_end": 1000, | ||
"gridpoints": 51, | ||
"parameters": { | ||
"k2": np.pi * np.sin(np.pi / 6), | ||
"k3": np.pi * np.cos(np.pi / 6), | ||
"cte_rho0": 1.0, | ||
"cte_T0": 1.0, | ||
"cte_B02": 0.0, | ||
"cte_B03": 1.0, | ||
}, | ||
"equilibrium_type": "adiabatic_homo", | ||
"hall_mhd": True, | ||
"electron_fraction": 0.5, | ||
"cgs_units": True, | ||
"unit_density": 1.7e-14, | ||
"unit_magneticfield": 10, | ||
"unit_length": 7.534209349981049e-9, | ||
"logging_level": 0, | ||
"show_results": False, | ||
"write_eigenfunctions": True, | ||
}, | ||
"all_eigenvalues_real": True, | ||
"image_limits": [ | ||
{"xlims": (-600, 600), "ylims": (-0.05, 0.05), "RMS_TOLERANCE": 2.5}, | ||
{"xlims": (-50, 50), "ylims": (-0.05, 0.05)}, | ||
], | ||
"eigenfunctions": [ | ||
{"eigenvalue": 0.7877457}, | ||
{"eigenvalue": 4.0167199}, | ||
{"eigenvalue": 9.4880654}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import pytest | ||
import numpy as np | ||
|
||
hall_harris_sheet = { | ||
"name": "hall_harris_sheet", | ||
"config": { | ||
"geometry": "Cartesian", | ||
"x_start": -15, | ||
"x_end": 15, | ||
"gridpoints": 51, | ||
"parameters": { | ||
"k2": 0.155, | ||
"k3": 0.01, | ||
"alpha": 1, | ||
"cte_rho0": 1.0, | ||
"cte_B02": 1.0, | ||
"cte_B03": 5.0, | ||
"eq_bool": False, | ||
}, | ||
"equilibrium_type": "harris_sheet", | ||
"resistivity": True, | ||
"use_fixed_resistivity": True, | ||
"fixed_eta_value": 10 ** (-4.0), | ||
"hall_mhd": True, | ||
"electron_fraction": 0.5, | ||
"cgs_units": True, | ||
"unit_density": 1.7e-14, | ||
"unit_magneticfield": 10, | ||
"unit_length": 7.534209349981049e-9, | ||
"incompressible": True, | ||
"logging_level": 0, | ||
"show_results": False, | ||
"write_eigenfunctions": False, | ||
"write_matrices": False, | ||
}, | ||
"image_limits": [ | ||
{"xlims": (-375, 375), "ylims": (-11, 0.5)}, | ||
{"xlims": (-30, 30), "ylims": (-3, 0.3)}, | ||
{"xlims": (-0.6, 0.6), "ylims": (-1.2, 0.1)}, | ||
{"xlims": (-0.5, 0.5), "ylims": (-0.2, 0.02)}, | ||
], | ||
} | ||
parametrisation = dict( | ||
argnames="setup", | ||
argvalues=[hall_harris_sheet], | ||
ids=[hall_harris_sheet["name"]], | ||
) | ||
|
||
|
||
@pytest.mark.parametrize(**parametrisation) | ||
def test_eta_value(ds_test, setup): | ||
eta_value = 1e-4 | ||
assert setup["config"]["fixed_eta_value"] == pytest.approx(eta_value) | ||
assert np.all(ds_test.equilibria.get("eta") == pytest.approx(eta_value)) |