From 07eb3fb31b62f1f530baef4aed132ddb98040ba4 Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Tue, 17 Oct 2023 07:03:05 +0200 Subject: [PATCH] dolfinx.fem.FunctionSpaceBase was renamed to dolfinx.fem.FunctionSpace, and the family name of a basix element is now extracted using the property family_name rather than the function family. --- rbnicsx/backends/functions_list.py | 6 +++--- rbnicsx/backends/import_.py | 4 ++-- rbnicsx/backends/mesh_motion.py | 4 ++-- tutorials/01_thermal_block.ipynb | 4 ++-- tutorials/02_elastic_block.ipynb | 2 +- tutorials/03_hole.ipynb | 2 +- tutorials/04_graetz.ipynb | 2 +- tutorials/05_gaussian.ipynb | 2 +- tutorials/07_nonlinear_elliptic.ipynb | 2 +- tutorials/12_stokes.ipynb | 2 +- tutorials/17_navier_stokes.ipynb | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rbnicsx/backends/functions_list.py b/rbnicsx/backends/functions_list.py index 0b89a6e..7242e64 100644 --- a/rbnicsx/backends/functions_list.py +++ b/rbnicsx/backends/functions_list.py @@ -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 diff --git a/rbnicsx/backends/import_.py b/rbnicsx/backends/import_.py index f848d67..2ff5067 100644 --- a/rbnicsx/backends/import_.py +++ b/rbnicsx/backends/import_.py @@ -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. @@ -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. diff --git a/rbnicsx/backends/mesh_motion.py b/rbnicsx/backends/mesh_motion.py index 15acc6e..8686d3e 100644 --- a/rbnicsx/backends/mesh_motion.py +++ b/rbnicsx/backends/mesh_motion.py @@ -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 diff --git a/tutorials/01_thermal_block.ipynb b/tutorials/01_thermal_block.ipynb index 6d7282c..bfbd339 100644 --- a/tutorials/01_thermal_block.ipynb +++ b/tutorials/01_thermal_block.ipynb @@ -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", @@ -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", diff --git a/tutorials/02_elastic_block.ipynb b/tutorials/02_elastic_block.ipynb index e831a2e..2c6b1ff 100644 --- a/tutorials/02_elastic_block.ipynb +++ b/tutorials/02_elastic_block.ipynb @@ -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", diff --git a/tutorials/03_hole.ipynb b/tutorials/03_hole.ipynb index f74366a..997517d 100644 --- a/tutorials/03_hole.ipynb +++ b/tutorials/03_hole.ipynb @@ -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", diff --git a/tutorials/04_graetz.ipynb b/tutorials/04_graetz.ipynb index 843f18c..82735cd 100644 --- a/tutorials/04_graetz.ipynb +++ b/tutorials/04_graetz.ipynb @@ -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", diff --git a/tutorials/05_gaussian.ipynb b/tutorials/05_gaussian.ipynb index 5169eec..9aab8fa 100644 --- a/tutorials/05_gaussian.ipynb +++ b/tutorials/05_gaussian.ipynb @@ -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", diff --git a/tutorials/07_nonlinear_elliptic.ipynb b/tutorials/07_nonlinear_elliptic.ipynb index bb11a83..9ac3819 100644 --- a/tutorials/07_nonlinear_elliptic.ipynb +++ b/tutorials/07_nonlinear_elliptic.ipynb @@ -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", diff --git a/tutorials/12_stokes.ipynb b/tutorials/12_stokes.ipynb index b5e910d..34dd3b7 100644 --- a/tutorials/12_stokes.ipynb +++ b/tutorials/12_stokes.ipynb @@ -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", diff --git a/tutorials/17_navier_stokes.ipynb b/tutorials/17_navier_stokes.ipynb index 77e8839..dde9b60 100644 --- a/tutorials/17_navier_stokes.ipynb +++ b/tutorials/17_navier_stokes.ipynb @@ -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",