Skip to content

Index

SMP module-attribute

__all__ module-attribute

__all__ = [
    "GNST",
    "LadeDuncan",
    "MatsuokaNakai",
    "MohrCoulomb",
    "SMP",
    "Tresca",
    "VonMises",
    "Wang2025",
    "Wang2025CA",
    "YieldFunction",
    "yield_function_registry",
]

yield_function_registry module-attribute

yield_function_registry: Registry[str, Type[YieldFunction]] = Registry()

GNST

Bases: YieldFunction

PARAMETERS class-attribute instance-attribute

PARAMETERS = ['equivalent_stress', 'alpha']

alpha instance-attribute

alpha: float = alpha

bounds class-attribute instance-attribute

bounds = {'equivalent_stress': (0, 1000000000.0), 'alpha': (0, 1)}

equivalent_stress instance-attribute

equivalent_stress: float = equivalent_stress

keys class-attribute instance-attribute

keys = ['equivalent_stress', 'alpha']

stds class-attribute instance-attribute

stds = {'equivalent_stress': 1.0, 'alpha': 0.1}

x0 class-attribute instance-attribute

x0 = {'equivalent_stress': 70.0, 'alpha': 0.0}

__init__

__init__(equivalent_stress: float, alpha: float, **kwargs)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

LadeDuncan

Bases: YieldFunction

PARAMETERS class-attribute instance-attribute

PARAMETERS = ['k1']

bounds class-attribute instance-attribute

bounds = {'k1': (0, 100)}

k1 instance-attribute

k1: float = k1

keys class-attribute instance-attribute

keys = ['k1']

stds class-attribute instance-attribute

stds = {'k1': 0.1}

x0 class-attribute instance-attribute

x0 = {'k1': 1.0}

__init__

__init__(k1: float, **kwargs)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

MatsuokaNakai

Bases: YieldFunction

PARAMETERS class-attribute instance-attribute

PARAMETERS = ['phi', 'unit']

bounds class-attribute instance-attribute

bounds = {'phi': (0, 90)}

keys class-attribute instance-attribute

keys = ['phi']

phi instance-attribute

phi: float = phi

stds class-attribute instance-attribute

stds = {'phi': 1.0}

unit class-attribute instance-attribute

unit: Literal['rad', 'deg'] = unit

x0 class-attribute instance-attribute

x0 = {'phi': 30.0}

__init__

__init__(phi: float, *, unit: Literal['rad', 'deg'] = 'deg', **kwargs)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

MohrCoulomb

Bases: YieldFunction

PARAMETERS class-attribute instance-attribute

PARAMETERS = ['c', 'phi', 'unit']

bounds class-attribute instance-attribute

bounds = {'c': (0, 1000000000.0), 'phi': (0, 90)}

c instance-attribute

c: float = c

equivalent_stress instance-attribute

equivalent_stress = c * cos(phi if unit == 'rad' else deg2rad(phi)) * 2

keys class-attribute instance-attribute

keys = ['c', 'phi']

phi instance-attribute

phi: float = phi

stds class-attribute instance-attribute

stds = {'c': 0.1, 'phi': 1.0}

unit class-attribute instance-attribute

unit: Literal['rad', 'deg'] = unit

x0 class-attribute instance-attribute

x0 = {'c': 35.0, 'phi': 30.0}

__init__

__init__(
    c: float, phi: float, *, unit: Literal["rad", "deg"] = "deg", **kwargs
)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

Tresca

Bases: YieldFunction, Tresca

PARAMETERS class-attribute instance-attribute

PARAMETERS = ['equivalent_stress', 'alpha']

alpha instance-attribute

alpha: float = alpha

bounds class-attribute instance-attribute

bounds = {'equivalent_stress': (0, 1000000000.0), 'alpha': (0, 1)}

equivalent_stress instance-attribute

equivalent_stress: float = equivalent_stress

keys class-attribute instance-attribute

keys = ['equivalent_stress', 'alpha']

stds class-attribute instance-attribute

stds = {'equivalent_stress': 1.0, 'alpha': 0.1}

x0 class-attribute instance-attribute

