Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated functions #643

Merged
merged 7 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions demo/ExpressionInterpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import basix
import basix.ufl
from ffcx.element_interface import QuadratureElement
from ufl import Coefficient, FunctionSpace, Mesh, grad

# Define mesh
Expand All @@ -42,7 +41,7 @@
# Define an expression using quadrature elements
q_rule = "gauss_jacobi"
q_degree = 3
q_el = QuadratureElement(cell, (), q_rule, q_degree)
q_el = basix.ufl.quadrature_element(cell, scheme=q_rule, degree=q_degree)
Q = FunctionSpace(mesh, q_el)
q = Coefficient(Q)
powq = 3 * q**2
Expand Down
25 changes: 0 additions & 25 deletions ffcx/element_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
"""Finite element interface."""

import typing
import warnings

import basix
import basix.ufl
import ufl
import numpy as np
import numpy.typing as npt

Expand Down Expand Up @@ -46,26 +44,3 @@ def map_facet_points(points: npt.NDArray[np.float64], facet: int, cellname: str)
facet_vertices = [geom[i] for i in basix.topology(basix.cell.string_to_type(cellname))[-2][facet]]
return np.asarray([facet_vertices[0] + sum((i - facet_vertices[0]) * j for i, j in zip(facet_vertices[1:], p))
for p in points], dtype=np.float64)


# TODO: remove this deprecated function
def QuadratureElement(
cellname: str, value_shape: typing.Tuple[int, ...], scheme: typing.Optional[str] = None,
degree: typing.Optional[int] = None, points: typing.Optional[npt.NDArray[np.float64]] = None,
weights: typing.Optional[npt.NDArray[np.float64]] = None,
pullback: ufl.AbstractPullback = ufl.identity_pullback
) -> basix.ufl._ElementBase:
warnings.warn(
"ffcx.element_interface.QuadratureElement is deprecated and will be removed after December 2023. "
"Use basix.ufl.quadrature_element instead.", DeprecationWarning)
return basix.ufl.quadrature_element(
cell=cellname, value_shape=value_shape, scheme=scheme, degree=degree, points=points, weights=weights,
pullback=pullback)


# TODO: remove this deprecated function
def RealElement(element: ufl.finiteelement.AbstractFiniteElement) -> basix.ufl._ElementBase:
warnings.warn(
"ffcx.element_interface.RealElement is deprecated and will be removed after December 2023. "
"Use basix.ufl.real_element instead.", DeprecationWarning)
return basix.ufl.real_element(cell=element.cell().cellname(), value_shape=element.value_shape())
4 changes: 2 additions & 2 deletions ffcx/ir/elementtables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import ufl
import basix.ufl
from ffcx.element_interface import QuadratureElement, basix_index
from ffcx.element_interface import basix_index
from ffcx.ir.representationutils import (create_quadrature_points_and_weights,
integral_type_to_entity_dim,
map_integral_points)
Expand Down Expand Up @@ -105,7 +105,7 @@ def get_ffcx_table_values(points, cell, integral_type, element, avg, entitytype,
elif avg == "facet":
integral_type = "exterior_facet"

if isinstance(element, QuadratureElement):
if isinstance(element, basix.ufl.QuadratureElement):
points = element._points
weights = element._weights
else:
Expand Down
Loading