Skip to content

Commit

Permalink
changed type hints in folder experimental_setup
Browse files Browse the repository at this point in the history
  • Loading branch information
aradermacher committed Oct 23, 2023
1 parent 624caee commit 0c1ae40
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/fenicsxconcrete/experimental_setup/base_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/fenicsxconcrete/experimental_setup/cantilever_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/fenicsxconcrete/experimental_setup/simple_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/fenicsxconcrete/experimental_setup/simple_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/fenicsxconcrete/experimental_setup/tensile_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0c1ae40

Please sign in to comment.