x0 = {'equivalent_stress': 70.0, 'alpha': 0.0}

__init__

__init__(equivalent_stress: float, alpha: float = 0.0, **kwargs)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

VonMises

Bases: YieldFunction, VonMises

PARAMETERS class-attribute instance-attribute

PARAMETERS = ['equivalent_stress', 'alpha']

alpha instance-attribute

alpha: float = alpha

bounds class-attribute instance-attribute

bounds = {'equivalent_stress': (0, 1000000000.0), 'alpha': (0, 1)}

equivalent_stress instance-attribute

equivalent_stress: float = equivalent_stress

keys class-attribute instance-attribute

keys = ['equivalent_stress', 'alpha']

stds class-attribute instance-attribute

stds = {'equivalent_stress': 1.0, 'alpha': 0.1}

x0 class-attribute instance-attribute

x0 = {'equivalent_stress': 70.0, 'alpha': 0.0}

__init__

__init__(equivalent_stress: float, alpha: float = 0.0, **kwargs)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

Wang2025

Bases: YieldFunction

F1 instance-attribute

F1: float

F12 instance-attribute

F12: float

F13 instance-attribute

F13: float

F2 instance-attribute

F2: float

F23 instance-attribute

F23: float

F3 property writable

F3: float

PARAMETERS class-attribute instance-attribute

PARAMETERS = [
    "phi",
    "F1",
    "F2",
    "F12",
    "F13",
    "F23",
    "weight_mises",
    "weight_tresca",
    "weight_mohr_coulomb",
    "weight_smp",
    "unit",
    "vectorize",
    "fast_orthotropy",
]

bounds class-attribute instance-attribute

bounds = {
    "phi": (0, 90),
    "F1": (-10, 10),
    "F2": (-10, 10),
    "F12": (-10, 10),
    "F13": (-10, 10),
    "F23": (-10, 10),
    "weight_mises": (0, 100000.0),
    "weight_tresca": (0, 100000.0),
    "weight_mohr_coulomb": (0, 100000.0),
    "weight_smp": (0, 100000.0),
}

fast_orthotropy class-attribute instance-attribute

fast_orthotropy: bool = fast_orthotropy

keys class-attribute instance-attribute

keys = ['phi', 'F1', 'F2', 'F12', 'F13', 'F23']

phi instance-attribute

phi: float = phi

stds class-attribute instance-attribute

stds = {
    "phi": 1.0,
    "F1": 0.1,
    "F2": 0.1,
    "F12": 0.1,
    "F13": 0.1,
    "F23": 0.1,
    "weight_mises": 0.1,
    "weight_tresca": 0.1,
    "weight_mohr_coulomb": 0.1,
    "weight_smp": 0.1,
}

unit class-attribute instance-attribute

unit: Literal['rad', 'deg'] = unit

vectorize class-attribute instance-attribute

vectorize: bool = vectorize

weight_mises class-attribute instance-attribute

weight_mises: float = weight_mises

weight_mohr_coulomb class-attribute instance-attribute

weight_mohr_coulomb: float = weight_mohr_coulomb

weight_smp class-attribute instance-attribute

weight_smp: float = weight_smp

weight_tresca class-attribute instance-attribute

weight_tresca: float = weight_tresca

x0 class-attribute instance-attribute

x0 = {
    "phi": 30.0,
    "F1": 0.0,
    "F2": 0.0,
    "F12": 0.0,
    "F13": 0.0,
    "F23": 0.0,
    "weight_mises": 0.0,
    "weight_tresca": 0.0,
    "weight_mohr_coulomb": 1.0,
    "weight_smp": 0.0,
}

__init__

__init__(
    phi: float,
    F1: float = 0.0,
    F2: float = 0.0,
    F12: float = 0.0,
    F13: float = 0.0,
    F23: float = 0.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
    *,
    unit: Literal["rad", "deg"] = "deg",
    vectorize: bool = True,
    fast_orthotropy: bool = True,
    **kwargs
)

residual staticmethod

residual(
    fitting_params: List[float],
    stress_states: ndarray,
    fitting_param_names: List[str],
    **kwargs
)

