Skip to content

Commit

Permalink
Adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron committed Oct 22, 2024
1 parent e1ddb78 commit 2fac7d3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_builtin_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,48 +117,55 @@ def test_specific_stepper_to_general_linear_stepper(


@pytest.mark.parametrize(
"specific_stepper,general_stepper_scale,general_stepper_coefficients",
"specific_stepper,general_stepper_scale,general_stepper_coefficients,conservative",
[
# Linear problems
(
ex.stepper.Advection(1, 3.0, 50, 0.1, velocity=1.0),
0.0,
[0.0, -1.0],
False,
),
(
ex.stepper.Diffusion(1, 3.0, 50, 0.1, diffusivity=0.01),
0.0,
[0.0, 0.0, 0.01],
False,
),
(
ex.stepper.AdvectionDiffusion(
1, 3.0, 50, 0.1, velocity=1.0, diffusivity=0.01
),
0.0,
[0.0, -1.0, 0.01],
False,
),
(
ex.stepper.Dispersion(1, 3.0, 50, 0.1, dispersivity=0.0001),
0.0,
[0.0, 0.0, 0.0, 0.0001],
False,
),
(
ex.stepper.HyperDiffusion(1, 3.0, 50, 0.1, hyper_diffusivity=0.00001),
0.0,
[0.0, 0.0, 0.0, 0.0, -0.00001],
False,
),
# nonlinear problems
(
ex.stepper.Burgers(1, 3.0, 50, 0.1, diffusivity=0.05, convection_scale=1.0),
1.0,
[0.0, 0.0, 0.05],
False,
),
(
ex.stepper.KortewegDeVries(
1, 3.0, 50, 0.1, dispersivity=1.0, convection_scale=-6.0
),
-6.0,
[0.0, 0.0, 0.0, -1.0, -0.01],
False,
),
(
ex.stepper.KuramotoSivashinskyConservative(
Expand All @@ -172,13 +179,15 @@ def test_specific_stepper_to_general_linear_stepper(
),
1.0,
[0.0, 0.0, -1.0, 0.0, -1.0],
True,
),
],
)
def test_specific_stepper_to_general_convection_stepper(
specific_stepper,
general_stepper_scale,
general_stepper_coefficients,
conservative,
):
num_spatial_dims = specific_stepper.num_spatial_dims
domain_extent = specific_stepper.domain_extent
Expand All @@ -197,6 +206,7 @@ def test_specific_stepper_to_general_convection_stepper(
dt,
coefficients=general_stepper_coefficients,
convection_scale=general_stepper_scale,
conservative=conservative,
)

specific_pred = specific_stepper(u_0)
Expand Down

0 comments on commit 2fac7d3

Please sign in to comment.