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

changed type hints in folder experimental_setup #146

Merged
merged 1 commit into from
Oct 23, 2023
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
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
Loading