setCriterion

setCriterion(
    criterion: Literal[
        "Mises",
        "Tresca",
        "MohrCoulomb",
        "SMP",
        "Mises-SMP",
        "Tresca-MohrCoulomb",
    ],
    *args,
    **kwargs
)

Set the criterion to use.

setFabricTensor

setFabricTensor(
    *args: float | ndarray,
    r1: float = 0.0,
    r2: float = 0.0,
    r3: float = 0.0,
    unit: Literal["rad", "deg"] = "deg"
)

Set fabric tensor.

PARAMETER DESCRIPTION
args

A tuple of 5 floats for F1, F2, F12, F13, F23 or a 3x3 fabric tensor.

TYPE: float or ndarray DEFAULT: ()

r1

Rotation angle around axis-1, by default 0.0.

TYPE: float DEFAULT: 0.0

r2

Rotation angle around axis-2, by default 0.0.

TYPE: float DEFAULT: 0.0

r3

Rotation angle around axis-3, by default 0.0.

TYPE: float DEFAULT: 0.0

unit

Unit of rotation angles, by default "deg".

TYPE: Literal['rad', 'deg'] DEFAULT: 'deg'

setMises

setMises()

Use Mises criterion.

setMisesSMP

setMisesSMP(weight_mises: float = 0.5, weight_smp: float = 0.5)

Use Mises-SMP criterion.

setMohrCoulomb

setMohrCoulomb()

Use Mohr-Coulomb criterion.

setSMP

setSMP()

Use SMP criterion.

setTresca

setTresca()

Use Tresca criterion.

setTrescaMohrCoulomb

setTrescaMohrCoulomb(
    weight_tresca: float = 0.5, weight_mohr_coulomb: float = 0.5
)

Use Tresca-Mohr-Coulomb criterion.

Wang2025CA

Bases: Wang2025

F1 instance-attribute

F1 = F1

F2 property writable

F2: float

F3 property writable

F3: float

keys class-attribute instance-attribute

keys = ['phi', 'F1']

major_axes class-attribute instance-attribute

major_axes: int = major_axes

__init__

__init__(
    phi: float,
    F1: float | None = None,
    F2: float | None = None,
    F3: float | None = None,
    major_axes: int = 1,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
    *,
    unit: Literal["rad", "deg"] = "deg",
    vectorize: bool = True,
    fast_orthotropy: bool = True,
    **kwargs
)

YieldFunction

Bases: YieldFunction, CalibrationABC

Fitness property

Fitness: Type[FitnessBase]

caches class-attribute

caches: Dict[str, LRUCache] = {
    "get": LRUCache(maxsize=128),
    "get_2d_xydata": LRUCache(maxsize=128),
}

default_eq_stress class-attribute instance-attribute

default_eq_stress: float | None = None

default_max_stress class-attribute instance-attribute

default_max_stress: float | None = None

default_min_stress class-attribute instance-attribute

default_min_stress: float | None = None

default_origin class-attribute instance-attribute

default_origin: Tuple[float, float, float] = (0, 0, 0)

default_plane class-attribute instance-attribute

default_plane: Tuple[float, float, float] = (1, 1, 1)

io property

io: Self

loded class-attribute instance-attribute

loded = partialmethod(lode, unit='deg')

loded1 class-attribute instance-attribute

loded1 = partialmethod(lode1, unit='deg')

loded2 class-attribute instance-attribute

loded2 = partialmethod(lode2, unit='deg')

loded3 class-attribute instance-attribute

loded3 = partialmethod(lode3, unit='deg')

origin class-attribute instance-attribute

origin: Tuple[float, float, float] = (0, 0, 0)

parameters property

parameters: List[str]

phid class-attribute instance-attribute

phid = partialmethod(phi, unit='deg')

phid1 class-attribute instance-attribute

phid1 = partialmethod(phi1, unit='deg')

phid2 class-attribute instance-attribute

phid2 = partialmethod(phi2, unit='deg')

phid3 class-attribute instance-attribute

phid3 = partialmethod(phi3, unit='deg')

thetad class-attribute instance-attribute

