Skip to content

allow for Petrov-Galerkin formulations #106

allow for Petrov-Galerkin formulations

allow for Petrov-Galerkin formulations #106

GitHub Actions / Firedrake real failed Dec 12, 2024 in 0s

8143 tests run, 7456 passed, 675 skipped, 12 failed.

Annotations

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[FunctionSpace-False-measure0]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f06816925d0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433))
measure = Measure('cell', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f068131c230>
tensor = Matrix(a=Form([Integral(Product(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681692...', triangle, 1), dim=2), 1433), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f068131c950>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f068131c950>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[FunctionSpace-False-measure1]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f06816925d0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433))
measure = Measure('exterior_facet', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f068083d250>
tensor = Matrix(a=Form([Integral(Product(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681692...', triangle, 1), dim=2), 1433), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f06823e66f0>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f06823e66f0>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 69 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs_interior[FunctionSpace-False]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f06816925d0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433))

    def test_assemble_bcs_wrong_fs_interior(V):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
        n = FacetNormal(V.mesh())
        with pytest.raises(RuntimeError):
>           assemble(inner(jump(u, n), jump(v, n))*dS, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f068146bbf0>
tensor = Matrix(a=Form([Integral(IndexSum(Product(Indexed(Sum(ComponentTensor(Product(Indexed(PositiveRestricted(FacetNormal(Me...', triangle, 1), dim=2), 1433), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0680e03ce0>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0680e03ce0>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[FunctionSpace-True-measure0]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680680>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1504))
measure = Measure('cell', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f0681af6390>
tensor = Matrix(a=Form([Integral(Product(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680...adrilateral, 1), dim=2), 1504), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0681af5310>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0681af5310>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[FunctionSpace-True-measure1]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680680>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1504))
measure = Measure('exterior_facet', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f0681900d10>
tensor = Matrix(a=Form([Integral(Product(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680...adrilateral, 1), dim=2), 1504), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0681161430>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0681161430>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 69 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs_interior[FunctionSpace-True]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680680>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1504))

    def test_assemble_bcs_wrong_fs_interior(V):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
        n = FacetNormal(V.mesh())
        with pytest.raises(RuntimeError):
>           assemble(inner(jump(u, n), jump(v, n))*dS, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f06805636b0>
tensor = Matrix(a=Form([Integral(IndexSum(Product(Indexed(Sum(ComponentTensor(Product(Indexed(PositiveRestricted(FacetNormal(Me...adrilateral, 1), dim=2), 1504), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0681402690>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0681402690>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[VectorFunctionSpace-True-measure0]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680680>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1504))
measure = Measure('cell', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f0682046780>
tensor = Matrix(a=Form([Integral(IndexSum(Product(Indexed(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology obje...adrilateral, 1), dim=2), 1504), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0680f76f00>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0680f76f00>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[VectorFunctionSpace-True-measure1]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680680>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1504))
measure = Measure('exterior_facet', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f06809d8410>
tensor = Matrix(a=Form([Integral(IndexSum(Product(Indexed(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology obje...adrilateral, 1), dim=2), 1504), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f06809d9ac0>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f06809d9ac0>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 69 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs_interior[VectorFunctionSpace-True]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f0681680680>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1504))

    def test_assemble_bcs_wrong_fs_interior(V):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
        n = FacetNormal(V.mesh())
        with pytest.raises(RuntimeError):
>           assemble(inner(jump(u, n), jump(v, n))*dS, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f06810f24e0>
tensor = Matrix(a=Form([Integral(Product(Sum(IndexSum(Product(Indexed(PositiveRestricted(FacetNormal(Mesh(VectorElement(FiniteE...adrilateral, 1), dim=2), 1504), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0681ea2b10>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0681ea2b10>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[VectorFunctionSpace-False-measure0]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f068185b230>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1635))
measure = Measure('cell', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f0680fcda30>
tensor = Matrix(a=Form([Integral(IndexSum(Product(Indexed(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology obje...', triangle, 1), dim=2), 1635), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f06809aa060>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f06809aa060>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 60 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs[VectorFunctionSpace-False-measure1]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f068185b230>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1635))
measure = Measure('exterior_facet', subdomain_id='everywhere')

    @pytest.mark.parametrize('measure', [dx, ds])
    def test_assemble_bcs_wrong_fs(V, measure):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
    
        with pytest.raises(RuntimeError):
>           assemble(inner(u, v)*measure, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f067b5cbfb0>
tensor = Matrix(a=Form([Integral(IndexSum(Product(Indexed(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology obje...', triangle, 1), dim=2), 1635), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f067b5cbf50>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f067b5cbf50>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError

Check failure on line 69 in tests/firedrake/regression/test_bcs.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_assemble_bcs_wrong_fs_interior[VectorFunctionSpace-False]

TypeError: bc space does not match the test function space
Raw output
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f068185b230>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1635))

    def test_assemble_bcs_wrong_fs_interior(V):
        "Assemble a Matrix with a DirichletBC on an incompatible FunctionSpace."
        u, v = TrialFunction(V), TestFunction(V)
        W = FunctionSpace(V.mesh(), "CG", 2)
        n = FacetNormal(V.mesh())
        with pytest.raises(RuntimeError):
>           assemble(inner(jump(u, n), jump(v, n))*dS, bcs=[DirichletBC(W, 32, 1)])

tests/firedrake/regression/test_bcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
petsc4py/PETSc/Log.pyx:188: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
petsc4py/PETSc/Log.pyx:189: in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
    ???
firedrake/adjoint_utils/assembly.py:30: in wrapper
    output = assemble(form, *args, **kwargs)
firedrake/assemble.py:134: in assemble
    return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:986: in assemble
    self._apply_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.ExplicitMatrixAssembler object at 0x7f0680affad0>
tensor = Matrix(a=Form([Integral(Product(Sum(IndexSum(Product(Indexed(PositiveRestricted(FacetNormal(Mesh(VectorElement(FiniteE...', triangle, 1), dim=2), 1635), 'everywhere', {}, None)]), bcs=(<firedrake.bcs.DirichletBC object at 0x7f0680374110>,))
bc = <firedrake.bcs.DirichletBC object at 0x7f0680374110>

    def _apply_bc(self, tensor, bc):
        op2tensor = tensor.M
        spaces = tuple(a.function_space() for a in tensor.a.arguments())
        V = bc.function_space()
        component = V.component
        if component is not None:
            V = V.parent
        index = 0 if V.index is None else V.index
        space = V if V.parent is None else V.parent
        if isinstance(bc, DirichletBC):
            if all(isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                # Make this the primal (the only) path.
                # -- This path should work fine with Petrov-Galerkin formulations.
                pass
            elif all(not isinstance(s.topological, RestrictedFunctionSpace) for s in spaces):
                if space != spaces[0]:
>                   raise TypeError("bc space does not match the test function space")
E                   TypeError: bc space does not match the test function space

firedrake/assemble.py:1436: TypeError