From 0c1ae40070f90d951936bc3e0828dbf3c5ddcce5 Mon Sep 17 00:00:00 2001 From: aradermacher Date: Mon, 23 Oct 2023 11:40:03 +0200 Subject: [PATCH] changed type hints in folder experimental_setup --- .../experimental_setup/am_multiple_layers.py | 2 +- src/fenicsxconcrete/experimental_setup/base_experiment.py | 6 +++--- src/fenicsxconcrete/experimental_setup/cantilever_beam.py | 4 ++-- .../experimental_setup/compression_cylinder.py | 2 +- src/fenicsxconcrete/experimental_setup/simple_beam.py | 2 +- src/fenicsxconcrete/experimental_setup/simple_cube.py | 4 ++-- src/fenicsxconcrete/experimental_setup/tensile_beam.py | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/fenicsxconcrete/experimental_setup/am_multiple_layers.py b/src/fenicsxconcrete/experimental_setup/am_multiple_layers.py index 3c0d439..bfc7fca 100644 --- a/src/fenicsxconcrete/experimental_setup/am_multiple_layers.py +++ b/src/fenicsxconcrete/experimental_setup/am_multiple_layers.py @@ -96,7 +96,7 @@ def setup(self) -> None: else: raise ValueError(f'wrong dimension: {self.p["dim"]} is not implemented for problem setup') - def create_displacement_boundary(self, V: df.fem.FunctionSpace) -> list[df.fem.bcs.DirichletBCMetaClass]: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC]: """defines displacement boundary as fixed at bottom Args: diff --git a/src/fenicsxconcrete/experimental_setup/base_experiment.py b/src/fenicsxconcrete/experimental_setup/base_experiment.py index 5167603..0268680 100644 --- a/src/fenicsxconcrete/experimental_setup/base_experiment.py +++ b/src/fenicsxconcrete/experimental_setup/base_experiment.py @@ -5,8 +5,8 @@ import pint import ufl -from fenicsxconcrete.boundary_conditions.boundary import plane_at, point_at -from fenicsxconcrete.util import LogMixin, Parameters, QuadratureRule, ureg +from fenicsxconcrete.boundary_conditions.boundary import plane_at +from fenicsxconcrete.util import LogMixin, Parameters, QuadratureRule class Experiment(ABC, LogMixin): @@ -81,7 +81,7 @@ def default_parameters() -> dict[str, pint.Quantity]: pass @abstractmethod - def create_displacement_boundary(self, V: df.fem.FunctionSpace) -> list[df.fem.bcs.DirichletBCMetaClass] | None: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC] | None: """defines empty displacement boundary conditions (to be done in child) this function is abstract until there is a need for a material that does not need a displacement boundary diff --git a/src/fenicsxconcrete/experimental_setup/cantilever_beam.py b/src/fenicsxconcrete/experimental_setup/cantilever_beam.py index 7b06b38..28b4ffe 100644 --- a/src/fenicsxconcrete/experimental_setup/cantilever_beam.py +++ b/src/fenicsxconcrete/experimental_setup/cantilever_beam.py @@ -6,7 +6,7 @@ from petsc4py.PETSc import ScalarType from fenicsxconcrete.experimental_setup.base_experiment import Experiment -from fenicsxconcrete.util import Parameters, ureg +from fenicsxconcrete.util import ureg class CantileverBeam(Experiment): @@ -81,7 +81,7 @@ def default_parameters() -> dict[str, pint.Quantity]: return setup_parameters - def create_displacement_boundary(self, V) -> list: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list: """defines displacement boundary as fixed at bottom Args: diff --git a/src/fenicsxconcrete/experimental_setup/compression_cylinder.py b/src/fenicsxconcrete/experimental_setup/compression_cylinder.py index a58c2d2..551e7e1 100644 --- a/src/fenicsxconcrete/experimental_setup/compression_cylinder.py +++ b/src/fenicsxconcrete/experimental_setup/compression_cylinder.py @@ -184,7 +184,7 @@ def default_parameters() -> dict[str, pint.Quantity]: return default_parameters - def create_displacement_boundary(self, V: df.fem.FunctionSpace) -> list[df.fem.bcs.DirichletBCMetaClass]: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC]: """Defines the displacement boundary conditions Args: diff --git a/src/fenicsxconcrete/experimental_setup/simple_beam.py b/src/fenicsxconcrete/experimental_setup/simple_beam.py index edfecdb..f0d0834 100644 --- a/src/fenicsxconcrete/experimental_setup/simple_beam.py +++ b/src/fenicsxconcrete/experimental_setup/simple_beam.py @@ -87,7 +87,7 @@ def default_parameters() -> dict[str, pint.Quantity]: return setup_parameters - def create_displacement_boundary(self, V) -> list: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC]: """defines displacement boundary as fixed at bottom Args: diff --git a/src/fenicsxconcrete/experimental_setup/simple_cube.py b/src/fenicsxconcrete/experimental_setup/simple_cube.py index 33e0fca..55fcf11 100644 --- a/src/fenicsxconcrete/experimental_setup/simple_cube.py +++ b/src/fenicsxconcrete/experimental_setup/simple_cube.py @@ -98,7 +98,7 @@ def setup(self) -> None: self.use_body_force = False self.temperature_bc = df.fem.Constant(domain=self.mesh, c=self.p["T_bc"]) - def create_displacement_boundary(self, V: df.fem.FunctionSpace) -> list[df.fem.bcs.DirichletBCMetaClass]: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC]: """Defines the displacement boundary conditions Args: @@ -192,7 +192,7 @@ def apply_temp_bc(self, T_bc: pint.Quantity | float) -> None: def apply_body_force(self) -> None: self.use_body_force = True - def create_temperature_bcs(self, V: df.fem.FunctionSpace) -> list[df.fem.bcs.DirichletBCMetaClass]: + def create_temperature_bcs(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC]: """defines empty temperature boundary conditions (to be done in child) this function is abstract until there is a need for a material that does need a temperature boundary diff --git a/src/fenicsxconcrete/experimental_setup/tensile_beam.py b/src/fenicsxconcrete/experimental_setup/tensile_beam.py index 1567ef3..5c03180 100644 --- a/src/fenicsxconcrete/experimental_setup/tensile_beam.py +++ b/src/fenicsxconcrete/experimental_setup/tensile_beam.py @@ -82,7 +82,7 @@ def default_parameters() -> dict[str, pint.Quantity]: return setup_parameters - def create_displacement_boundary(self, V) -> list: + def create_displacement_boundary(self, V: df.fem.FunctionSpaceBase) -> list[df.fem.bcs.DirichletBC]: """Defines the displacement boundary conditions Args: