Skip to content

Restricted Cofunction RHS #6878

Restricted Cofunction RHS

Restricted Cofunction RHS #6878

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

8144 tests run, 7449 passed, 689 skipped, 6 failed.

Annotations

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

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_bcs_rhs_assemble[FunctionSpace-False]

AssertionError: assert False
 +  where False = <function allclose at 0x7f61027bc830>(array([2., 1., 2., 0., 2., 1., 0., 0., 0.]), array([0., 0., 0., 0., 0., 0., 0., 0., 0.]))
 +    where <function allclose at 0x7f61027bc830> = np.allclose
 +    and   array([2., 1., 2., 0., 2., 1., 0., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1491').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1491') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c80c86b0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433)), 2910).dat
 +    and   array([0., 0., 0., 0., 0., 0., 0., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1495').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1495') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c80c86b0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433)), 2916).dat
Raw output
a = Form([Integral(Conj(Inner(Grad(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c80c86..., 2909)))), 'cell', Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433), 'everywhere', {}, None)])
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c80c86b0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433))

    def test_bcs_rhs_assemble(a, V):
        bcs = [DirichletBC(V, 1.0, 1), DirichletBC(V, 2.0, 3)]
        b1 = assemble(a)
        b1_func = b1.riesz_representation(riesz_map="l2")
        for bc in bcs:
            bc.apply(b1_func)
        b1.assign(b1_func.riesz_representation(riesz_map="l2"))
        b2 = assemble(a, bcs=bcs)
>       assert np.allclose(b1.dat.data, b2.dat.data)
E       AssertionError: assert False
E        +  where False = <function allclose at 0x7f61027bc830>(array([2., 1., 2., 0., 2., 1., 0., 0., 0.]), array([0., 0., 0., 0., 0., 0., 0., 0., 0.]))
E        +    where <function allclose at 0x7f61027bc830> = np.allclose
E        +    and   array([2., 1., 2., 0., 2., 1., 0., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1491').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1491') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c80c86b0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433)), 2910).dat
E        +    and   array([0., 0., 0., 0., 0., 0., 0., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1495').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c80c9160'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1495') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c80c86b0>, FiniteElement('Lagrange', triangle, 1), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1433)), 2916).dat

tests/firedrake/regression/test_bcs.py:333: AssertionError

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

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_bcs_rhs_assemble[FunctionSpace-True]

AssertionError: assert False
 +  where False = <function allclose at 0x7f61027bc830>(array([2., 1., 0., 2., 0., 2., 1., 0., 0.]), array([0., 0., 0., 0., 0., 0., 0., 0., 0.]))
 +    where <function allclose at 0x7f61027bc830> = np.allclose
 +    and   array([2., 1., 0., 2., 0., 2., 1., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1557').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1557') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3035).dat
 +    and   array([0., 0., 0., 0., 0., 0., 0., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1561').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1561') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3041).dat
Raw output
a = Form([Integral(Conj(Inner(Grad(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a3...)), 3034)))), 'cell', Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499), 'everywhere', {}, None)])
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499))

    def test_bcs_rhs_assemble(a, V):
        bcs = [DirichletBC(V, 1.0, 1), DirichletBC(V, 2.0, 3)]
        b1 = assemble(a)
        b1_func = b1.riesz_representation(riesz_map="l2")
        for bc in bcs:
            bc.apply(b1_func)
        b1.assign(b1_func.riesz_representation(riesz_map="l2"))
        b2 = assemble(a, bcs=bcs)
>       assert np.allclose(b1.dat.data, b2.dat.data)
E       AssertionError: assert False
E        +  where False = <function allclose at 0x7f61027bc830>(array([2., 1., 0., 2., 0., 2., 1., 0., 0.]), array([0., 0., 0., 0., 0., 0., 0., 0., 0.]))
E        +    where <function allclose at 0x7f61027bc830> = np.allclose
E        +    and   array([2., 1., 0., 2., 0., 2., 1., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1557').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1557') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3035).dat
E        +    and   array([0., 0., 0., 0., 0., 0., 0., 0., 0.]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1561').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (1,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1561') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, FiniteElement('Q', quadrilateral, 1), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3041).dat

tests/firedrake/regression/test_bcs.py:333: AssertionError

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

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_bcs_rhs_assemble[VectorFunctionSpace-True]

AssertionError: assert False
 +  where False = <function allclose at 0x7f61027bc830>(array([[2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.]]), array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]))
 +    where <function allclose at 0x7f61027bc830> = np.allclose
 +    and   array([[2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1612').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1612') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3150).dat
 +    and   array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1616').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1616') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3156).dat
Raw output
a = Form([Integral(Conj(Inner(Grad(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a3...)), 3149)))), 'cell', Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499), 'everywhere', {}, None)])
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499))

    def test_bcs_rhs_assemble(a, V):
        bcs = [DirichletBC(V, 1.0, 1), DirichletBC(V, 2.0, 3)]
        b1 = assemble(a)
        b1_func = b1.riesz_representation(riesz_map="l2")
        for bc in bcs:
            bc.apply(b1_func)
        b1.assign(b1_func.riesz_representation(riesz_map="l2"))
        b2 = assemble(a, bcs=bcs)
