Skip to content

Commit

Permalink
dolfinx.fem.FunctionSpaceBase was renamed to dolfinx.fem.FunctionSpac…
Browse files Browse the repository at this point in the history
…e, and the family name of a basix element is now extracted using the property family_name rather than the function family.
  • Loading branch information
francesco-ballarin committed Oct 17, 2023
1 parent 76d6937 commit 07eb3fb
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions rbnicsx/backends/functions_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class FunctionsList(FunctionsListBase[dolfinx.fem.Function]):
Finite element space provided as input.
"""

def __init__(self, function_space: dolfinx.fem.FunctionSpaceBase) -> None:
self._function_space: dolfinx.fem.FunctionSpaceBase = function_space
def __init__(self, function_space: dolfinx.fem.FunctionSpace) -> None:
self._function_space: dolfinx.fem.FunctionSpace = function_space
super().__init__(function_space.mesh.comm)

@property
def function_space(self) -> dolfinx.fem.FunctionSpaceBase:
def function_space(self) -> dolfinx.fem.FunctionSpace:
"""Return the common finite element space of any Function that will be added to this list."""
return self._function_space

Expand Down
4 changes: 2 additions & 2 deletions rbnicsx/backends/import_.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


def import_function(
function_space: dolfinx.fem.FunctionSpaceBase, directory: str, filename: str
function_space: dolfinx.fem.FunctionSpace, directory: str, filename: str
) -> dolfinx.fem.Function:
"""
Import a dolfinx.fem.Function from file.
Expand Down Expand Up @@ -48,7 +48,7 @@ def import_function(


def import_functions(
function_space: dolfinx.fem.FunctionSpaceBase, directory: str, filename: str
function_space: dolfinx.fem.FunctionSpace, directory: str, filename: str
) -> typing.List[dolfinx.fem.Function]:
"""
Import a list of dolfinx.fem.Function from file.
Expand Down
4 changes: 2 additions & 2 deletions rbnicsx/backends/mesh_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class MeshMotion(object):
"""

def __init__(self, mesh: dolfinx.mesh.Mesh, shape_parametrization: dolfinx.fem.Function) -> None:
assert shape_parametrization.function_space.ufl_element().family() == "P"
assert shape_parametrization.function_space.ufl_element().family_name == "P"
assert len(mesh.geometry.cmaps) == 1
assert shape_parametrization.function_space.ufl_element().degree() == mesh.geometry.cmaps[0].degree
assert shape_parametrization.function_space.ufl_element().degree == mesh.geometry.cmaps[0].degree

self._mesh: dolfinx.mesh.Mesh = mesh
self._shape_parametrization: dolfinx.fem.Function = shape_parametrization
Expand Down
4 changes: 2 additions & 2 deletions tutorials/01_thermal_block.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
" self._bcs = bcs\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down Expand Up @@ -412,7 +412,7 @@
" self._restriction = restriction\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the eigenvalue problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/02_elastic_block.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
" + lambda_1 * ufl.inner(ufl.tr(ufl.sym(ufl.grad(u))), ufl.tr(ufl.sym(ufl.grad(v)))))\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/03_hole.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
" self._mu = np.zeros(mu_symb.value.shape)\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/04_graetz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
" self._mesh_motion: typing.Optional[rbnicsx.backends.MeshMotion] = None\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/05_gaussian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
" self._bcs = bcs\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/07_nonlinear_elliptic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
" self._bcs = bcs\n",
"\n",
" @property\n",
" def function_space(self) -> dolfinx.fem.FunctionSpaceBase:\n",
" def function_space(self) -> dolfinx.fem.FunctionSpace:\n",
" \"\"\"Return the function space of the problem.\"\"\"\n",
" return self._V\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/12_stokes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
"\n",
" @property\n",
" def function_spaces(self) -> typing.Tuple[\n",
" dolfinx.fem.FunctionSpaceBase, dolfinx.fem.FunctionSpaceBase\n",
" dolfinx.fem.FunctionSpace, dolfinx.fem.FunctionSpace\n",
" ]:\n",
" \"\"\"Return the function spaces of the problem.\"\"\"\n",
" return self._VQ\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/17_navier_stokes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
"\n",
" @property\n",
" def function_spaces(self) -> typing.Tuple[\n",
" dolfinx.fem.FunctionSpaceBase, dolfinx.fem.FunctionSpaceBase\n",
" dolfinx.fem.FunctionSpace, dolfinx.fem.FunctionSpace\n",
" ]:\n",
" \"\"\"Return the function spaces of the problem.\"\"\"\n",
" return self._VQ\n",
Expand Down

0 comments on commit 07eb3fb

Please sign in to comment.