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/functionspaceimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def make_dat(self, *args, **kwargs):
:raises ValueError: if :attr:`no_dats` is ``True``.
"""
if self.no_dats:
raise ValueError("Can't build Function on %s function space" % self.typ)
raise ValueError("Can't build Function on %s function space" % self.identifier)
return super(ProxyFunctionSpace, self).make_dat(*args, **kwargs)


Expand Down Expand Up @@ -839,5 +839,4 @@ def ComponentFunctionSpace(parent, component):
new.identifier = "component"
new.component = component
new.parent = parent
new.no_dats = True
return new
28 changes: 16 additions & 12 deletions tests/regression/test_vfs_component_bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def test_poisson_in_components(V):


@pytest.mark.parametrize("nested",
[False, True])
def test_poisson_in_mixed_plus_vfs_components(V, nested):
[False, True], ids=["nest", "monolithic"])
@pytest.mark.parametrize("make_val",
[lambda x: x,
lambda x: Expression("%g" % x)],
ids=["UFL value", "C expression"])
def test_poisson_in_mixed_plus_vfs_components(V, nested, make_val):
# Solve five decoupled poisson problems with different boundary
# conditions in a mixed space composed of two VectorFunctionSpaces
# and one scalar FunctionSpace.
Expand All @@ -97,18 +101,18 @@ def test_poisson_in_mixed_plus_vfs_components(V, nested):

g = Function(W)

bcs = [DirichletBC(W.sub(0).sub(0), 0, 1),
DirichletBC(W.sub(0).sub(0), 42, 2),
DirichletBC(W.sub(0).sub(1), 10, 3),
DirichletBC(W.sub(0).sub(1), 15, 4),
bcs = [DirichletBC(W.sub(0).sub(0), make_val(0), 1),
DirichletBC(W.sub(0).sub(0), make_val(42), 2),
DirichletBC(W.sub(0).sub(1), make_val(10), 3),
DirichletBC(W.sub(0).sub(1), make_val(15), 4),

DirichletBC(W.sub(1), 4, 1),
DirichletBC(W.sub(1), 10, 2),
DirichletBC(W.sub(1), make_val(4), 1),
DirichletBC(W.sub(1), make_val(10), 2),

DirichletBC(W.sub(2).sub(0), -10, 1),
DirichletBC(W.sub(2).sub(0), 10, 2),
DirichletBC(W.sub(2).sub(1), 15, 3),
DirichletBC(W.sub(2).sub(1), 5, 4)]
DirichletBC(W.sub(2).sub(0), make_val(-10), 1),
DirichletBC(W.sub(2).sub(0), make_val(10), 2),
DirichletBC(W.sub(2).sub(1), make_val(15), 3),
DirichletBC(W.sub(2).sub(1), make_val(5), 4)]

u, p, r = TrialFunctions(W)
v, q, s = TestFunctions(W)
Expand Down