Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions firedrake/slate/static_condensation/la_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def condense_and_forward_eliminate(A, b, elim_fields, prefix, pc):
raise ValueError("Left-hand operator must be a Slate Tensor")

# Ensures field indices are in increasing order
id_0, id_1 = elim_fields[0], elim_fields[-1]
elim_fields = list(as_tuple(elim_fields))
elim_fields.sort()

Expand Down Expand Up @@ -73,8 +74,6 @@ def condense_and_forward_eliminate(A, b, elim_fields, prefix, pc):
# where subscript `e` denotes the coupling with fields
# that will be eliminated, and `f` denotes the condensed
# fields.
id_0 = e_idx0
id_1 = e_idx1
outer_id_0 = slice(e_idx0, e_idx1 + 1)
outer_id_1 = slice(f_idx0, f_idx1 + 1)
Aff = _A[outer_id_1, outer_id_1]
Expand Down
6 changes: 3 additions & 3 deletions tests/slate/test_variational_prb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from itertools import product


@pytest.mark.parametrize(('degree', 'nested'), list(product([1, 2], [True, False])))
def test_lvp_equiv_hdg(degree, nested):
@pytest.mark.parametrize(('degree', 'nested', 'elimination'), list(product([1, 2], [True, False], ['0,1', '1,0'])))
def test_lvp_equiv_hdg(degree, nested, elimination):
"""Runs an HDG problem and checks that passing
a Slate-defined problem into a variational problem
produces the same result for the traces as solving
Expand Down Expand Up @@ -47,7 +47,7 @@ def test_lvp_equiv_hdg(degree, nested):
'ksp_type': 'preonly',
'pc_type': 'python',
'pc_python_type': 'firedrake.SCPC',
'pc_sc_eliminate_fields': '0, 1',
'pc_sc_eliminate_fields': elimination,
'condensed_field': {'ksp_type': 'preonly',
'pc_type': 'lu',
'pc_factor_mat_solver_type': 'mumps',
Expand Down