>       assert np.allclose(b1.dat.data, b2.dat.data)
E       AssertionError: assert False
E        +  where False = <function allclose at 0x7f61027bc830>(array([[2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.]]), array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]))
E        +    where <function allclose at 0x7f61027bc830> = np.allclose
E        +    and   array([[2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1612').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1612') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3150).dat
E        +    and   array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1616').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c8b3fc20'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1616') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c942a360>, VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 1499)), 3156).dat

tests/firedrake/regression/test_bcs.py:333: AssertionError

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

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_bcs_rhs_assemble[VectorFunctionSpace-False]

AssertionError: assert False
 +  where False = <function allclose at 0x7f61027bc830>(array([[2., 2.],\n       [1., 1.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]), array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]))
 +    where <function allclose at 0x7f61027bc830> = np.allclose
 +    and   array([[2., 2.],\n       [1., 1.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1669').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1669') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c8a091f0>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1620)), 3261).dat
 +    and   array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1673').data
 +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1673') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c8a091f0>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1620)), 3267).dat
Raw output
a = Form([Integral(Conj(Inner(Grad(Argument(WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c8a091..., 3260)))), 'cell', Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1620), 'everywhere', {}, None)])
V = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c8a091f0>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1620))

    def test_bcs_rhs_assemble(a, V):
        bcs = [DirichletBC(V, 1.0, 1), DirichletBC(V, 2.0, 3)]
        b1 = assemble(a)
        b1_func = b1.riesz_representation(riesz_map="l2")
        for bc in bcs:
            bc.apply(b1_func)
        b1.assign(b1_func.riesz_representation(riesz_map="l2"))
        b2 = assemble(a, bcs=bcs)
>       assert np.allclose(b1.dat.data, b2.dat.data)
E       AssertionError: assert False
E        +  where False = <function allclose at 0x7f61027bc830>(array([[2., 2.],\n       [1., 1.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]), array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]))
E        +    where <function allclose at 0x7f61027bc830> = np.allclose
E        +    and   array([[2., 2.],\n       [1., 1.],\n       [2., 2.],\n       [0., 0.],\n       [2., 2.],\n       [1., 1.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1669').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1669') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c8a091f0>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1620)), 3261).dat
E        +    and   array([[0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.],\n       [0., 0.]]) = Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1673').data
E        +      where Dat(DataSet(Set((np.int64(9), np.int64(9), np.int64(9)), 'set_#x7f60c89f7830'), (2,), 'None_nodes_dset', False), None, dtype('float64'), 'cofunction_1673') = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f60c8a091f0>, VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1620)), 3267).dat

tests/firedrake/regression/test_bcs.py:333: AssertionError

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

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_bcs.test_mixed_bcs[diagonal]

AttributeError: 'OneFormAssembler' object has no attribute '_weight'
Raw output
diagonal = True

    @pytest.mark.parametrize("diagonal",
                             [False, True],
                             ids=["matrix", "diagonal"])
    def test_mixed_bcs(diagonal):
        m = UnitSquareMesh(2, 2)
        V = FunctionSpace(m, 'CG', 1)
        W = V*V
        u, p = TrialFunctions(W)
        v, q = TestFunctions(W)
    
        bc = DirichletBC(W.sub(1), 0.0, "on_boundary")
    
>       A = assemble(inner(u, v)*dx, bcs=bc, diagonal=diagonal)

tests/firedrake/regression/test_bcs.py:317: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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)
firedrake/assemble.py:1184: in _apply_bc
    self._apply_dirichlet_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.OneFormAssembler object at 0x7f60c313df10>
tensor = Cofunction(FiredrakeDualSpace(MixedFunctionSpace(IndexedProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f...1, component=None), name='None_None'), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1687)), 3290)
bc = <firedrake.bcs.DirichletBC object at 0x7f60c3260050>

    def _apply_dirichlet_bc(self, tensor, bc):
        if self._diagonal:
>           bc.set(tensor, self._weight)
E           AttributeError: 'OneFormAssembler' object has no attribute '_weight'

firedrake/assemble.py:1194: AttributeError

Check failure on line 163 in tests/firedrake/regression/test_assemble.py

See this annotation in the file changed.

@github-actions github-actions / Firedrake real

test_assemble.test_assemble_diagonal_bcs

AttributeError: 'OneFormAssembler' object has no attribute '_weight'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 9948)

    def test_assemble_diagonal_bcs(mesh):
        V = FunctionSpace(mesh, "P", 3)
        u = TrialFunction(V)
        v = TestFunction(V)
        bc = DirichletBC(V, 0, (1, 4))
        a = inner(grad(u), grad(v))*dx
        M = assemble(a, mat_type="aij", bcs=bc)
>       Mdiag = assemble(a, bcs=bc, diagonal=True)

tests/firedrake/regression/test_assemble.py:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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)
firedrake/assemble.py:1184: in _apply_bc
    self._apply_dirichlet_bc(tensor, bc)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firedrake.assemble.OneFormAssembler object at 0x7fa381ecf9e0>
tensor = Cofunction(FiredrakeDualSpace(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7fa382b66c00>, FiniteElement('Lagrange', triangle, 3), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 9948)), 17199)
bc = <firedrake.bcs.DirichletBC object at 0x7fa381da2870>

    def _apply_dirichlet_bc(self, tensor, bc):
        if self._diagonal:
>           bc.set(tensor, self._weight)
E           AttributeError: 'OneFormAssembler' object has no attribute '_weight'

firedrake/assemble.py:1194: AttributeError