Composite spaces fails for certain combinations of spaces.
The following code works for lagrange
and dglagrange
but fails for other spaces, e.g. dgonb
or dglegendre
.
from dune.grid import structuredGrid
from dune.fem.space import lagrange, dgonb, composite, finiteVolume, dglagrange
view = structuredGrid([0, 0], [1, 1], [7, 7])
# spatial_coordinate = SpatialCoordinate(cell(dim_space))
def test_composite(space):
spc_1 = space(view, order=2)
spc_2 = space(view, order=1)
comp = composite(spc_1, spc_2, components=["1", "2"])
u = comp.interpolate([0]*comp.dimRange, name="u")
test_composite(lagrange)
print("Continuous Lagrange worked!")
test_composite(dglagrange)
print("Discontinuous Lagrange worked!")
## Currently: this fails with a very strange error
test_composite(dgonb)
print("DG-ONB worked!")
Edited by Robert K