thetad = partialmethod(theta, unit='deg')

thetad1 class-attribute instance-attribute

thetad1 = partialmethod(theta1, unit='deg')

thetad2 class-attribute instance-attribute

thetad2 = partialmethod(theta2, unit='deg')

thetad3 class-attribute instance-attribute

thetad3 = partialmethod(theta3, unit='deg')

__getitem__

__getitem__(var: str) -> ndarray

__hash__

__hash__() -> int

b

b(**kwargs) -> ndarray

Intermediate principal stress ratio in all sectors.

b1

b1(**kwargs) -> ndarray

Intermediate principal stress ratio in Sector I (0, pi/3).

b2

b2(**kwargs) -> ndarray

Intermediate principal stress ratio in Sector II (pi/3, 2*pi/3).

b3

b3(**kwargs) -> ndarray

Intermediate principal stress ratio in Sector III (2*pi/3, pi).

copy

copy() -> Self

Create a copy of the yield function.

eta

eta(**kwargs) -> ndarray

Critical stress ratio in all sectors.

eta1

eta1(**kwargs) -> ndarray

Critical stress ratio in Sector I (0, pi/3).

eta2

eta2(**kwargs) -> ndarray

Critical stress ratio in Sector II (pi/3, 2*pi/3).

eta3

eta3(**kwargs) -> ndarray

Critical stress ratio in Sector III (2*pi/3, pi).

get

get(var: str, **kwargs) -> ndarray

get_2d_xydata

get_2d_xydata(
    polar: bool = False,
    normalize: bool | Literal["max", "mean", "x"] | float = True,
    normalize_x: float | None = None,
    resolution: int = 500,
    min_theta: float | None = None,
    max_theta: float | None = None,
    **kwargs
) -> Tuple[ndarray, ndarray]

Get the x and y data for plotting the yield function in 2D.

PARAMETER DESCRIPTION
polar

Whether to plot in polar coordinates.

TYPE: bool DEFAULT: False

normalize

Whether to normalize the yield function. If True or "max", normalize by the maximum value. If "mean", normalize by the mean value, if "x", normalize by the value corresponding to this angle specified by normalize_x, if a float, normalize by the value corresponding to this angle.

TYPE: (bool, str, float) DEFAULT: True

normalize_x

The angle to normalize the yield function.

TYPE: float DEFAULT: None

resolution

The resolution of the plot.

TYPE: int DEFAULT: 500

min_theta

The minimum angle to plot.

TYPE: float DEFAULT: None

max_theta

The maximum angle to plot.

TYPE: float DEFAULT: None

kwargs

Keyword arguments for 2D project functions.

DEFAULT: {}

RETURNS DESCRIPTION
Tuple[ndarray, ndarray]

The x and y data for plotting the yield function.

get_value

get_value(stress_states)

lode

