Skip to content

Commit

Permalink
Added test for Custom BC
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriele-ferrero committed Oct 7, 2023
1 parent 5e26a48 commit e6008a2
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions test/unit/test_boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ def test_string_for_field_in_dirichletbc():
bc.create_dirichletbc(V, fenics.Constant(1), surface_marker)


def custom_fun(T, solute, param1):
return 2 * T + solute - param1


@pytest.mark.parametrize(
"bc",
[
Expand All @@ -552,19 +556,22 @@ def test_string_for_field_in_dirichletbc():
(festim.MassFlux(h_coeff=1, c_ext=1, surfaces=1)),
(festim.RecombinationFlux(Kr_0=1e-20, E_Kr=0, order=2, surfaces=1)),
(
festim.ImplantationDirichlet(
surfaces=1,
phi=1e18,
R_p=1e-9,
D_0=1,
E_D=0,
Kr_0=None,
E_Kr=None,
Kd_0=None,
E_Kd=None,
P=None,
festim.CustomDirichlet(
surfaces=[1, 2],
function=custom_fun,
param1=2 * festim.x + festim.t,
field=0,
)
),
(
festim.CustomFlux(
surfaces=[1, 2],
function=custom_fun,
param1=2 * festim.x + festim.t,
field=0,
)
),
(festim.ImplantationDirichlet(surfaces=1, phi=1e18, R_p=1e-9, D_0=1, E_D=0)),
(festim.DirichletBC(surfaces=1, value=1, field=0)),
(festim.HenrysBC(surfaces=1, H_0=1, E_H=0, pressure=1e3)),
(festim.SievertsBC(surfaces=1, S_0=1, E_S=0, pressure=1e3)),
Expand Down

0 comments on commit e6008a2

Please sign in to comment.