Get value_shape from FunctionSpace #6172
8096 tests run, 4635 passed, 673 skipped, 2788 failed.
Annotations
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[squarequads-mesh-100-coords-FunctionSpace(RTCF2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
vertexcoords = array([[ 0.59762701, 0.93037873],
[ 0.70552675, 0.58976637],
[ 0.3473096 , 0.79178823],
[ 0.37... 1.38874478],
[ 0.97910159, 0.48091762],
[-0.04517074, 0.00871296],
[-0.38394168, 0.36883325]])
vfs = ('RTCF', 2, <cyfunction FunctionSpace at 0x7fa067fe06c0>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 40), VectorElement(FiniteElement('Real', quadrilateral, 0), dim=2)), 77)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)-20-constant-scalar]
AttributeError: 'FiniteElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = 20, typ = 'constant'
fs_type = 'scalar'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), FiniteElement('Real', quadrilateral, 0)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'FiniteElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 280 in tests/regression/test_function_spaces.py
github-actions / Firedrake real
test_function_spaces.test_reconstruct_component[dual-rt1]
IndexError: tuple index out of range
Raw output
space = 'rt1'
dg0 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Discon...us Lagrange', triangle, 0), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
rt1 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
mesh = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83)
mesh2 = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 85)
dual = True
@pytest.mark.parametrize("space", ["dg0", "rt1"])
def test_reconstruct_component(space, dg0, rt1, mesh, mesh2, dual):
Z = {"dg0": dg0, "rt1": rt1}[space]
if dual:
Z = Z.dual()
for component in range(Z.value_size):
> V1 = Z.sub(component)
tests/regression/test_function_spaces.py:280:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/functionspaceimpl.py:191: in sub
return self._components[i]
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/functionspaceimpl.py:178: in _components
return tuple(type(self).create(self.topological.sub(i), self.mesh())
firedrake/functionspaceimpl.py:178: in <genexpr>
return tuple(type(self).create(self.topological.sub(i), self.mesh())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None)
i = 2
def sub(self, i):
r"""Return a view into the ith component."""
if self.rank == 0:
assert i == 0
return self
> return self._components[i]
E IndexError: tuple index out of range
firedrake/functionspaceimpl.py:664: IndexError
Check failure on line 297 in tests/regression/test_function_spaces.py
github-actions / Firedrake real
test_function_spaces.test_reconstruct_sub_component[dual]
IndexError: tuple index out of range
Raw output
dg0 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Discon...us Lagrange', triangle, 0), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
rt1 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
mesh = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83)
mesh2 = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 85)
dual = True
def test_reconstruct_sub_component(dg0, rt1, mesh, mesh2, dual):
Z = dg0 * rt1
if dual:
Z = Z.dual()
for index, Vsub in enumerate(Z):
for component in range(Vsub.value_size):
> V1 = Z.sub(index).sub(component)
tests/regression/test_function_spaces.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/functionspaceimpl.py:191: in sub
return self._components[i]
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/functionspaceimpl.py:178: in _components
return tuple(type(self).create(self.topological.sub(i), self.mesh())
firedrake/functionspaceimpl.py:178: in <genexpr>
return tuple(type(self).create(self.topological.sub(i), self.mesh())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = IndexedProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None, index=1, component=None)
i = 2
def sub(self, i):
r"""Return a view into the ith component."""
if self.rank == 0:
assert i == 0
return self
> return self._components[i]
E IndexError: tuple index out of range
firedrake/functionspaceimpl.py:664: IndexError
Check failure on line 280 in tests/regression/test_function_spaces.py
github-actions / Firedrake real
test_function_spaces.test_reconstruct_component[primal-rt1]
IndexError: tuple index out of range
Raw output
space = 'rt1'
dg0 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Discon...us Lagrange', triangle, 0), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
rt1 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
mesh = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83)
mesh2 = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 85)
dual = False
@pytest.mark.parametrize("space", ["dg0", "rt1"])
def test_reconstruct_component(space, dg0, rt1, mesh, mesh2, dual):
Z = {"dg0": dg0, "rt1": rt1}[space]
if dual:
Z = Z.dual()
for component in range(Z.value_size):
> V1 = Z.sub(component)
tests/regression/test_function_spaces.py:280:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/functionspaceimpl.py:191: in sub
return self._components[i]
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/functionspaceimpl.py:178: in _components
return tuple(type(self).create(self.topological.sub(i), self.mesh())
firedrake/functionspaceimpl.py:178: in <genexpr>
return tuple(type(self).create(self.topological.sub(i), self.mesh())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None)
i = 2
def sub(self, i):
r"""Return a view into the ith component."""
if self.rank == 0:
assert i == 0
return self
> return self._components[i]
E IndexError: tuple index out of range
firedrake/functionspaceimpl.py:664: IndexError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[extruded-mesh-0-coords-VectorFunctionSpace(CG2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(triangle, interval)), dim=3), 44)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(triangle, interval)), dim=3), 44)
vertexcoords = array([], shape=(0, 3), dtype=float64)
vfs = ('CG', 2, <cyfunction VectorFunctionSpace at 0x7fa067fe0860>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElemen...e, interval)), dim=3), 45), VectorElement(FiniteElement('Real', TensorProductCell(triangle, interval), 0), dim=3)), 84)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 297 in tests/regression/test_function_spaces.py
github-actions / Firedrake real
test_function_spaces.test_reconstruct_sub_component[primal]
IndexError: tuple index out of range
Raw output
dg0 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Discon...us Lagrange', triangle, 0), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
rt1 = WithGeometry(FunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83))
mesh = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 83)
mesh2 = Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 85)
dual = False
def test_reconstruct_sub_component(dg0, rt1, mesh, mesh2, dual):
Z = dg0 * rt1
if dual:
Z = Z.dual()
for index, Vsub in enumerate(Z):
for component in range(Vsub.value_size):
> V1 = Z.sub(index).sub(component)
tests/regression/test_function_spaces.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/functionspaceimpl.py:191: in sub
return self._components[i]
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/functionspaceimpl.py:178: in _components
return tuple(type(self).create(self.topological.sub(i), self.mesh())
firedrake/functionspaceimpl.py:178: in <genexpr>
return tuple(type(self).create(self.topological.sub(i), self.mesh())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = IndexedProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x7f47c876c3e0>, VectorElement(FiniteElement('Raviart-Thomas', triangle, 1), dim=2), name=None, index=1, component=None)
i = 2
def sub(self, i):
r"""Return a view into the ith component."""
if self.rank == 0:
assert i == 0
return self
> return self._components[i]
E IndexError: tuple index out of range
firedrake/functionspaceimpl.py:664: IndexError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)-20-constant-vector]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = 20, typ = 'constant'
fs_type = 'vector'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), VectorElement(FiniteElement('Real', quadrilateral, 0), dim=2)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)-20-constant-tensor]
AttributeError: 'TensorElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = 20, typ = 'constant'
fs_type = 'tensor'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), TensorElement(FiniteElement('Real', quadrilateral, 0), shape=(2, 2), symmetry={})), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'TensorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[extruded-mesh-1-coords-VectorFunctionSpace(CG2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(triangle, interval)), dim=3), 73)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(triangle, interval)), dim=3), 73)
vertexcoords = array([[0.59762701, 0.93037873, 0.70552675]])
vfs = ('CG', 2, <cyfunction VectorFunctionSpace at 0x7fa067fe0860>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElemen..., interval)), dim=3), 74), VectorElement(FiniteElement('Real', TensorProductCell(triangle, interval), 0), dim=3)), 103)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[extruded-mesh-100-coords-VectorFunctionSpace(CG2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(triangle, interval)), dim=3), 102)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElement('Lagrange', interval, 1), cell=TensorProductCell(triangle, interval)), dim=3), 102)
vertexcoords = array([[ 0.59762701, 0.93037873, 0.70552675],
[ 0.58976637, 0.3473096 , 0.79178823],
[ 0.37517442, ...4423547, -0.12030418],
[ 0.52263797, -0.05136594, -0.30431103],
[ 1.22438303, 1.44583898, 1.42166932]])
vfs = ('CG', 2, <cyfunction VectorFunctionSpace at 0x7fa067fe0860>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', triangle, 1), FiniteElemen... interval)), dim=3), 103), VectorElement(FiniteElement('Real', TensorProductCell(triangle, interval), 0), dim=3)), 122)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 9 in tests/extrusion/test_zero_forms_extrusion.py
github-actions / Firedrake real
test_zero_forms_extrusion.test_constant_dx
AttributeError: 'FiniteElement' object has no attribute 'value_size'
Raw output
def test_constant_dx():
mesh = ExtrudedMesh(UnitIntervalMesh(10), 10)
one = Constant(1, domain=mesh)
> assert np.allclose(assemble(one * dx), 1.0)
tests/extrusion/test_zero_forms_extrusion.py:9:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(TensorProductElement(FiniteElement('Lagrange', interval, 1), FiniteElemen...nsorProductCell(interval, interval)), dim=2), 45), FiniteElement('Real', TensorProductCell(interval, interval), 0)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'FiniteElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[cube-mesh-0-coords-VectorFunctionSpace(CG2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 128)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 128)
vertexcoords = array([], shape=(0, 3), dtype=float64)
vfs = ('CG', 2, <cyfunction VectorFunctionSpace at 0x7fa067fe0860>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 130), VectorElement(FiniteElement('Real', tetrahedron, 0), dim=3)), 140)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 136 in tests/demos/test_demos_run.py
github-actions / Firedrake real
test_demos_run.test_demo_runs[ma-demo.py.rst]
subprocess.CalledProcessError: Command '['/__w/firedrake/firedrake_venv/bin/python', '/tmp/pytest-of-firedrake/pytest-0/popen-gw0/test_demo_runs_ma_demo_py_rst_0/ma-demo.py']' returned non-zero exit status 1.
Raw output
py_file = '/tmp/pytest-of-firedrake/pytest-0/popen-gw0/test_demo_runs_ma_demo_py_rst_0/ma-demo.py'
env = {'CI': 'true', 'COMPLEX': '', 'FIREDRAKE_CI_TESTS': '1', 'FIREDRAKE_TSFC_KERNEL_CACHE_DIR': '/__w/firedrake/firedrake_venv/.cache/tsfc', ...}
@pytest.mark.skipcomplex # Will need to add a seperate case for a complex demo.
def test_demo_runs(py_file, env):
# Add pytest skips for missing imports or packages
if basename(py_file) in ("stokes.py", "rayleigh-benard.py", "saddle_point_systems.py", "navier_stokes.py", "netgen_mesh.py"):
if "mumps" not in get_external_packages():
pytest.skip("MUMPS not installed with PETSc")
if basename(py_file) in ("stokes.py", "rayleigh-benard.py", "saddle_point_systems.py", "qg_1layer_wave.py"):
if "hypre" not in get_external_packages():
pytest.skip("hypre not installed with PETSc")
if basename(py_file) == "qgbasinmodes.py":
try:
# Do not use `pytest.importorskip` to check for slepc4py:
# It isn't sufficient to actually detect whether slepc4py
# is installed. Both petsc4py and slepc4py require
# `from xy4py import Xy`
# to actually load the library.
from slepc4py import SLEPc # noqa: F401
except ImportError:
pytest.skip(reason="SLEPc unavailable, skipping qgbasinmodes.py")
if basename(py_file) in ("DG_advection.py", "qgbasinmodes.py"):
pytest.importorskip(
"matplotlib",
reason=f"Matplotlib unavailable, skipping {basename(py_file)}"
)
if basename(py_file) == "netgen_mesh.py":
pytest.importorskip(
"netgen",
reason="Netgen unavailable, skipping Netgen test."
)
pytest.importorskip(
"ngsPETSc",
reason="ngsPETSc unavailable, skipping Netgen test."
)
try:
from slepc4py import SLEPc # noqa: F401, F811
except ImportError:
pytest.skip(reason="SLEPc unavailable, skipping netgen_mesh.py")
if basename(py_file) in VTK_DEMOS:
try:
import vtkmodules.vtkCommonDataModel # noqa: F401
except ImportError:
pytest.skip(reason=f"VTK unavailable, skipping {basename(py_file)}")
if basename(py_file) in parallel_demos:
if basename(py_file) == "full_waveform_inversion.py":
processes = 2
else:
raise NotImplementedError("You need to specify the number of processes for this test")
executable = ["mpiexec", "-n", str(processes), sys.executable, py_file]
else:
executable = [sys.executable, py_file]
> subprocess.check_call(executable, env=env)
/__w/firedrake/firedrake/tests/demos/test_demos_run.py:136:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['/__w/firedrake/firedrake_venv/bin/python', '/tmp/pytest-of-firedrake/pytest-0/popen-gw0/test_demo_runs_ma_demo_py_rst_0/ma-demo.py'],)
kwargs = {'env': {'CI': 'true', 'COMPLEX': '', 'FIREDRAKE_CI_TESTS': '1', 'FIREDRAKE_TSFC_KERNEL_CACHE_DIR': '/__w/firedrake/firedrake_venv/.cache/tsfc', ...}}
retcode = 1
cmd = ['/__w/firedrake/firedrake_venv/bin/python', '/tmp/pytest-of-firedrake/pytest-0/popen-gw0/test_demo_runs_ma_demo_py_rst_0/ma-demo.py']
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the call function. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/__w/firedrake/firedrake_venv/bin/python', '/tmp/pytest-of-firedrake/pytest-0/popen-gw0/test_demo_runs_ma_demo_py_rst_0/ma-demo.py']' returned non-zero exit status 1.
/usr/lib/python3.12/subprocess.py:413: CalledProcessError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[cube-mesh-0-coords-FunctionSpace(N1curl2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 131)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 131)
vertexcoords = array([], shape=(0, 3), dtype=float64)
vfs = ('N1curl', 2, <cyfunction FunctionSpace at 0x7fa067fe06c0>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 133), VectorElement(FiniteElement('Real', tetrahedron, 0), dim=3)), 146)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)--1-constant-scalar]
AttributeError: 'FiniteElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = -1, typ = 'constant'
fs_type = 'scalar'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), FiniteElement('Real', quadrilateral, 0)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'FiniteElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[cube-mesh-0-coords-FunctionSpace(N2curl2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 134)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 134)
vertexcoords = array([], shape=(0, 3), dtype=float64)
vfs = ('N2curl', 2, <cyfunction FunctionSpace at 0x7fa067fe06c0>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 136), VectorElement(FiniteElement('Real', tetrahedron, 0), dim=3)), 152)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)--1-constant-vector]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = -1, typ = 'constant'
fs_type = 'vector'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), VectorElement(FiniteElement('Real', quadrilateral, 0), dim=2)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[cube-mesh-0-coords-FunctionSpace(N1div2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 137)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 137)
vertexcoords = array([], shape=(0, 3), dtype=float64)
vfs = ('N1div', 2, <cyfunction FunctionSpace at 0x7fa067fe06c0>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 139), VectorElement(FiniteElement('Real', tetrahedron, 0), dim=3)), 158)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)--1-constant-tensor]
AttributeError: 'TensorElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = -1, typ = 'constant'
fs_type = 'tensor'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), TensorElement(FiniteElement('Real', quadrilateral, 0), shape=(2, 2), symmetry={})), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'TensorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[cube-mesh-0-coords-FunctionSpace(N2div2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 140)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 140)
vertexcoords = array([], shape=(0, 3), dtype=float64)
vfs = ('N2div', 2, <cyfunction FunctionSpace at 0x7fa067fe06c0>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 142), VectorElement(FiniteElement('Real', tetrahedron, 0), dim=3)), 164)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)--10-constant-scalar]
AttributeError: 'FiniteElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = -10, typ = 'constant'
fs_type = 'scalar'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), FiniteElement('Real', quadrilateral, 0)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'FiniteElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)--10-constant-vector]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = -10, typ = 'constant'
fs_type = 'vector'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), VectorElement(FiniteElement('Real', quadrilateral, 0), dim=2)), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 218 in tests/vertexonly/test_interpolation_from_parent.py
github-actions / Firedrake real
test_interpolation_from_parent.test_vector_function_interpolation[cube-mesh-1-coords-VectorFunctionSpace(CG2)]
AttributeError: 'VectorElement' object has no attribute 'value_size'
Raw output
self = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 145)
tolerance = 0.5
def _c_locator(self, tolerance=None):
from pyop2 import compilation
from pyop2.utils import get_petsc_dir
import firedrake.function as function
import firedrake.pointquery_utils as pq_utils
cache = self.__dict__.setdefault("_c_locator_cache", {})
try:
> return cache[tolerance]
E KeyError: 0.5
firedrake/mesh.py:2651: KeyError
During handling of the above exception, another exception occurred:
parentmesh = Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 145)
vertexcoords = array([[0.59762701, 0.93037873, 0.70552675]])
vfs = ('CG', 2, <cyfunction VectorFunctionSpace at 0x7fa067fe0860>)
def test_vector_function_interpolation(parentmesh, vertexcoords, vfs):
if parentmesh.name == "immersedsphere":
vertexcoords = immersed_sphere_vertexcoords(parentmesh, vertexcoords)
vfs_fam, vfs_deg, vfs_typ = vfs
> vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour=None)
tests/vertexonly/test_interpolation_from_parent.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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/mesh.py:3364: in VertexOnlyMesh
swarm, input_ordering_swarm, n_missing_points = _pic_swarm_in_mesh(
firedrake/mesh.py:3585: in _pic_swarm_in_mesh
) = _parent_mesh_embedding(
firedrake/mesh.py:4151: in _parent_mesh_embedding
) = parent_mesh.locate_cells_ref_coords_and_dists(coords_global, tolerance)
firedrake/mesh.py:2633: in locate_cells_ref_coords_and_dists
self._c_locator(tolerance=tolerance)(self.coordinates._ctypes,
firedrake/mesh.py:2654: in _c_locator
src = pq_utils.src_locate_cell(self, tolerance=tolerance)
firedrake/pointquery_utils.py:37: in src_locate_cell
src.append(compile_coordinate_element(mesh.ufl_coordinate_element(), tolerance))
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/pointquery_utils.py:217: in compile_coordinate_element
"to_reference_coords_newton_step": to_reference_coords_newton_step(ufl_coordinate_element, parameters),
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/pointquery_utils.py:147: in to_reference_coords_newton_step
x0_expr = builder._coefficient(x0, "x0")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', tetrahedron, 1), dim=3), 147), VectorElement(FiniteElement('Real', tetrahedron, 0), dim=3)), 170)
name = 'x0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'VectorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError
Check failure on line 82 in tests/regression/test_zero_forms.py
github-actions / Firedrake real
test_zero_forms.test_math_functions[True-tanh(f) + cos(f) + sin(f)--10-constant-tensor]
AttributeError: 'TensorElement' object has no attribute 'value_size'
Raw output
mesh = Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38)
expr = 'tanh(f) + cos(f) + sin(f)', value = -10, typ = 'constant'
fs_type = 'tensor'
@pytest.mark.parametrize(['expr', 'value', 'typ', 'fs_type'],
itertools.product(['f',
'2*f',
'tanh(f)',
'2 * tanh(f)',
'f + tanh(f)',
'cos(f) + sin(f)',
'cos(f)*cos(f) + sin(f)*sin(f)',
'tanh(f) + cos(f) + sin(f)',
'1.0/tanh(f) + 1.0/f',
'sqrt(f*f)',
'1.0/tanh(sqrt(f*f)) + 1.0/f + sqrt(f*f)'],
[1, 10, 20, -1, -10, -20],
['function', 'constant'],
['scalar', 'vector', 'tensor']))
def test_math_functions(mesh, expr, value, typ, fs_type):
if typ == 'function':
family, degree = 'CG', 1
elif typ == 'constant':
family, degree = 'Real', 0
if fs_type == "vector":
V = VectorFunctionSpace(mesh, family, degree)
elif fs_type == "tensor":
V = TensorFunctionSpace(mesh, family, degree)
else:
V = FunctionSpace(mesh, family, degree)
f = Function(V)
f.assign(value)
if fs_type == "vector":
f = dot(f, f)
elif fs_type == "tensor":
f = inner(f, f)
> actual = assemble(eval(expr)*dx)
tests/regression/test_zero_forms.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:133: in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
firedrake/assemble.py:981: in assemble
self.execute_parloops(tensor)
firedrake/assemble.py:1000: in execute_parloops
for parloop in self.parloops(tensor):
firedrake/assemble.py:1011: in parloops
self._parloops = tuple(parloop_builder.build(tensor) for parloop_builder in self.parloop_builders)
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1017: in parloop_builders
for local_kernel, subdomain_id in self.local_kernels:
/usr/lib/python3.12/functools.py:995: in __get__
val = self.func(instance)
firedrake/assemble.py:1052: in local_kernels
kernels = tsfc_interface.compile_form(
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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/tsfc_interface.py:220: in compile_form
tsfc_kernel = TSFCKernel(
firedrake/tsfc_interface.py:95: in __init__
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
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_venv/src/PyOP2/pyop2/caching.py:550: in wrapper
value = func(*args, **kwargs)
../firedrake_venv/src/tsfc/tsfc/driver.py:74: in compile_form
kernel = compile_integral(integral_data, fd, prefix, parameters, interface=interface, diagonal=diagonal, log=log)
../firedrake_venv/src/tsfc/tsfc/driver.py:128: in compile_integral
builder.set_coefficients(integral_data, form_data)
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:345: in set_coefficients
self._coefficient(coefficient, f"w_{k}")
../firedrake_venv/src/tsfc/tsfc/kernel_interface/firedrake_loopy.py:103: in _coefficient
expr = prepare_coefficient(coefficient, name, interior_facet=self.interior_facet)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coefficient = Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Q', quadrilateral, 1), dim=2), 38), TensorElement(FiniteElement('Real', quadrilateral, 0), shape=(2, 2), symmetry={})), 0)
name = 'w_0', interior_facet = False
def prepare_coefficient(coefficient, name, interior_facet=False):
"""Bridges the kernel interface and the GEM abstraction for
Coefficients.
:arg coefficient: UFL Coefficient
:arg name: unique name to refer to the Coefficient in the kernel
:arg interior_facet: interior facet integral?
:returns: (funarg, expression)
expression - GEM expression referring to the Coefficient
values
"""
assert isinstance(interior_facet, bool)
if coefficient.ufl_element().family() == 'Real':
# Constant
> value_size = coefficient.ufl_element().value_size
E AttributeError: 'TensorElement' object has no attribute 'value_size'
../firedrake_venv/src/tsfc/tsfc/kernel_interface/common.py:475: AttributeError