Source code for sigmaepsilon.solid.fourier.protocols
from typing import Protocol, runtime_checkable, Iterable, Hashable, ClassVar
from numpy import ndarray
from sigmaepsilon.deepdict import DeepDict
from .result import LoadCaseResultLinStat
from .enums import MechanicalModelType
[docs]
@runtime_checkable
class NavierProblemProtocol(Protocol):
"""Protocol for Navier problems."""
result_class: ClassVar[LoadCaseResultLinStat]
@property
def size(self) -> Iterable[float | int] | float | int:
pass
@property
def shape(self, value) -> Iterable[int] | int:
pass
@property
def model_type(self) -> MechanicalModelType:
pass
def linear_static_analysis(
self, points, loads
) -> DeepDict[Hashable, DeepDict | LoadCaseResultLinStat]:
pass
[docs]
@runtime_checkable
class LoadCaseProtocol(Protocol):
"""Protocol for load cases."""
@property
def domain(self):
pass
@domain.setter
def domain(self, value):
pass
@property
def value(self):
pass
@value.setter
def value(self, value):
pass
[docs]
def eval_approx(self, problem: NavierProblemProtocol, points: Iterable) -> ndarray:
"""Evaluates the Fourier series approximation of the load at the given points."""
pass
[docs]
def rhs(self, problem: NavierProblemProtocol) -> ndarray:
"""Calculates the Fourier coefficients."""
pass
[docs]
@runtime_checkable
class LoadGroupProtocol(Protocol):
"""Protocol for load groups."""
def groups(self, *args, **kwargs) -> Iterable["LoadGroupProtocol"]:
pass
def cases(self, *args, **kwargs) -> Iterable[LoadCaseProtocol]:
pass