lode(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Lode angle in all sectors.

lode1

lode1(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Lode angle in Sector I (0, pi/3).

lode2

lode2(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Lode angle in Sector II (pi/3, 2*pi/3).

lode3

lode3(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Lode angle in Sector III (2*pi/3, pi).

phi

phi(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Friction angle in all sectors.

phi1

phi1(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Friction angle in Sector I (0, pi/3).

phi2

phi2(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Friction angle in Sector II (pi/3, 2*pi/3).

phi3

phi3(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Friction angle in Sector III (2*pi/3, pi).

plot2d

plot2d(
    plane: Tuple[float, float, float] = None,
    origin: Tuple[float, float, float] = None,
    polar: bool = False,
    normalize: bool | Literal["max", "mean", "x"] | float = True,
    normalize_x: float | None = None,
    resolution: int = 500,
    eq_stress: float | None = None,
    min_stress: float | None = None,
    max_stress: float | None = None,
    min_theta: float | None = None,
    max_theta: float | None = None,
    *,
    on: Plottable | None = None,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot the yield function in 2D.

PARAMETER DESCRIPTION
plane

The direction of the plane to plot the yield function.

TYPE: Tuple[float, float, float] DEFAULT: None

origin

The origin of the plane to plot the yield function.

TYPE: Tuple[float, float, float] DEFAULT: None

polar

Whether to plot in polar coordinates.

TYPE: bool DEFAULT: False

normalize

Whether to normalize the yield function. If True or "max", normalize by the maximum value. If "mean", normalize by the mean value, if "x", normalize by the value corresponding to this angle specified by normalize_x, if a float, normalize by the value corresponding to this angle.

TYPE: (bool, str, float) DEFAULT: True

normalize_x

The angle to normalize the yield function.

TYPE: float DEFAULT: None

resolution

The resolution of the plot.

TYPE: int DEFAULT: 500

eq_stress

The equivalent stress to plot.

TYPE: float DEFAULT: None

min_stress

The minimum stress to plot.

TYPE: float DEFAULT: None

max_stress

The maximum stress to plot.

TYPE: float DEFAULT: None

min_theta

The minimum angle to plot.

TYPE: float DEFAULT: None

max_theta

The maximum angle to plot.

TYPE: float DEFAULT: None

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

backend

Backend to use, by default None which means the backend set in the environment variable MICROMECHANICAL_PLOTTING_BACKEND.

TYPE: Literal['matplotlib', 'bokeh'] | str DEFAULT: None

subplots_kwargs

Keyword arguments for creating the subplots, by default None

TYPE: dict DEFAULT: None

props

Properties passed to the setAxesProps method to set the axes properties, by default None

TYPE: Dict[str, Any] DEFAULT: None

bokeh_show

Whether to show the figure in the browser, by default False

TYPE: bool DEFAULT: False

tight_layout

Whether to use tight layout in the matplotlib figure, by default True

TYPE: bool DEFAULT: True

kwargs

Keyword arguments for plt.plot or bplt.line

DEFAULT: {}

RETURNS DESCRIPTION
Figure | GridPlot

The matplotlib figure or bokeh gridplot

plot3d

plot3d(
    type: Literal["surface", "trisurf", "wireframe"] = "trisurf",
    resolution: int = 100,
    eq_stress: float | None = None,
    min_stress: float | None = None,
    max_stress: float | None = None,
    min_mean_stress: float | None = None,
    max_mean_stress: float | None = None,
    *,
    on: Plottable | None = None,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot the yield function in 3D.

PARAMETER DESCRIPTION
type

The type of the plot.

TYPE: Literal['surface', 'trisurf', 'wireframe'] DEFAULT: 'trisurf'

resolution

The resolution of the plot.

TYPE: int DEFAULT: 100

eq_stress

The equivalent stress to plot.

TYPE: float DEFAULT: None

min_stress

The minimum stress to plot.

TYPE: float DEFAULT: None

max_stress

The maximum stress to plot.

TYPE: float DEFAULT: None

min_mean_stress

The minimum mean stress to plot.

TYPE: float DEFAULT: None

max_mean_stress

The maximum mean stress to plot.

TYPE: float DEFAULT: None

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

backend

Backend to use, by default None which means the backend set in the environment variable MICROMECHANICAL_PLOTTING_BACKEND.

TYPE: Literal['matplotlib', 'bokeh'] | str DEFAULT: None

subplots_kwargs

Keyword arguments for creating the subplots, by default None

TYPE: dict DEFAULT: None

props

Properties passed to the setAxesProps method to set the axes properties, by default None

TYPE: Dict[str, Any] DEFAULT: None

bokeh_show

Whether to show the figure in the browser, by default False

TYPE: bool DEFAULT: False

tight_layout

Whether to use tight layout in the matplotlib figure, by default True

TYPE: bool DEFAULT: True

kwargs

Keyword arguments for plt.plot or bplt.line

DEFAULT: {}

RETURNS DESCRIPTION
Figure | GridPlot

The matplotlib figure or bokeh gridplot

theta

theta(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Angle in all sectors.

theta1

theta1(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Angle in Sector I (0, pi/3).

theta2

theta2(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Angle in Sector II (pi/3, 2*pi/3).

theta3

theta3(*, unit: Literal['deg', 'rad'] = 'rad', **kwargs) -> ndarray

Angle in Sector III (2*pi/3, pi).