Skip to content

model

ExperimentsType module-attribute

ExperimentsType = Union[
    Experiment, List[Experiment], Dict[str, Experiment], str, List[str]
]

CalibrationModel

Bases: IOModel

Calibration manager for the micromechanical model.

calibrate

calibrate(
    x0: Dict[str | CalibrationKey, float] | None = None,
    *,
    experiments: ExperimentsType | None = None,
    includes: List[str | CalibrationKey] | None = None,
    include_additions: List[str | CalibrationKey] | None = None,
    excludes: List[str | CalibrationKey] | None = None,
    experiment_specific_parameters: List[str] | None = None,
    fitness: Union["FitnessBase", Type["FitnessBase"], str, None] = None,
    method: str = "PYCMA-CMAES",
    bounds: Dict[str | CalibrationKey, Tuple[float, float]] | None = None,
    stds: Dict[str | CalibrationKey, float] | None = None,
    save_to: str | None = None,
    save_to_kwargs: Dict | None = None,
    **kwargs: Unpack[CalibrationFitnessAndOptimizationOptions]
) -> Tuple[Dict[str, float], OptimizerResult]

Calibrate the model parameters to the experiments.

PARAMETER DESCRIPTION
x0

Initial guess for the parameters

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

experiments

Experiments to evaluate the fitness, by default None which means all experiments in the manager

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

includes

Parameters to include in the calibration, by default None which means all parameters

TYPE: List[str | CalibrationKey] DEFAULT: None

include_additions

Additional parameters to include in the calibration, by default None

TYPE: List[str | CalibrationKey] DEFAULT: None

excludes

Parameters to exclude from the calibration, by default None

TYPE: List[str | CalibrationKey] DEFAULT: None

experiment_specific_parameters

Optimization parameters that are specific to each experiment, by default None

TYPE: List[str] DEFAULT: None

lognormal_parameters

Parameters to be distributed in the lognormal space

TYPE: List[str | CalibrationKey]

fitness

Custom fitness object or class or the full name of the class, by default None

TYPE: FitnessBase | Type[FitnessBase] | str DEFAULT: None

method

Optimization method, by default "PYCMA-CMAES"

TYPE: str DEFAULT: 'PYCMA-CMAES'

bounds

Bounds for the parameters, by default None

TYPE: Dict[str | CalibrationKey, Tuple[float, float]] DEFAULT: None

stds

Standard deviations for the parameters, by default None

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

save_to

Save the calibration results to a file, by default None

TYPE: str DEFAULT: None

save_to_kwargs

Extra keyword arguments for the save_to method, by default None

TYPE: Dict DEFAULT: None

kwargs

Fitness or optimizer keyword arguments, if the fitness has attributes with the same name, the value will be set to the attribute, and other arguments will be passed to the optimizer

TYPE: Unpack[CalibrationFitnessAndOptimizationOptions] DEFAULT: {}

RETURNS DESCRIPTION
Tuple[Dict[str, float], OptimizerResult]

Optimized parameters and the optimization result

fitness

fitness(
    x0: Dict[str | CalibrationKey, float] | None = None,
    *,
    experiments: ExperimentsType | None = None,
    fitness: Union["FitnessBase", Type["FitnessBase"], str, None] = None,
    **kwargs: Unpack[CalibrationFitnessAndOptimizationOptions]
) -> float

Calculate the fitness of the model to the experiments.

PARAMETER DESCRIPTION
x0

Parameters to set before calculating the fitness, by default None

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

experiments

Experiments to evaluate the fitness, by default None which means all experiments in the manager

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

fitness

Custom fitness object or class or the full name of the class, by default None

TYPE: FitnessBase | Type[FitnessBase] | str DEFAULT: None

kwargs

Additional keyword arguments to pass to the fitness object

TYPE: Unpack[CalibrationFitnessAndOptimizationOptions] DEFAULT: {}

select_parameters

select_parameters(
    x0: Dict[str | CalibrationKey, float] | None = None,
    *,
    includes: List[str | CalibrationKey] | None = None,
    include_additions: List[str | CalibrationKey] | None = None,
    excludes: List[str | CalibrationKey] | None = None,
    experiments: ExperimentsType | None = None,
    experiment_specific_parameters: List[str] | None = None,
    bounds: Dict[str | CalibrationKey, Tuple[float, float]] | None = None,
    stds: Dict[str | CalibrationKey, float] | None = None,
    lognormal_parameters: List[str | CalibrationKey] = None
) -> Tuple[List[str | CalibrationKey], Dict, Dict, Dict]

Select the parameters for the calibration.

PARAMETER DESCRIPTION
x0

Initial guess for the parameters

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

experiments

Experiments to evaluate the fitness, by default None which means all experiments in the manager

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

includes

Parameters to include in the calibration, by default None which means all parameters

TYPE: List[str | CalibrationKey] DEFAULT: None

include_additions

Additional parameters to include in the calibration, by default None

TYPE: List[str | CalibrationKey] DEFAULT: None

excludes

Parameters to exclude from the calibration, by default None

TYPE: List[str | CalibrationKey] DEFAULT: None

experiment_specific_parameters

Optimization parameters that are specific to each experiment, by default None

TYPE: List[str] DEFAULT: None

bounds

Bounds for the parameters, by default None

TYPE: Dict[str | CalibrationKey, Tuple[float, float]] DEFAULT: None

stds

Standard deviations for the parameters, by default None

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

lognormal_parameters

Parameters to be distributed in the lognormal space

TYPE: List[str | CalibrationKey] DEFAULT: None

RETURNS DESCRIPTION
Tuple[List[str | CalibrationKey], Dict, Dict, Dict]

The keys, initial values, bounds, and standard deviations of the parameters

ContactModel

Bases: ModelBase

Contact manager for the micromechanical model.

plotContactYieldSurface

plotContactYieldSurface(
    xscale: float = 1.0,
    yscale: float = 1.0,
    *,
    type: Literal["contour", "surface", "trisurf", "wireframe"] = "contour",
    experiments: ExperimentsType | None = None,
    simulate_experiment_kwargs: dict | None = None,
    xmin: float | None = None,
    xmax: float | None = None,
    xnum: int = 500,
    ymin: float | None = None,
    ymax: float | None = None,
    ynum: int = 500,
    relative: bool = False,
    no_contours_error: Literal["ignore", "warn", "raise"] = "warn",
    plot_force_state: bool = False,
    force_state_scatter_kwargs: dict | None = None,
    force_state_line_kwargs: dict | None = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    label: str = "Step: {step}, idx: {idx}",
    data: Union[SVExporter, "YieldFunction", None] = None,
    data_get_kwargs: Dict[str, Any] | None = None,
    on: Plottable | None = None,
    same_axes: bool = False,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot yield surface for the contact law.

Notes

The following placeholders are supported for arguments label, kwargs, and line_kwargs:

  • material parameters (model.parameters)
  • {step} for the step index
  • {idx}, {beta} and {gamma} for contact variables
PARAMETER DESCRIPTION
xscale

Scale for x-axis, by default 1.0.

TYPE: float DEFAULT: 1.0

yscale

Scale for y-axis, by default 1.0.

TYPE: float DEFAULT: 1.0

type

Type of the plot, by default "contour"

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

xmin

Minimum x value, by default None which means the minimum value in the data

TYPE: float DEFAULT: None

xmax

Maximum x value, by default None which means the maximum value in the data

TYPE: float DEFAULT: None

xnum

Number of x values, by default 500

TYPE: int DEFAULT: 500

ymin

Minimum y value, by default None which means the minimum value in the data

TYPE: float DEFAULT: None

ymax

Maximum y value, by default None which means the maximum value in the data

TYPE: float DEFAULT: None

ynum

Number of y values, by default 500

TYPE: int DEFAULT: 500

relative

Whether the minimum and maximum values are relative to the data, by default False

TYPE: bool DEFAULT: False

no_contours_error

Whether to raise an error if no contours are found, by default "warn"

TYPE: Literal['ignore', 'warn', 'raise'] DEFAULT: 'warn'

plot_force_state

Whether to plot the current force state with scatter, by default False

TYPE: bool DEFAULT: False

force_state_scatter_kwargs

Keyword arguments for plotting the force state scatter, by default color and edgecolors are set to the color of the corresponding yield surface

TYPE: dict DEFAULT: None

force_state_line_kwargs

Keyword arguments for plotting the force state line, by default None

TYPE: dict DEFAULT: None

phase

An integer or a slice indicates index of the phase.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

step

An integer or a slice indicates index of the step.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

idx

An integer or a slice indicates index of the integration point for contact variables.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

label

Format string for the label in the legend, by default "Step: {step}, idx: {idx}"

TYPE: str DEFAULT: 'Step: {step}, idx: {idx}'

data

State variables to plot, if not specified, the simulation will be run, by default None

TYPE: SVExporter | 'YieldFunction' DEFAULT: None

data_get_kwargs

Extra keyword arguments for the get method of the data object, by default None

TYPE: Dict[str, Any] DEFAULT: None

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

same_axes

Whether to use the same axes for all lines, by default False

TYPE: bool DEFAULT: False

ncols

Number of columns in the figure grid, by default 2

TYPE: int DEFAULT: 2

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

line_kwargs

Line-specific keyword arguments, by default None

TYPE: Iterable[Dict[str, Any]] 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

setPlasticMethod

setPlasticMethod(method: Literal['Explicit', 'CPA', 'CPPM', 'RungeKutta'])

Set the plastic method for all contacts.

IOModel

Bases: IntegrationModel, LoadModel, MaterialModel, ContactModel

Simulation manager for the micromechanical model.

io property

Get the IO object for the manager.

__hash__

__hash__() -> int

Hash the model.

fromDict classmethod

fromDict(d: dict, **kwargs) -> Self

Load the model from a dictionary.

fromJson classmethod

fromJson(
    *, string: str | None = None, path: str | None = None, **kwargs
) -> Self

Load the model from a JSON file or a JSON string.

fromToml classmethod

fromToml(
    *, string: str | None = None, path: str | None = None, **kwargs
) -> Self

Load the model from a TOML file or a TOML string.

fromYaml classmethod

fromYaml(
    *, string: str | None = None, path: str | None = None, **kwargs
) -> Self

Load the model from a YAML file or a YAML string.

toDict

toDict(**kwargs) -> dict

Save the model to a dictionary.

toJson

toJson(path: str | None = None, **kwargs) -> str | None

Save the model to a JSON file.

toToml

toToml(path: str | None = None, **kwargs) -> str | None

Save the model to a TOML file.

toYaml

toYaml(path: str | None = None, **kwargs) -> str | None

Save the model to a YAML file.

IntegrationModel

Bases: ModelBase

Integration manager for the micromechanical model.

argbeta

argbeta(
    *, unit: Literal["rad", "deg"] = "deg", lb: float = 0.0, ub: float = 180.0
) -> ndarray

The indices of the azimuthal angles of the integration points in the y-z plane.

PARAMETER DESCRIPTION
unit

The unit of the angles, by default "deg"

TYPE: str DEFAULT: 'deg'

lb

The lower bound of the angles, by default 0.0

TYPE: float DEFAULT: 0.0

ub

The upper bound of the angles, by default 180.0

TYPE: float DEFAULT: 180.0

arggamma

arggamma(
    *, unit: Literal["rad", "deg"] = "deg", lb: float = 0.0, ub: float = 180.0
) -> ndarray

The indices of the azimuthal angles of the integration points x-axis.

PARAMETER DESCRIPTION
unit

The unit of the angles, by default "deg"

TYPE: str DEFAULT: 'deg'

lb

The lower bound of the angles, by default 0.0

TYPE: float DEFAULT: 0.0

ub

The upper bound of the angles, by default 180.0

TYPE: float DEFAULT: 180.0

beta

beta(
    *,
    unit: Literal["rad", "deg"] = "deg",
    lb: float = 0.0,
    ub: float = 180.0,
    func: Callable = None
) -> ndarray

The azimuthal angles of the integration points in the y-z plane, an array of shape (n,).

PARAMETER DESCRIPTION
unit

The unit of the angles, by default "deg"

TYPE: str DEFAULT: 'deg'

lb

The lower bound of the angles, by default 0.0

TYPE: float DEFAULT: 0.0

ub

The upper bound of the angles, by default 180.0

TYPE: float DEFAULT: 180.0

func

The function to apply to the angles, by default None

TYPE: Callable DEFAULT: None

gamma

gamma(
    *,
    unit: Literal["rad", "deg"] = "deg",
    lb: float = 0.0,
    ub: float = 180.0,
    func: Callable = None
) -> ndarray

The azimuthal angles of the integration points x-axis, an array of shape (n,).

PARAMETER DESCRIPTION
unit

The unit of the angles, by default "deg"

TYPE: str DEFAULT: 'deg'

lb

The lower bound of the angles, by default 0.0

TYPE: float DEFAULT: 0.0

ub

The upper bound of the angles, by default 180.0

TYPE: float DEFAULT: 180.0

func

The function to apply to the angles, by default None

TYPE: Callable DEFAULT: None

indexOf

indexOf(
    *,
    beta: float | ndarray | Iterable[float] = None,
    gamma: float | ndarray | Iterable[float] = None,
    beta_apply: Callable = None,
    gamma_apply: Callable = None,
    union: bool = False,
    tol: float = 0.5,
    unit: Literal["rad", "deg"] = "deg",
    sort: (
        Literal["beta", "gamma", "idx"] | List[Literal["beta", "gamma"]]
    ) = None,
    drop_duplicates: bool = False
) -> ndarray

The contact indices for the given beta and gamma.

PARAMETER DESCRIPTION
beta

The angle between the projection of the azimuth on the YZ plane and the Y axis

TYPE: float | ndarray | Iterable[float] DEFAULT: None

gamma

The angle between the azimuth and the X axis

TYPE: float | ndarray | Iterable[float] DEFAULT: None

beta_apply

The function to apply to the beta angles, by default None

TYPE: Callable DEFAULT: None

gamma_apply

The function to apply to the gamma angles, by default None

TYPE: Callable DEFAULT: None

union

If true, return the union of beta and gamma indices, else return the intersection, by default False

TYPE: bool DEFAULT: False

tol

The tolerance for the comparison of the angles, by default 0.5

TYPE: float DEFAULT: 0.5

unit

The unit of the angles, by default "deg"

TYPE: str DEFAULT: 'deg'

sort

Sort the indices by beta, gamma or idx, by default None

TYPE: str | List[str] DEFAULT: None

drop_duplicates

Drop the duplicated beta and (or) gamma, by default False

TYPE: bool DEFAULT: False

integrationplot

integrationplot(
    *, ax: Union["MplAxes3D", None] = None, **kwargs
) -> "MplAxes3D"

Plot the integration points.

loadIntegrationPoints

loadIntegrationPoints(data: ndarray, full: bool = False)

Load integration points.

setAnisotropicParameters

setAnisotropicParameters(
    type: AvailableFabricTypes = "chang1990-ext",
    evolution: AvailableFabricEvolutionTypes = "li2012",
    coefs: Dict[str, float] = None,
    **kwargs
)

Set the anisotropic parameters.

PARAMETER DESCRIPTION
type

The type of the anisotropic parameter.

TYPE: AvailableFabricTypes DEFAULT: 'chang1990-ext'

evolution

The evolution type of the anisotropic parameter.

TYPE: AvailableFabricEvolutionTypes DEFAULT: 'li2012'

coefs

The coefficients of the anisotropic parameter.

TYPE: Dict[str, float] DEFAULT: None

kwargs

More coefficients of the anisotropic parameter.

DEFAULT: {}

setBazantOh37

setBazantOh37(full: bool = False)

Set the BazantOh37 integration points.

PARAMETER DESCRIPTION
full

Full 37*2 integration points.

TYPE: bool DEFAULT: False

setBazantOh61

setBazantOh61(full: bool = False)

Set the BazantOh61 integration points.

PARAMETER DESCRIPTION
full

Full 61*2 integration points.

TYPE: bool DEFAULT: False

setFliegeMaier100

setFliegeMaier100()

Set the FliegeMaier100 integration points.

setFliegeMaier121

setFliegeMaier121()

Set the FliegeMaier121 integration points.

setFliegeMaier144

setFliegeMaier144()

Set the FliegeMaier144 integration points.

setFliegeMaier16

setFliegeMaier16()

Set the FliegeMaier16 integration points.

setFliegeMaier169

setFliegeMaier169()

Set the FliegeMaier169 integration points.

setFliegeMaier196

setFliegeMaier196()

Set the FliegeMaier196 integration points.

setFliegeMaier225

setFliegeMaier225()

Set the FliegeMaier225 integration points.

setFliegeMaier25

setFliegeMaier25()

Set the FliegeMaier25 integration points.

setFliegeMaier256

setFliegeMaier256()

Set the FliegeMaier256 integration points.

setFliegeMaier289

setFliegeMaier289()

Set the FliegeMaier289 integration points.

setFliegeMaier324

setFliegeMaier324()

Set the FliegeMaier324 integration points.

setFliegeMaier36

setFliegeMaier36()

Set the FliegeMaier36 integration points.

setFliegeMaier361

setFliegeMaier361()

Set the FliegeMaier361 integration points.

setFliegeMaier4

setFliegeMaier4()

Set the FliegeMaier4 integration points.

setFliegeMaier400

setFliegeMaier400()

Set the FliegeMaier400 integration points.

setFliegeMaier441

setFliegeMaier441()

Set the FliegeMaier441 integration points.

setFliegeMaier484

setFliegeMaier484()

Set the FliegeMaier484 integration points.

setFliegeMaier49

setFliegeMaier49()

Set the FliegeMaier49 integration points.

setFliegeMaier529

setFliegeMaier529()

Set the FliegeMaier529 integration points.

setFliegeMaier576

setFliegeMaier576()

Set the FliegeMaier576 integration points.

setFliegeMaier625

setFliegeMaier625()

Set the FliegeMaier625 integration points.

setFliegeMaier64

setFliegeMaier64()

Set the FliegeMaier64 integration points.

setFliegeMaier676

setFliegeMaier676()

Set the FliegeMaier676 integration points.

setFliegeMaier729

setFliegeMaier729()

Set the FliegeMaier729 integration points.

setFliegeMaier784

setFliegeMaier784()

Set the FliegeMaier784 integration points.

setFliegeMaier81

setFliegeMaier81()

Set the FliegeMaier81 integration points.

setFliegeMaier841

setFliegeMaier841()

Set the FliegeMaier841 integration points.

setFliegeMaier9

setFliegeMaier9()

Set the FliegeMaier9 integration points.

setFliegeMaier900

setFliegeMaier900()

Set the FliegeMaier900 integration points.

setIntegrationParameters

setIntegrationParameters(npv: float, radius: float)

Set the parameters.

PARAMETER DESCRIPTION
npv

number of contacts per unit volume

TYPE: float

radius

particle radius

TYPE: float

setIntegrationType

setIntegrationType(type: str, full: bool = False)

Set the integration type.

PARAMETER DESCRIPTION
type

The integration type.

TYPE: str

full

Full integration points for symmetric types.

TYPE: bool DEFAULT: False

setLebedev110

setLebedev110()

Set the Lebedev110 integration points.

setLebedev1202

setLebedev1202()

Set the Lebedev1202 integration points.

setLebedev14

setLebedev14()

Set the Lebedev14 integration points.

setLebedev1454

setLebedev1454()

Set the Lebedev1454 integration points.

setLebedev146

setLebedev146()

Set the Lebedev146 integration points.

setLebedev170

setLebedev170()

Set the Lebedev170 integration points.

setLebedev1730

setLebedev1730()

Set the Lebedev1730 integration points.

setLebedev194

setLebedev194()

Set the Lebedev194 integration points.

setLebedev2030

setLebedev2030()

Set the Lebedev2030 integration points.

setLebedev230

setLebedev230()

Set the Lebedev230 integration points.

setLebedev2354

setLebedev2354()

Set the Lebedev2354 integration points.

setLebedev26

setLebedev26()

Set the Lebedev26 integration points.

setLebedev266

setLebedev266()

Set the Lebedev266 integration points.

setLebedev2702

setLebedev2702()

Set the Lebedev2702 integration points.

setLebedev302

setLebedev302()

Set the Lebedev302 integration points.

setLebedev3074

setLebedev3074()

Set the Lebedev3074 integration points.

setLebedev3470

setLebedev3470()

Set the Lebedev3470 integration points.

setLebedev350

setLebedev350()

Set the Lebedev350 integration points.

setLebedev38

setLebedev38()

Set the Lebedev38 integration points.

setLebedev3890

setLebedev3890()

Set the Lebedev3890 integration points.

setLebedev4334

setLebedev4334()

Set the Lebedev4334 integration points.

setLebedev434

setLebedev434()

Set the Lebedev434 integration points.

setLebedev4802

setLebedev4802()

Set the Lebedev4802 integration points.

setLebedev50

setLebedev50()

Set the Lebedev50 integration points.

setLebedev5294

setLebedev5294()

Set the Lebedev5294 integration points.

setLebedev5810

setLebedev5810()

Set the Lebedev5810 integration points.

setLebedev590

setLebedev590()

Set the Lebedev590 integration points.

setLebedev6

setLebedev6()

Set the Lebedev6 integration points.

setLebedev74

setLebedev74()

Set the Lebedev74 integration points.

setLebedev770

setLebedev770()

Set the Lebedev770 integration points.

setLebedev86

setLebedev86()

Set the Lebedev86 integration points.

setLebedev974

setLebedev974()

Set the Lebedev974 integration points.

setNPVFromNormalizedPackingDensity

setNPVFromNormalizedPackingDensity(rho: float)

Set the number of contacts per unit volume from the normalized packing density with the following equation:

\[ \rho=\frac{Nl^3}{V}=\frac{8Nr^3}{V} \Longrightarrow \frac{N}{V}=\frac{\rho}{8r^3} \]
PARAMETER DESCRIPTION
rho

normalized packing density

TYPE: float

setNPVFromVoidRatio

setNPVFromVoidRatio(e: float)

Set the number of contacts per unit volume from the void ratio with the following equation:

\[ \frac{N}{V}=\frac{3(13.28-8e)}{4\pi r^3(1+e)} \]
PARAMETER DESCRIPTION
e

void ratio

TYPE: float

LoadModel

Bases: ModelBase

Load manager for the micromechanical model.

addConfinementPhase

addConfinementPhase(eps1: float, steps: int)

Add a confinement load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

eps1

Maximum strain.

TYPE: float

addConstantStressRatioPhase

addConstantStressRatioPhase(
    sig3_min: float, sig3_max: float, eta: float, steps: int, axis: int = 1
)

Add a constant stress ratio load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

sig3_min

Minimum value of minimum principal stress.

TYPE: float

sig3_max

Maximum value of minimum principal stress.

TYPE: float

eta

Constant stress ratio.

TYPE: float

axis

Loading axis, by default 1

TYPE: int DEFAULT: 1

RETURNS DESCRIPTION
LoadPhase

The load phase.

addDrainedTriaxialPhase

addDrainedTriaxialPhase(sigc: float, eps1: float, steps: int, axis: int = 1)

Add a drained triaxial load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

sigc

Confined stress.

TYPE: float

eps1

Maximum strain.

TYPE: float

axis

Loading axis, by default 1

TYPE: int DEFAULT: 1

RETURNS DESCRIPTION
LoadPhase

The load phase.

addIsotropicPhase

addIsotropicPhase(sigc: float, steps: int)

Add an isotropic load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

sigc

Confined stress.

TYPE: float

RETURNS DESCRIPTION
LoadPhase

The load phase.

addLoadPhase

addLoadPhase(phase: LoadPhase)

Add a load phase.

PARAMETER DESCRIPTION
phase

The load phase.

TYPE: LoadPhase

addTrueTriaxialPhase

addTrueTriaxialPhase(
    sig3: float,
    b: float,
    eps1: float,
    steps: int,
    axis1: int = 1,
    axis2: int = 2,
)

Add a true triaxial load phase.

PARAMETER DESCRIPTION
sig3

Minimum principal stress.

TYPE: float

b

Intermediate stress ratio.

TYPE: float

eps1

Maximum strain.

TYPE: float

steps

Number of steps.

TYPE: int

axis1

Major axis, by default 1

TYPE: int DEFAULT: 1

axis2

Intermediate axis, by default 2

TYPE: int DEFAULT: 2

RETURNS DESCRIPTION
LoadPhase

The load phase.

addTrueTriaxialWithConstantShearPhase

addTrueTriaxialWithConstantShearPhase(
    p: float, b: float, steps: int, axis1: int = 1, axis2: int = 2
)

Add a true triaxial load phase.

PARAMETER DESCRIPTION
p

Mean stress.

TYPE: float

b

Intermediate principal stress.

TYPE: float

steps

Number of steps.

TYPE: int

axis1

Major axis, by default 1

TYPE: int DEFAULT: 1

axis2

Intermediate axis, by default 2

TYPE: int DEFAULT: 2

RETURNS DESCRIPTION
LoadPhase

The load phase.

addUndrainedTriaxialPhase

addUndrainedTriaxialPhase(
    eps1: float, steps: int, axis: int = 1, no_epsv: bool = False
)

Add an undrained triaxial load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

eps1

Maximum strain.

TYPE: float

axis

Loading axis, by default 1

TYPE: int DEFAULT: 1

no_epsv

Whether to control the intermediate principal stress without generating volumetric strain, this is useful when the material fabric is non-coaxial with the principal stress, by default False

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
LoadPhase

The load phase.

addUndrainedTriaxialWithoutShearPhase

addUndrainedTriaxialWithoutShearPhase(
    eps1: float, steps: int, axis: int = 1, no_epsv: bool = False
)

Add an undrained triaxial load phase without controlling the shear strain.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

eps1

Maximum strain.

TYPE: float

axis

Loading axis, by default 1

TYPE: int DEFAULT: 1

no_epsv

Whether to control the intermediate principal stress without generating volumetric strain, this is useful when the material fabric is non-coaxial with the principal stress, by default False

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
LoadPhase

The load phase.

addUndrainedTrueTriaxialPhase

addUndrainedTrueTriaxialPhase(
    eps1: float,
    b: float,
    steps: int,
    axis1: int = 1,
    axis2: int = 2,
    no_epsv: bool = True,
) -> LoadPhase

Add an undrained true triaxial load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

eps1

Maximum strain.

TYPE: float

b

Intermediate stress ratio.

TYPE: float

axis1

Major axis, by default 1

TYPE: int DEFAULT: 1

axis2

Intermediate axis, by default 2

TYPE: int DEFAULT: 2

no_epsv

Whether to control the intermediate principal stress without generating volumetric strain, this is useful when the material fabric is non-coaxial with the principal stress, by default True

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
LoadPhase

The load phase.

addUndrainedTrueTriaxialWithAxialStrainPhase

addUndrainedTrueTriaxialWithAxialStrainPhase(
    epsa: float,
    b: float,
    steps: int,
    axis1: int = 1,
    axis2: int = 2,
    no_epsv: bool = True,
) -> LoadPhase

Add an undrained true triaxial load phase with axial strain control.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

epsa

Axial strain.

TYPE: float

b

Intermediate stress ratio.

TYPE: float

axis1

Major axis, by default 1

TYPE: int DEFAULT: 1

axis2

Intermediate axis, by default 2

TYPE: int DEFAULT: 2

no_epsv

Whether to control the intermediate principal stress without generating volumetric strain, this is useful when the material fabric is non-coaxial with the principal stress, by default True

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
LoadPhase

The load phase.

MaterialModel

Bases: ModelBase

Material manager for the micromechanical model.

setMaterialAnisotropicParameters

setMaterialAnisotropicParameters(
    key: str,
    type: AvailableFabricTypes = "chang1990-ext",
    evolution: AvailableFabricEvolutionTypes = "li2012",
    coefs: Dict[str, float] = None,
    **kwargs
)

Set the anisotropic parameters for a material property.

PARAMETER DESCRIPTION
key

The name of the material property.

TYPE: str

type

The type of the anisotropic parameter.

TYPE: AvailableFabricTypes DEFAULT: 'chang1990-ext'

evolution

The evolution type of the anisotropic parameter.

TYPE: AvailableFabricEvolutionTypes DEFAULT: 'li2012'

coefs

The coefficients of the anisotropic parameter.

TYPE: Dict[str, float] DEFAULT: None

kwargs

More coefficients of the anisotropic parameter.

DEFAULT: {}

Model

Bases: VisualizationModel

A micromechanical model manager.

Notes

The main calculation of the micromechanical model is done in the model attribute, which is an instance of the pure Python/numba/C++ micromechanical model, depending on the backend. Setting the following environment variables to change the backend:

  • MICROMECHANICAL_BACKEND=cpp: use the C++ backend
  • MICROMECHANICAL_BACKEND=python;NUMBA_DISABLE_JIT=1: use the pure Python backend
  • MICROMECHANICAL_BACKEND=python;NUMBA_DISABLE_JIT=0: use the numba backend

For the cpp and numba backends, the environment variable MICROMECHANICAL_PRECISION can be set to single or double to change the precision, the default is double

Examples:

Create the micromechanical model object:

>>> from micromechanical import Model
>>> model = Model("CH-OSIMSAND")

Set up the loading phases:

>>> model.addIsotropicPhase(sigc=-100, steps=100)
>>> model.addDrainedTriaxialPhase(sigc=-100, eps1=-0.3, steps=100)

Set up the plastic method for the local contact law:

>>> model.setPlasticMethod("CPA")  # default is "CPA"

Set up integration points:

>>> model.setIntegrationParameters(npv=1e9, radius=0.65e-3)
>>> model.setAnisotropicParameters(type="chang1990-ext", evolution="wan2004", chi=0)

Set up material parameters:

>>> model.setParameters(phi=30)

Evaluate the model:

>>> sv = model.run()
Running CH-OSIMSAND model ...
Finished in ... seconds.

sv is a micromechanical.SVExporter object, which can be used to get the state variables, plot the results, and export the results to a file.

>>> sv.to_csv("data.csv")
Saving state variables to DataFrame
>>> p, q, epsa, epsv = sv.get("-p"), sv.q, 100 * sv["epsa"], sv["100 * epsv"]  # the tensile stress is positive
>>> model.plot("-p", "q", data=sv)  # if data is omitted, model.run() will be called
<Figure size ... with 1 Axes>

__init__

__init__(
    *model_types: Union[
        MicromechanicalBase,
        type,
        str | PathLike,
        AvailableModels,
        AvailableMicromechanicalModels,
        AvailableContactModels,
    ],
    args: tuple = (),
    kwargs: dict = None,
    no_stop: bool = False,
    backend: Literal["python", "cpp"] = backend,
    **options
)

Constructor for the micromechanical model manager base class.

PARAMETER DESCRIPTION
model_types

The micromechanical model to use. If no positional arguments are provided, the model will not be initialized. If one positional argument is provided, it should be:

  • a micromechanical model object
  • a micromechanical model class
  • a string of the form model_type-contact_type

If two positional arguments are provided, they should be:

  • (model_type | model_plugin_path, contact_type | contact_plugin_path)

In C++ backend, the micromechanical model type and contact law type can be a string of the file path to the compiled shared library.

For example, the following usages are valid:

  • model = Model(ChangHicherElasticModel): use the ChangHicherElasticModel class (Python)
  • model = Model(ChangHicherElasticModel()): use the ChangHicherElasticModel object (Python)
  • model = Model("CH-Elastic"): use the CH model with the Elastic contact law
  • model = Model("CH", "Elastic"): use the CH model with the Elastic contact law
  • model = Model("CH", "elastic.dll"): use the CH model with the elastic.dll shared library (C++)
  • model = Model("changhicher.dll", "Elastic"): use the changhicher.dll shared library with the Elastic contact law (C++)
  • model = Model("changhicher.dll", "elastic.dll"): use the changhicher.dll shared library with the elastic.dll shared library (C++)

TYPE: Union[MicromechanicalBase, type, str | PathLike, AvailableModels, AvailableMicromechanicalModels, AvailableContactModels] DEFAULT: ()

args

The positional arguments for the micromechanical model if the supplied model is a class.

TYPE: tuple DEFAULT: ()

kwargs

The keyword arguments for the micromechanical model if the supplied model is a class.

TYPE: dict DEFAULT: None

no_stop

Whether to stop the calculation when an error occurs.

TYPE: bool DEFAULT: False

backend

The backend to use, default is the configured backend.

TYPE: ('python', 'cpp') DEFAULT: "python"

options

The calculation options for the micromechanical model, the contact law, or the material.

DEFAULT: {}

ModelBase

Base class for micromechanical model managers.

best_fit_strain_averaging class-attribute instance-attribute

best_fit_strain_averaging: bool = property(
    fget=lambda self: self.model.options.best_fit_strain_averaging,
    fset=lambda self, value: setattr(
        self.model.options, "best_fit_strain_averaging", value
    ),
    doc="Whether to use the best-fit strain averaging",
)

cache class-attribute instance-attribute

cache: bool = property(
    fget=lambda self: self.model.options.cache,
    fset=lambda self, value: setattr(self.model.options, "cache", value),
    doc="Whether to Cache state variables",
)

cache_precision class-attribute instance-attribute

cache_precision: int = property(
    fget=lambda self: self.model.options.cache_precision,
    fset=lambda self, value: setattr(
        self.model.options, "cache_precision", value
    ),
    doc="Cache state variables precision",
)

caches class-attribute instance-attribute

caches: LRUCache = cachetools.LRUCache(maxsize=128)

The caches.

calculationOptions property

calculationOptions: Dict[str, Any]

The calculation options.

check_stiffness_matrix_symmetry class-attribute instance-attribute

check_stiffness_matrix_symmetry: bool = property(
    fget=lambda self: self.model.options.check_stiffness_matrix_symmetry,
    fset=lambda self, value: setattr(
        self.model.options, "check_stiffness_matrix_symmetry", value
    ),
    doc="Whether to check the symmetry of the stiffness matrix",
)

contact property writable

The contact law.

contact_associated_flow_rule class-attribute instance-attribute

contact_associated_flow_rule: bool = property(
    fget=lambda self: self.model.options.contact_associated_flow_rule,
    fset=lambda self, value: setattr(
        self.model.options, "contact_associated_flow_rule", value
    ),
    doc="Whether to use associated flow rule for contact law",
)

contact_check_convergence class-attribute instance-attribute

contact_check_convergence: bool = property(
    fget=lambda self: self.model.options.contact_check_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "contact_check_convergence", value
    ),
    doc="Check the convergence of contact",
)

contact_check_plastic_multiplier class-attribute instance-attribute

contact_check_plastic_multiplier: bool = property(
    fget=lambda self: self.model.options.contact_check_plastic_multiplier,
    fset=lambda self, value: setattr(
        self.model.options, "contact_check_plastic_multiplier", value
    ),
    doc="Whether to check the sign of plastic multiplier",
)

contact_default_potential_function_derivative class-attribute instance-attribute

contact_default_potential_function_derivative: bool = property(
    fget=lambda self: self.model.options.contact_default_potential_function_derivative,
    fset=lambda self, value: setattr(
        self.model.options,
        "contact_default_potential_function_derivative",
        value,
    ),
    doc="Whether to use the default potential function derivative for contact laws",
)

contact_default_yield_function_derivative class-attribute instance-attribute

contact_default_yield_function_derivative: bool = property(
    fget=lambda self: self.model.options.contact_default_yield_function_derivative,
    fset=lambda self, value: setattr(
        self.model.options, "contact_default_yield_function_derivative", value
    ),
    doc="Whether to use the default yield function derivative for contact laws",
)

contact_ensure_force_state_on_yield_surface class-attribute instance-attribute

contact_ensure_force_state_on_yield_surface: bool = property(
    fget=lambda self: self.model.options.contact_ensure_force_state_on_yield_surface,
    fset=lambda self, value: setattr(
        self.model.options, "contact_ensure_force_state_on_yield_surface", value
    ),
    doc="Whether to ensure the force state is on the yield surface",
)

contact_max_iterations class-attribute instance-attribute

contact_max_iterations: int = property(
    fget=lambda self: self.model.options.contact_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options, "contact_max_iterations", value
    ),
    doc="Maximum number of iterations, only for CPA or CPPM",
)

contact_min_normal_force class-attribute instance-attribute

contact_min_normal_force: float = property(
    fget=lambda self: self.model.options.contact_min_normal_force,
    fset=lambda self, value: setattr(
        self.model.options, "contact_min_normal_force", value
    ),
    doc="The minimum normal force",
)

contact_plastic_method_multiplier class-attribute instance-attribute

contact_plastic_method_multiplier: float = property(
    fget=lambda self: self.model.options.contact_plastic_method_multiplier,
    fset=lambda self, value: setattr(
        self.model.options, "contact_plastic_method_multiplier", value
    ),
    doc="Multiplier for the contact plastic method",
)

contact_sanisand_constant_hardening_parameter class-attribute instance-attribute

contact_sanisand_constant_hardening_parameter: bool = property(
    fget=lambda self: self.model.options.contact_sanisand_constant_hardening_parameter,
    fset=lambda self, value: setattr(
        self.model.options,
        "contact_sanisand_constant_hardening_parameter",
        value,
    ),
    doc="Whether to use constant hardening parameter h for the SANISAND contact law",
)

contact_sanisand_maintain_yield_surface class-attribute instance-attribute

contact_sanisand_maintain_yield_surface: bool = property(
    fget=lambda self: self.model.options.contact_sanisand_maintain_yield_surface,
    fset=lambda self, value: setattr(
        self.model.options, "contact_sanisand_maintain_yield_surface", value
    ),
    doc="Whether to maintain yield surface for the SANISAND contact law",
)

contact_save_stiffness class-attribute instance-attribute

contact_save_stiffness: bool = property(
    fget=lambda self: self.model.options.contact_save_stiffness,
    fset=lambda self, value: setattr(
        self.model.options, "contact_save_stiffness", value
    ),
    doc="Whether to save contact stiffness in the state variables",
)

contact_simsand_hardening_use_plastic_displacement class-attribute instance-attribute

contact_simsand_hardening_use_plastic_displacement: bool = property(
    fget=lambda self: self.model.options.contact_simsand_hardening_use_plastic_displacement,
    fset=lambda self, value: setattr(
        self.model.options,
        "contact_simsand_hardening_use_plastic_displacement",
        value,
    ),
    doc="Whether to use plastic displacement in OSIMSAND/SIMSAND contact laws in the hardening law",
)

contact_simsand_use_plastic_displacement class-attribute instance-attribute

contact_simsand_use_plastic_displacement: bool = property(
    fget=lambda self: self.model.options.contact_simsand_use_plastic_displacement,
    fset=lambda self, value: setattr(
        self.model.options, "contact_simsand_use_plastic_displacement", value
    ),
    doc="Whether to use plastic displacement in OSIMSAND/SIMSAND contact laws",
)

contact_substepping class-attribute instance-attribute

contact_substepping: float = property(
    fget=lambda self: self.model.options.contact_substepping,
    fset=lambda self, value: setattr(
        self.model.options, "contact_substepping", value
    ),
    doc="Whether to use substepping strategy for the contact law",
)

contact_substepping_max_increment class-attribute instance-attribute

contact_substepping_max_increment: float = property(
    fget=lambda self: self.model.options.contact_substepping_max_increment,
    fset=lambda self, value: setattr(
        self.model.options, "contact_substepping_max_increment", value
    ),
    doc="Maximum stress ratio in one increment",
)

contact_substepping_separate_normal_shear_displacements class-attribute instance-attribute

contact_substepping_separate_normal_shear_displacements: bool = property(
    fget=lambda self: self.model.options.contact_substepping_separate_normal_shear_displacements,
    fset=lambda self, value: setattr(
        self.model.options,
        "contact_substepping_separate_normal_shear_displacements",
        value,
    ),
    doc="Whether to separate normal and shear displacement in contact substepping",
)

contact_tensile_stiffness_ratio class-attribute instance-attribute

contact_tensile_stiffness_ratio: float = property(
    fget=lambda self: self.model.options.contact_tensile_stiffness_ratio,
    fset=lambda self, value: setattr(
        self.model.options, "contact_tensile_stiffness_ratio", value
    ),
    doc="Ratio of tensile stiffness to compressive stiffness",
)

contact_tolerance class-attribute instance-attribute

contact_tolerance: float = property(
    fget=lambda self: self.model.options.contact_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "contact_tolerance", value
    ),
    doc="Contact tolerance",
)

dataset_dirs class-attribute instance-attribute

dataset_dirs: List[Path] = list(
    set(
        [
            (Path(d).absolute())
            for d in (
                config.dataset_dirs + [Path(__file__).parents[1] / "datasets"]
            )
        ]
    )
)

directories to search for datasets

debug class-attribute instance-attribute

debug: bool = property(
    fget=lambda self: self.model.options.debug,
    fset=lambda self, value: setattr(self.model.options, "debug", value),
    doc="Debug mode",
)

debugVariable property

debugVariable

The debug information.

disp_steps class-attribute instance-attribute

disp_steps: int = property(
    fget=lambda self: self.model.options.disp_steps,
    fset=lambda self, value: setattr(self.model.options, "disp_steps", value),
    doc="Display the information per steps",
)

elastic_fabric_anisotropy_scale class-attribute instance-attribute

elastic_fabric_anisotropy_scale: float = property(
    fget=lambda self: self.model.options.elastic_fabric_anisotropy_scale,
    fset=lambda self, value: setattr(
        self.model.options, "elastic_fabric_anisotropy_scale", value
    ),
    doc="Scale factor for fabric anisotropy in elastic stiffness",
)

elastic_stiffness_stress_dependence class-attribute instance-attribute

elastic_stiffness_stress_dependence: bool = property(
    fget=lambda self: self.model.options.elastic_stiffness_stress_dependence,
    fset=lambda self, value: setattr(
        self.model.options, "elastic_stiffness_stress_dependence", value
    ),
    doc="Whether to use the stress dependent elastic stiffness",
)

elastic_stiffness_stress_dependence_min_mean_stress_ratio class-attribute instance-attribute

elastic_stiffness_stress_dependence_min_mean_stress_ratio: float = property(
    fget=lambda self: self.model.options.elastic_stiffness_stress_dependence_min_mean_stress_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastic_stiffness_stress_dependence_min_mean_stress_ratio",
        value,
    ),
    doc="Minimum mean stress ratio for stress dependent elastic stiffness, below which the elastic stiffness does not depend on the stress",
)

elastic_stiffness_stress_dependence_use_anisotropic_mean_stress class-attribute instance-attribute

elastic_stiffness_stress_dependence_use_anisotropic_mean_stress: bool = (
    property(
        fget=lambda self: self.model.options.elastic_stiffness_stress_dependence_use_anisotropic_mean_stress,
        fset=lambda self, value: setattr(
            self.model.options,
            "elastic_stiffness_stress_dependence_use_anisotropic_mean_stress",
            value,
        ),
        doc="Whether to use anisotropic mean stress in stress dependent elastic stiffness",
    )
)

elastic_stiffness_void_ratio_dependence class-attribute instance-attribute

elastic_stiffness_void_ratio_dependence: bool = property(
    fget=lambda self: self.model.options.elastic_stiffness_void_ratio_dependence,
    fset=lambda self, value: setattr(
        self.model.options, "elastic_stiffness_void_ratio_dependence", value
    ),
    doc="Whether to use the void ratio dependent elastic stiffness",
)

elastic_stiffness_void_ratio_dependence_initial class-attribute instance-attribute

elastic_stiffness_void_ratio_dependence_initial: bool = property(
    fget=lambda self: self.model.options.elastic_stiffness_void_ratio_dependence_initial,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastic_stiffness_void_ratio_dependence_initial",
        value,
    ),
    doc="Whether to use the initial void ratio for void ratio dependent elastic stiffness",
)

elastoplastic_associated_flow_rule class-attribute instance-attribute

elastoplastic_associated_flow_rule: bool = property(
    fget=lambda self: self.model.options.elastoplastic_associated_flow_rule,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_associated_flow_rule", value
    ),
    doc="Whether to use associated flow rule for plastic correction",
)

elastoplastic_cache_state_variables class-attribute instance-attribute

elastoplastic_cache_state_variables: bool = property(
    fget=lambda self: self.model.options.elastoplastic_cache_state_variables,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_cache_state_variables", value
    ),
    doc="Whether to cache state variables for elastoplastic models",
)

elastoplastic_check_convergence class-attribute instance-attribute

elastoplastic_check_convergence: bool = property(
    fget=lambda self: self.model.options.elastoplastic_check_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_check_convergence", value
    ),
    doc="Whether to check the converge for plastic correction",
)

elastoplastic_check_stiffness_matrix_non_singularity class-attribute instance-attribute

elastoplastic_check_stiffness_matrix_non_singularity: bool = property(
    fget=lambda self: self.model.options.elastoplastic_check_stiffness_matrix_non_singularity,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_check_stiffness_matrix_non_singularity",
        value,
    ),
    doc="Whether to check the non-singularity of the elastoplastic stiffness matrix",
)

elastoplastic_check_stiffness_matrix_positive_definite class-attribute instance-attribute

elastoplastic_check_stiffness_matrix_positive_definite: bool = property(
    fget=lambda self: self.model.options.elastoplastic_check_stiffness_matrix_positive_definite,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_check_stiffness_matrix_positive_definite",
        value,
    ),
    doc="Whether to check the positive definiteness of the elastoplastic stiffness matrix",
)

elastoplastic_combined_stress_tensor_dilatancy_type class-attribute instance-attribute

elastoplastic_combined_stress_tensor_dilatancy_type: Literal[
    "anisotropic",
    "isotropic",
    "linear",
    "quadratic",
    "exponential",
    "potential",
] = property(
    fget=lambda self: self.model.options.elastoplastic_combined_stress_tensor_dilatancy_type,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_combined_stress_tensor_dilatancy_type",
        value,
    ),
    doc='Type of the combined stress tensor in dilatancy for elastoplastic models, "anisotropic", "isotropic", "linear", "quadratic", "exponential", or "potential"',
)

elastoplastic_combined_stress_tensor_evolution_ratio class-attribute instance-attribute

elastoplastic_combined_stress_tensor_evolution_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_combined_stress_tensor_evolution_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_combined_stress_tensor_evolution_ratio",
        value,
    ),
    doc="Ratio for the evolution of the combined stress tensor in elastoplastic models",
)

elastoplastic_combined_stress_tensor_fav_ratio class-attribute instance-attribute

elastoplastic_combined_stress_tensor_fav_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_combined_stress_tensor_fav_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_combined_stress_tensor_fav_ratio",
        value,
    ),
    doc="Ratio for the fabric anisotropy variable in the combined stress tensor for elastoplastic models",
)

elastoplastic_combined_stress_tensor_scale class-attribute instance-attribute

elastoplastic_combined_stress_tensor_scale: float = property(
    fget=lambda self: self.model.options.elastoplastic_combined_stress_tensor_scale,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_combined_stress_tensor_scale", value
    ),
    doc="Scale for effect of fabric anisotropy in the combined stress tensor for elastoplastic models",
)

elastoplastic_combined_stress_tensor_type class-attribute instance-attribute

elastoplastic_combined_stress_tensor_type: Literal[
    "anisotropic",
    "isotropic",
    "linear",
    "quadratic",
    "exponential",
    "potential",
] = property(
    fget=lambda self: self.model.options.elastoplastic_combined_stress_tensor_type,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_combined_stress_tensor_type", value
    ),
    doc='Type of the combined stress tensor for elastoplastic models, "anisotropic", "isotropic", "linear", "quadratic", "exponential", or "potential"',
)

elastoplastic_critical_state_line_shape class-attribute instance-attribute

elastoplastic_critical_state_line_shape: Literal[
    "linear", "logarithmic", "exponential"
] = property(
    fget=lambda self: self.model.options.elastoplastic_critical_state_line_shape,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_critical_state_line_shape", value
    ),
    doc="Shape of critical state line, `linear`, `logarithmic` or `exponential`",
)

elastoplastic_critical_state_line_use_anisotropic_mean_stress class-attribute instance-attribute

elastoplastic_critical_state_line_use_anisotropic_mean_stress: bool = property(
    fget=lambda self: self.model.options.elastoplastic_critical_state_line_use_anisotropic_mean_stress,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_critical_state_line_use_anisotropic_mean_stress",
        value,
    ),
    doc="Whether to use anisotropic mean stress in critical state line",
)

elastoplastic_critical_state_line_use_initial_stress_state class-attribute instance-attribute

elastoplastic_critical_state_line_use_initial_stress_state: bool = property(
    fget=lambda self: self.model.options.elastoplastic_critical_state_line_use_initial_stress_state,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_critical_state_line_use_initial_stress_state",
        value,
    ),
    doc="Whether to use the initial stress state to calculate critical state line",
)

elastoplastic_critical_stress_ratio_type class-attribute instance-attribute

elastoplastic_critical_stress_ratio_type: Literal[
    "modified-mohr-coulomb",
    "mohr-coulomb",
    "gtheta_li2002",
    "gtheta_sheng2000",
    "gtheta_argyris1974",
] = property(
    fget=lambda self: self.model.options.elastoplastic_critical_stress_ratio_type,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_critical_stress_ratio_type", value
    ),
    doc="Method to calculate critical stress ratio, `modified-mohr-coulomb`, `mohr-coulomb`, `gtheta_li2002`, `gtheta_sheng2000`, or `gtheta_argyris1974`",
)

elastoplastic_critical_stress_ratio_use_anisotropic_stress class-attribute instance-attribute

elastoplastic_critical_stress_ratio_use_anisotropic_stress: bool = property(
    fget=lambda self: self.model.options.elastoplastic_critical_stress_ratio_use_anisotropic_stress,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_critical_stress_ratio_use_anisotropic_stress",
        value,
    ),
    doc="Whether to use the anisotropic stress tensor to calculate critical stress ratio",
)

elastoplastic_critical_stress_ratio_use_initial_stress_state class-attribute instance-attribute

elastoplastic_critical_stress_ratio_use_initial_stress_state: bool = property(
    fget=lambda self: self.model.options.elastoplastic_critical_stress_ratio_use_initial_stress_state,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_critical_stress_ratio_use_initial_stress_state",
        value,
    ),
    doc="Whether to use the initial stress state to calculate critical stress ratio",
)

elastoplastic_default_potential_function_derivative class-attribute instance-attribute

elastoplastic_default_potential_function_derivative: bool = property(
    fget=lambda self: self.model.options.elastoplastic_default_potential_function_derivative,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_default_potential_function_derivative",
        value,
    ),
    doc="Whether to use the default potential function derivative for elastoplastic models",
)

elastoplastic_default_yield_function_derivative class-attribute instance-attribute

elastoplastic_default_yield_function_derivative: bool = property(
    fget=lambda self: self.model.options.elastoplastic_default_yield_function_derivative,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_default_yield_function_derivative",
        value,
    ),
    doc="Whether to use the default yield function derivative for elastoplastic models",
)

elastoplastic_density_effect_on_strength_dilatancy_type class-attribute instance-attribute

elastoplastic_density_effect_on_strength_dilatancy_type: Literal[
    "exponential", "powerlaw"
] = property(
    fget=lambda self: self.model.options.elastoplastic_density_effect_on_strength_dilatancy_type,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_density_effect_on_strength_dilatancy_type",
        value,
    ),
    doc="The type of density effect on strength and dilatancy, either 'exponential' or 'powerlaw'",
)

elastoplastic_dilatancy_exponent class-attribute instance-attribute

elastoplastic_dilatancy_exponent: float = property(
    fget=lambda self: self.model.options.elastoplastic_dilatancy_exponent,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_dilatancy_exponent", value
    ),
    doc="Exponent for the stress-dilatancy relationship when using a power-law type relationship",
)

elastoplastic_dilatancy_scale_at_low_mean_stress class-attribute instance-attribute

elastoplastic_dilatancy_scale_at_low_mean_stress: float = property(
    fget=lambda self: self.model.options.elastoplastic_dilatancy_scale_at_low_mean_stress,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_dilatancy_scale_at_low_mean_stress",
        value,
    ),
    doc="Low mean stress threshold to scale the dilatancy function",
)

elastoplastic_dilatancy_separate_friction_angle class-attribute instance-attribute

elastoplastic_dilatancy_separate_friction_angle: bool = property(
    fget=lambda self: self.model.options.elastoplastic_dilatancy_separate_friction_angle,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_dilatancy_separate_friction_angle",
        value,
    ),
    doc="Whether to use a separate friction angle for the stress-dilatancy relationship",
)

elastoplastic_ensure_stress_on_yield_surface class-attribute instance-attribute

elastoplastic_ensure_stress_on_yield_surface: bool = property(
    fget=lambda self: self.model.options.elastoplastic_ensure_stress_on_yield_surface,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_ensure_stress_on_yield_surface",
        value,
    ),
    doc="Whether to ensure the stress state is on the yield surface",
)

elastoplastic_fabric_anisotropy_variable_nonproportionality_noncoaxial class-attribute instance-attribute

elastoplastic_fabric_anisotropy_variable_nonproportionality_noncoaxial: (
    float
) = property(
    fget=lambda self: self.model.options.elastoplastic_fabric_anisotropy_variable_nonproportionality_noncoaxial,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_fabric_anisotropy_variable_nonproportionality_noncoaxial",
        value,
    ),
    doc="Weight of the non-coaxial component of the non-proportionality in the fabric anisotropy variable",
)

elastoplastic_fabric_anisotropy_variable_nonproportionality_orthogonal class-attribute instance-attribute

elastoplastic_fabric_anisotropy_variable_nonproportionality_orthogonal: (
    float
) = property(
    fget=lambda self: self.model.options.elastoplastic_fabric_anisotropy_variable_nonproportionality_orthogonal,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_fabric_anisotropy_variable_nonproportionality_orthogonal",
        value,
    ),
    doc="Weight of the orthogonal component of the non-proportionality in the fabric anisotropy variable",
)

elastoplastic_finite_difference_central class-attribute instance-attribute

elastoplastic_finite_difference_central: bool = property(
    fget=lambda self: self.model.options.elastoplastic_finite_difference_central,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_finite_difference_central", value
    ),
    doc="Whether to use central finite difference for numerical derivatives in elastoplastic models",
)

elastoplastic_finite_difference_increment class-attribute instance-attribute

elastoplastic_finite_difference_increment: float = property(
    fget=lambda self: self.model.options.elastoplastic_finite_difference_increment,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_finite_difference_increment", value
    ),
    doc="Finite difference increment for numerical derivatives in elastoplastic models",
)

elastoplastic_flow_rule_tolerance class-attribute instance-attribute

elastoplastic_flow_rule_tolerance: float = property(
    fget=lambda self: self.model.options.elastoplastic_flow_rule_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_flow_rule_tolerance", value
    ),
    doc="Tolerance of flow_rule for plastic correction, only valid for CPPM method",
)

elastoplastic_max_iterations class-attribute instance-attribute

elastoplastic_max_iterations: int = property(
    fget=lambda self: self.model.options.elastoplastic_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_max_iterations", value
    ),
    doc="Maximum number of iterations for plastic correction",
)

elastoplastic_min_principal_stress class-attribute instance-attribute

elastoplastic_min_principal_stress: float = property(
    fget=lambda self: self.model.options.elastoplastic_min_principal_stress,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_min_principal_stress", value
    ),
    doc="Minimum principal stress for elastoplastic models, negative value means no limit",
)

elastoplastic_potential_function_half_shear_derivatives class-attribute instance-attribute

elastoplastic_potential_function_half_shear_derivatives: bool = property(
    fget=lambda self: self.model.options.elastoplastic_potential_function_half_shear_derivatives,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_potential_function_half_shear_derivatives",
        value,
    ),
    doc="Whether to use half derivatives of shear components for plastic potential function",
)

elastoplastic_runge_kutta_correction_substep class-attribute instance-attribute

elastoplastic_runge_kutta_correction_substep: bool = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_correction_substep,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_correction_substep",
        value,
    ),
    doc="Whether to perform yield function corrections at each substep of the Runge-Kutta method",
)

elastoplastic_runge_kutta_diverged_steps_raise class-attribute instance-attribute

elastoplastic_runge_kutta_diverged_steps_raise: bool = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_diverged_steps_raise,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_diverged_steps_raise",
        value,
    ),
    doc="Whether to raise an error when a Runge-Kutta step is detected as diverged",
)

elastoplastic_runge_kutta_fourth_order_type class-attribute instance-attribute

elastoplastic_runge_kutta_fourth_order_type: Literal[
    "classic", "3/8-rule", "ralston"
] = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_fourth_order_type,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_runge_kutta_fourth_order_type", value
    ),
    doc='Type of the fourth-order Runge-Kutta method for elastoplastic integration, "classic", "3/8-rule", or "ralston"',
)

elastoplastic_runge_kutta_integrate_stress_on_yield_surface_max_iterations class-attribute instance-attribute

elastoplastic_runge_kutta_integrate_stress_on_yield_surface_max_iterations: (
    int
) = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_integrate_stress_on_yield_surface_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_integrate_stress_on_yield_surface_max_iterations",
        value,
    ),
    doc="Maximum number of iterations to integrate stress from elastic to the yield surface for Runge-Kutta method",
)

elastoplastic_runge_kutta_integrate_stress_on_yield_surface_method class-attribute instance-attribute

elastoplastic_runge_kutta_integrate_stress_on_yield_surface_method: Literal[
    "bisection", "newton", "none"
] = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_integrate_stress_on_yield_surface_method,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_integrate_stress_on_yield_surface_method",
        value,
    ),
    doc='Method to integrate stress from elastic to the yield surface for Runge-Kutta method, "bisection", "newton" or "none"',
)

elastoplastic_runge_kutta_integrate_stress_on_yield_surface_tolerance class-attribute instance-attribute

elastoplastic_runge_kutta_integrate_stress_on_yield_surface_tolerance: float = (
    property(
        fget=lambda self: self.model.options.elastoplastic_runge_kutta_integrate_stress_on_yield_surface_tolerance,
        fset=lambda self, value: setattr(
            self.model.options,
            "elastoplastic_runge_kutta_integrate_stress_on_yield_surface_tolerance",
            value,
        ),
        doc="Tolerance to integrate stress from elastic to the yield surface for Runge-Kutta method",
    )
)

elastoplastic_runge_kutta_max_const_steps class-attribute instance-attribute

elastoplastic_runge_kutta_max_const_steps: int = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_max_const_steps,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_runge_kutta_max_const_steps", value
    ),
    doc="Maximum number of constant step size substeps for the Runge-Kutta method, non-positive value means no limit",
)

elastoplastic_runge_kutta_order class-attribute instance-attribute

elastoplastic_runge_kutta_order: int = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_order,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_runge_kutta_order", value
    ),
    doc="Order of the Runge-Kutta method for elastoplastic integration, 1, 2, 3, or 4",
)

elastoplastic_runge_kutta_second_order_alpha class-attribute instance-attribute

elastoplastic_runge_kutta_second_order_alpha: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_second_order_alpha,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_second_order_alpha",
        value,
    ),
    doc="Parameter alpha for the second-order Runge-Kutta method in elastoplastic integration.",
)

elastoplastic_runge_kutta_stiffness_type class-attribute instance-attribute

elastoplastic_runge_kutta_stiffness_type: Literal[
    "elastic", "elastoplastic", "elastoplastic_end", "weighted"
] = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_stiffness_type,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_runge_kutta_stiffness_type", value
    ),
    doc='Type of the elastoplastic stiffness matrix for Runge-Kutta method, "elastic", "elastoplastic", "elastoplastic_end", or "weighted"',
)

elastoplastic_runge_kutta_substepping_adaptive_max_ratio class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_adaptive_max_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_adaptive_max_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_adaptive_max_ratio",
        value,
    ),
    doc="Maximum step size ratio of adaptive step size control in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_adaptive_min_ratio class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_adaptive_min_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_adaptive_min_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_adaptive_min_ratio",
        value,
    ),
    doc="Minimum step size ratio of adaptive step size control in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_adaptive_ratio class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_adaptive_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_adaptive_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_adaptive_ratio",
        value,
    ),
    doc="Ratio for adaptive step size control in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_check_min_step_size class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_check_min_step_size: bool = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_check_min_step_size,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_check_min_step_size",
        value,
    ),
    doc="Whether to check the minimum step size for substepping in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_initial_step_size class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_initial_step_size: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_initial_step_size,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_initial_step_size",
        value,
    ),
    doc="Initial step size for substepping in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_max_iterations class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_max_iterations: int = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_max_iterations",
        value,
    ),
    doc="Maximum number of iterations for substepping in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_max_step_size class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_max_step_size: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_max_step_size,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_max_step_size",
        value,
    ),
    doc="Maximum step size for substepping in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_min_step_size class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_min_step_size: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_min_step_size,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_min_step_size",
        value,
    ),
    doc="Minimum step size for substepping in Runge-Kutta elastoplastic integration",
)

elastoplastic_runge_kutta_substepping_tolerance class-attribute instance-attribute

elastoplastic_runge_kutta_substepping_tolerance: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_substepping_tolerance,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_runge_kutta_substepping_tolerance",
        value,
    ),
    doc="Tolerance for substepping in Runge-Kutta elastoplastic integration, negative value means no substepping",
)

elastoplastic_runge_kutta_third_order_alpha class-attribute instance-attribute

elastoplastic_runge_kutta_third_order_alpha: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_third_order_alpha,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_runge_kutta_third_order_alpha", value
    ),
    doc="Parameter alpha for the third-order Runge-Kutta method in elastoplastic integration.",
)

elastoplastic_runge_kutta_third_order_beta class-attribute instance-attribute

elastoplastic_runge_kutta_third_order_beta: float = property(
    fget=lambda self: self.model.options.elastoplastic_runge_kutta_third_order_beta,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_runge_kutta_third_order_beta", value
    ),
    doc="Parameter beta for the third-order Runge-Kutta method in elastoplastic integration",
)

elastoplastic_substepping_check_min_step_size class-attribute instance-attribute

elastoplastic_substepping_check_min_step_size: bool = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_check_min_step_size,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_substepping_check_min_step_size",
        value,
    ),
    doc="Whether to check the minimum step size for substepping in plastic correction",
)

elastoplastic_substepping_initial_step_size class-attribute instance-attribute

elastoplastic_substepping_initial_step_size: float = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_initial_step_size,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_substepping_initial_step_size", value
    ),
    doc="Initial step size for substepping in plastic correction",
)

elastoplastic_substepping_max_iterations class-attribute instance-attribute

elastoplastic_substepping_max_iterations: int = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_substepping_max_iterations", value
    ),
    doc="Maximum number of iterations for substepping in plastic correction",
)

elastoplastic_substepping_max_plastic_strain class-attribute instance-attribute

elastoplastic_substepping_max_plastic_strain: float = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_max_plastic_strain,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_substepping_max_plastic_strain",
        value,
    ),
    doc="Maximum plastic strain for substepping in plastic correction, negative value means no substepping",
)

elastoplastic_substepping_max_step_size class-attribute instance-attribute

elastoplastic_substepping_max_step_size: float = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_max_step_size,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_substepping_max_step_size", value
    ),
    doc="Maximum step size for substepping in plastic correction",
)

elastoplastic_substepping_min_step_size class-attribute instance-attribute

elastoplastic_substepping_min_step_size: float = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_min_step_size,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_substepping_min_step_size", value
    ),
    doc="Minimum step size for substepping in plastic correction",
)

elastoplastic_substepping_step_size_decrease_ratio class-attribute instance-attribute

elastoplastic_substepping_step_size_decrease_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_step_size_decrease_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_substepping_step_size_decrease_ratio",
        value,
    ),
    doc="Step size decrease ratio for substepping in plastic correction when the step fails",
)

elastoplastic_substepping_step_size_increase_ratio class-attribute instance-attribute

elastoplastic_substepping_step_size_increase_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_substepping_step_size_increase_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_substepping_step_size_increase_ratio",
        value,
    ),
    doc="Step size increase ratio for substepping in plastic correction when the plastic multiplier is less than half of the maximum allowed value",
)

elastoplastic_tolerance class-attribute instance-attribute

elastoplastic_tolerance: float = property(
    fget=lambda self: self.model.options.elastoplastic_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "elastoplastic_tolerance", value
    ),
    doc="Tolerance of yield function for plastic correction",
)

elastoplastic_update_critical_void_ratio_when_required class-attribute instance-attribute

elastoplastic_update_critical_void_ratio_when_required: bool = property(
    fget=lambda self: self.model.options.elastoplastic_update_critical_void_ratio_when_required,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_update_critical_void_ratio_when_required",
        value,
    ),
    doc="Whether to update the critical void ratio when required",
)

elastoplastic_use_anisotropic_state_parameter class-attribute instance-attribute

elastoplastic_use_anisotropic_state_parameter: bool = property(
    fget=lambda self: self.model.options.elastoplastic_use_anisotropic_state_parameter,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_use_anisotropic_state_parameter",
        value,
    ),
    doc="Whether to use the anisotropic state parameter in the stress-dilatancy relationship",
)

elastoplastic_yield_function_anisotropic_cohesion class-attribute instance-attribute

elastoplastic_yield_function_anisotropic_cohesion: float = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_anisotropic_cohesion,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_anisotropic_cohesion",
        value,
    ),
    doc="Whether the cohesion is anisotropic",
)

elastoplastic_yield_function_correction_adaptive_ratio class-attribute instance-attribute

elastoplastic_yield_function_correction_adaptive_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_correction_adaptive_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_correction_adaptive_ratio",
        value,
    ),
    doc="Ratio for adaptive plastic correction, negative values are ignored",
)

elastoplastic_yield_function_correction_direction class-attribute instance-attribute

elastoplastic_yield_function_correction_direction: Literal[
    "plastic_flow", "yield_normal"
] = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_correction_direction,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_correction_direction",
        value,
    ),
    doc='Direction for yield function correction, "plastic_flow" for the plastic flow direction or "yield_normal" for the normal direction of the yield surface',
)

elastoplastic_yield_function_correction_diverged_steps_raise class-attribute instance-attribute

elastoplastic_yield_function_correction_diverged_steps_raise: bool = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_correction_diverged_steps_raise,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_correction_diverged_steps_raise",
        value,
    ),
    doc="Whether to raise an error when the plastic correction is detected as diverged",
)

elastoplastic_yield_function_correction_max_const_steps class-attribute instance-attribute

elastoplastic_yield_function_correction_max_const_steps: int = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_correction_max_const_steps,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_correction_max_const_steps",
        value,
    ),
    doc="Maximum number of constant step size substeps for the plastic correction, non-positive value means no limit",
)

elastoplastic_yield_function_derivative_strain class-attribute instance-attribute

elastoplastic_yield_function_derivative_strain: bool = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_derivative_strain,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_derivative_strain",
        value,
    ),
    doc="Whether to consider the strain contribution to the yield function derivative for elastoplastic models",
)

elastoplastic_yield_function_fabric_anisotropy class-attribute instance-attribute

elastoplastic_yield_function_fabric_anisotropy: bool = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_fabric_anisotropy,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_fabric_anisotropy",
        value,
    ),
    doc="Whether to consider fabric anisotropy in the yield function",
)

elastoplastic_yield_function_min_critical_stress_ratio class-attribute instance-attribute

elastoplastic_yield_function_min_critical_stress_ratio: float = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_min_critical_stress_ratio,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_min_critical_stress_ratio",
        value,
    ),
    doc="Minimum critical stress ratio for elastoplastic models. Negative values are ignored",
)

elastoplastic_yield_function_stress_dependent_kp_scale class-attribute instance-attribute

elastoplastic_yield_function_stress_dependent_kp_scale: float = property(
    fget=lambda self: self.model.options.elastoplastic_yield_function_stress_dependent_kp_scale,
    fset=lambda self, value: setattr(
        self.model.options,
        "elastoplastic_yield_function_stress_dependent_kp_scale",
        value,
    ),
    doc="Scale factor for the stress-dependent kp in the yield function. If negative, kp is a constant",
)

experiments instance-attribute

experiments: Dict[str, Experiment] = {}

The experimental data.

fabric property writable

fabric: FabricTensor

The fabric tensor.

fabric_coefs property writable

fabric_coefs: Dict[str, float]

The fabric coefficients.

fabric_evolution_type property writable

fabric_evolution_type: AvailableFabricEvolutionTypes

The fabric evolution type.

fabric_type property writable

fabric_type: AvailableFabricTypes

The fabric tensor type.

friction_angle_weight_mises class-attribute instance-attribute

friction_angle_weight_mises: float = property(
    fget=lambda self: self.model.options.friction_angle_weight_mises,
    fset=lambda self, value: setattr(
        self.model.options, "friction_angle_weight_mises", value
    ),
    doc="Weight of Mises component in lode angle dependent friction angle",
)

friction_angle_weight_mohr_coulomb class-attribute instance-attribute

friction_angle_weight_mohr_coulomb: float = property(
    fget=lambda self: self.model.options.friction_angle_weight_mohr_coulomb,
    fset=lambda self, value: setattr(
        self.model.options, "friction_angle_weight_mohr_coulomb", value
    ),
    doc="Weight of Mohr-Coulomb component in lode angle dependent friction angle",
)

friction_angle_weight_smp class-attribute instance-attribute

friction_angle_weight_smp: float = property(
    fget=lambda self: self.model.options.friction_angle_weight_smp,
    fset=lambda self, value: setattr(
        self.model.options, "friction_angle_weight_smp", value
    ),
    doc="Weight of SMP component in lode angle dependent friction angle",
)

friction_angle_weight_tresca class-attribute instance-attribute

friction_angle_weight_tresca: float = property(
    fget=lambda self: self.model.options.friction_angle_weight_tresca,
    fset=lambda self, value: setattr(
        self.model.options, "friction_angle_weight_tresca", value
    ),
    doc="Weight of Tresca component in lode angle dependent friction angle",
)

ignore_distractions class-attribute instance-attribute

ignore_distractions: bool = property(
    fget=lambda self: self.model.options.ignore_distractions,
    fset=lambda self, value: setattr(
        self.model.options, "ignore_distractions", value
    ),
    doc="Whether to ignore distractions",
)

ignore_fabric_anisotropy_for_isotropic_loading class-attribute instance-attribute

ignore_fabric_anisotropy_for_isotropic_loading: bool = property(
    fget=lambda self: self.model.options.ignore_fabric_anisotropy_for_isotropic_loading,
    fset=lambda self, value: setattr(
        self.model.options,
        "ignore_fabric_anisotropy_for_isotropic_loading",
        value,
    ),
    doc="Whether to ignore fabric anisotropy for isotropic loading",
)

ignore_fabric_evolution_for_isotropic_loading class-attribute instance-attribute

ignore_fabric_evolution_for_isotropic_loading: bool = property(
    fget=lambda self: self.model.options.ignore_fabric_evolution_for_isotropic_loading,
    fset=lambda self, value: setattr(
        self.model.options,
        "ignore_fabric_evolution_for_isotropic_loading",
        value,
    ),
    doc="Whether to ignore fabric evolution for isotropic loading",
)

increment_plastic_displacement class-attribute instance-attribute

increment_plastic_displacement: bool = property(
    fget=lambda self: self.model.options.increment_plastic_displacement,
    fset=lambda self, value: setattr(
        self.model.options, "increment_plastic_displacement", value
    ),
    doc="Increment plastic displacement to the total displacement",
)

integration property writable

integration: Integration

The integration points.

integration_absolute_tolerance class-attribute instance-attribute

integration_absolute_tolerance: float = property(
    fget=lambda self: self.model.options.integration_absolute_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "integration_absolute_tolerance", value
    ),
    doc="Absolute tolerance for macro-micro integration",
)

integration_at_least_once class-attribute instance-attribute

integration_at_least_once: bool = property(
    fget=lambda self: self.model.options.integration_at_least_once,
    fset=lambda self, value: setattr(
        self.model.options, "integration_at_least_once", value
    ),
    doc="Whether the macro-micro integration must be ran at least once",
)

integration_check_absolute_convergence class-attribute instance-attribute

integration_check_absolute_convergence: bool = property(
    fget=lambda self: self.model.options.integration_check_absolute_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "integration_check_absolute_convergence", value
    ),
    doc="Whether to check absolute contact integration error instead of the relative error",
)

integration_check_convergence class-attribute instance-attribute

integration_check_convergence: bool = property(
    fget=lambda self: self.model.options.integration_check_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "integration_check_convergence", value
    ),
    doc="Converge the macro-micro integration algorithm when the number of iterations reaches the maximum",
)

integration_loading_ratio class-attribute instance-attribute

integration_loading_ratio: float = property(
    fget=lambda self: self.model.options.integration_loading_ratio,
    fset=lambda self, value: setattr(
        self.model.options, "integration_loading_ratio", value
    ),
    doc="Macro-micro integration loading ratio for the contact force and displacement",
)

integration_max_iterations class-attribute instance-attribute

integration_max_iterations: int = property(
    fget=lambda self: self.model.options.integration_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options, "integration_max_iterations", value
    ),
    doc="Maximum number of iterations for macro-micro integration",
)

integration_relative_tolerance class-attribute instance-attribute

integration_relative_tolerance: float = property(
    fget=lambda self: self.model.options.integration_relative_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "integration_relative_tolerance", value
    ),
    doc="Relative tolerance for macro-micro integration",
)

integration_substepping_max_ratio class-attribute instance-attribute

integration_substepping_max_ratio: float = property(
    fget=lambda self: self.model.options.integration_substepping_max_ratio,
    fset=lambda self, value: setattr(
        self.model.options, "integration_substepping_max_ratio", value
    ),
    doc="Maximum macro-micro integration substepping ratio",
)

integration_substepping_min_ratio class-attribute instance-attribute

integration_substepping_min_ratio: float = property(
    fget=lambda self: self.model.options.integration_substepping_min_ratio,
    fset=lambda self, value: setattr(
        self.model.options, "integration_substepping_min_ratio", value
    ),
    doc="Minimum macro-micro integration substepping ratio",
)

integration_substepping_relative_to_increment class-attribute instance-attribute

integration_substepping_relative_to_increment: bool = property(
    fget=lambda self: self.model.options.integration_substepping_relative_to_increment,
    fset=lambda self, value: setattr(
        self.model.options,
        "integration_substepping_relative_to_increment",
        value,
    ),
    doc="Whether to use the macro-micro integration substepping relative to the increment of last step",
)

integration_tolerance_relative_stress class-attribute instance-attribute

integration_tolerance_relative_stress: bool = property(
    fget=lambda self: self.model.options.integration_tolerance_relative_stress,
    fset=lambda self, value: setattr(
        self.model.options, "integration_tolerance_relative_stress", value
    ),
    doc="Whether to use relative tolerance to the stress norm",
)

integration_type property writable

integration_type

The integration points type.

is_micromechanical_model property

is_micromechanical_model: bool

Whether the model is a micromechanical model.

j2yang_yield_function_epsr_relative_to_kp class-attribute instance-attribute

j2yang_yield_function_epsr_relative_to_kp: bool = property(
    fget=lambda self: self.model.options.j2yang_yield_function_epsr_relative_to_kp,
    fset=lambda self, value: setattr(
        self.model.options, "j2yang_yield_function_epsr_relative_to_kp", value
    ),
    doc="Whether to use the epsr relative to kp in the yield function for J2Yang model",
)

j2yang_yield_function_softening_alpha class-attribute instance-attribute

j2yang_yield_function_softening_alpha: float = property(
    fget=lambda self: self.model.options.j2yang_yield_function_softening_alpha,
    fset=lambda self, value: setattr(
        self.model.options, "j2yang_yield_function_softening_alpha", value
    ),
    doc="Parameter alpha to control the softening behavior in the yield function for J2Yang model",
)

j2yang_yield_function_softening_beta class-attribute instance-attribute

j2yang_yield_function_softening_beta: float = property(
    fget=lambda self: self.model.options.j2yang_yield_function_softening_beta,
    fset=lambda self, value: setattr(
        self.model.options, "j2yang_yield_function_softening_beta", value
    ),
    doc="Parameter beta to control the softening behavior in the yield function for J2Yang model",
)

j2yang_yield_function_softening_relative_to_CSR class-attribute instance-attribute

j2yang_yield_function_softening_relative_to_CSR: bool = property(
    fget=lambda self: self.model.options.j2yang_yield_function_softening_relative_to_CSR,
    fset=lambda self, value: setattr(
        self.model.options,
        "j2yang_yield_function_softening_relative_to_CSR",
        value,
    ),
    doc="Whether softening behavior depends on critical stress ratio in the yield function for J2Yang model",
)

j2yang_yield_function_softening_type class-attribute instance-attribute

j2yang_yield_function_softening_type: Literal[
    "exponential", "hyperbolic", "hyperbolic-modified"
] = property(
    fget=lambda self: self.model.options.j2yang_yield_function_softening_type,
    fset=lambda self, value: setattr(
        self.model.options, "j2yang_yield_function_softening_type", value
    ),
    doc="Type of softening behavior in the yield function for J2Yang model, either 'exponential', 'hyperbolic' or 'hyperbolic-modified'",
)

kinematic_hypothesis class-attribute instance-attribute

kinematic_hypothesis: bool = property(
    fget=lambda self: self.model.options.kinematic_hypothesis,
    fset=lambda self, value: setattr(
        self.model.options, "kinematic_hypothesis", value
    ),
    doc="Whether to use the kinematic hypothesis",
)

load property writable

load: Load

The load.

loading_direction_scale class-attribute instance-attribute

loading_direction_scale: float = property(
    fget=lambda self: self.model.options.loading_direction_scale,
    fset=lambda self, value: setattr(
        self.model.options, "loading_direction_scale", value
    ),
    doc="Scale for loading direction",
)

loading_direction_type class-attribute instance-attribute

loading_direction_type: Literal[
    "isotropic", "depsd", "depspd", "s", "sa", "custom"
] = property(
    fget=lambda self: self.model.options.loading_direction_type,
    fset=lambda self, value: setattr(
        self.model.options, "loading_direction_type", value
    ),
    doc="Type of loading direction, `isotropic`, `depsd`, `depspd`, `s`, `sa`, or `custom`",
)

material property writable

The material.

mixed_load_absolute_tolerance class-attribute instance-attribute

mixed_load_absolute_tolerance: float = property(
    fget=lambda self: self.model.options.mixed_load_absolute_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_absolute_tolerance", value
    ),
    doc="Absolute tolerance for mixed load control",
)

mixed_load_check_absolute_convergence class-attribute instance-attribute

mixed_load_check_absolute_convergence: bool = property(
    fget=lambda self: self.model.options.mixed_load_check_absolute_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_check_absolute_convergence", value
    ),
    doc="Whether to check absolute tolerance for the mixed load",
)

mixed_load_check_convergence class-attribute instance-attribute

mixed_load_check_convergence: bool = property(
    fget=lambda self: self.model.options.mixed_load_check_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_check_convergence", value
    ),
    doc="Converge the mixed load control algorithm when the number of iterations reaches the maximum",
)

mixed_load_check_strain_convergence class-attribute instance-attribute

mixed_load_check_strain_convergence: bool = property(
    fget=lambda self: self.model.options.mixed_load_check_strain_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_check_strain_convergence", value
    ),
    doc="Whether to check strain convergence of the mixed load control algorithm",
)

mixed_load_check_stress_convergence class-attribute instance-attribute

mixed_load_check_stress_convergence: bool = property(
    fget=lambda self: self.model.options.mixed_load_check_stress_convergence,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_check_stress_convergence", value
    ),
    doc="Whether to check stress convergence of the mixed load control algorithm",
)

mixed_load_constant_elastic_stiffness class-attribute instance-attribute

mixed_load_constant_elastic_stiffness: bool = property(
    fget=lambda self: self.model.options.mixed_load_constant_elastic_stiffness,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_constant_elastic_stiffness", value
    ),
    doc="Whether to use constant elastic stiffness within a mixed load iteration to improve convergence of state-dependent elastoplastic models",
)

mixed_load_max_iterations class-attribute instance-attribute

mixed_load_max_iterations: int = property(
    fget=lambda self: self.model.options.mixed_load_max_iterations,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_max_iterations", value
    ),
    doc="Maximum number of iterations",
)

mixed_load_max_larger_steps class-attribute instance-attribute

mixed_load_max_larger_steps: int = property(
    fget=lambda self: self.model.options.mixed_load_max_larger_steps,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_max_larger_steps", value
    ),
    doc="Allowable steps for the convergence of mixed load control and macro-micro integration",
)

mixed_load_relative_tolerance class-attribute instance-attribute

mixed_load_relative_tolerance: float = property(
    fget=lambda self: self.model.options.mixed_load_relative_tolerance,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_relative_tolerance", value
    ),
    doc="Relative tolerance for mixed load control",
)

mixed_load_stress_as_anisotropic_stress class-attribute instance-attribute

mixed_load_stress_as_anisotropic_stress: bool = property(
    fget=lambda self: self.model.options.mixed_load_stress_as_anisotropic_stress,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_stress_as_anisotropic_stress", value
    ),
    doc="Whether the stress-controlled load is given as anisotropic stress",
)

mixed_load_update_void_ratio_in class-attribute instance-attribute

mixed_load_update_void_ratio_in: Literal[
    "after_convergence", "after_iteration", "before_iteration", "elastoplastic"
] = property(
    fget=lambda self: self.model.options.mixed_load_update_void_ratio_in,
    fset=lambda self, value: setattr(
        self.model.options, "mixed_load_update_void_ratio_in", value
    ),
    doc="When to update the void ratio in the mixed load control algorithm",
)

model instance-attribute

The micromechanical/elastoplastic model.

multi_scale_return_mapping class-attribute instance-attribute

multi_scale_return_mapping: bool = property(
    fget=lambda self: self.model.options.multi_scale_return_mapping,
    fset=lambda self, value: setattr(
        self.model.options, "multi_scale_return_mapping", value
    ),
    doc="Solve the plastic problem with the multi-scale return mapping",
)

no_stop instance-attribute

no_stop: bool = no_stop

No-stop mode.

npv class-attribute instance-attribute

npv: float = property(
    fget=lambda self: self.integration.npv,
    fset=lambda self, value: setattr(self.integration, "npv", value),
    doc="Number of contacts per unit volume",
)

options property writable

options: Options

The options.

parameters property

parameters: Dict[str, float]

The model parameters.

plastic_method property writable

plastic_method: Literal['Explicit', 'CPA', 'CPPM', 'RungeKutta']

The plastic method to solve the plasticity problem.

radius class-attribute instance-attribute

radius: float = property(
    fget=lambda self: self.integration.radius,
    fset=lambda self, value: setattr(self.integration, "radius", value),
    doc="Particle radius",
)

run_contact_integration_steps class-attribute instance-attribute

run_contact_integration_steps: int = property(
    fget=lambda self: self.model.options.run_contact_integration_steps,
    fset=lambda self, value: setattr(
        self.model.options, "run_contact_integration_steps", value
    ),
    doc="Number of macro-micro integration iterations to run",
)

run_mixed_load_steps class-attribute instance-attribute

run_mixed_load_steps: int = property(
    fget=lambda self: self.model.options.run_mixed_load_steps,
    fset=lambda self, value: setattr(
        self.model.options, "run_mixed_load_steps", value
    ),
    doc="Number of mixed load iterations to run",
)

run_steps class-attribute instance-attribute

run_steps: int = property(
    fget=lambda self: self.model.options.run_steps,
    fset=lambda self, value: setattr(self.model.options, "run_steps", value),
    doc="Number of steps to run",
)

save_elastic_stiffness_matrix class-attribute instance-attribute

save_elastic_stiffness_matrix: bool = property(
    fget=lambda self: self.model.options.save_elastic_stiffness_matrix,
    fset=lambda self, value: setattr(
        self.model.options, "save_elastic_stiffness_matrix", value
    ),
    doc="Whether to save the elastic stiffness matrix",
)

simsand_yield_function_additional_shear_strain class-attribute instance-attribute

simsand_yield_function_additional_shear_strain: float = property(
    fget=lambda self: self.model.options.simsand_yield_function_additional_shear_strain,
    fset=lambda self, value: setattr(
        self.model.options,
        "simsand_yield_function_additional_shear_strain",
        value,
    ),
    doc="Additional shear strain to be added to the yield function for SIMSAND model to improve numerical stability when shear strain is close to zero",
)

simsand_yield_function_shear_strain_scale class-attribute instance-attribute

simsand_yield_function_shear_strain_scale: float = property(
    fget=lambda self: self.model.options.simsand_yield_function_shear_strain_scale,
    fset=lambda self, value: setattr(
        self.model.options, "simsand_yield_function_shear_strain_scale", value
    ),
    doc="Scale factor for the shear strain in the yield function for SIMSAND model",
)

simsand_yield_function_use_plastic_strain class-attribute instance-attribute

simsand_yield_function_use_plastic_strain: bool = property(
    fget=lambda self: self.model.options.simsand_yield_function_use_plastic_strain,
    fset=lambda self, value: setattr(
        self.model.options, "simsand_yield_function_use_plastic_strain", value
    ),
    doc="Whether to use plastic strain (or total strain) in the yield function for SIMSAND model",
)

type property writable

type: str

The type of the model

update_fabric_coefs class-attribute instance-attribute

update_fabric_coefs: bool = property(
    fget=lambda self: self.model.options.update_fabric_coefs,
    fset=lambda self, value: setattr(
        self.model.options, "update_fabric_coefs", value
    ),
    doc="Whether to update fabric coefficients",
)

update_npv class-attribute instance-attribute

update_npv: bool = property(
    fget=lambda self: self.model.options.update_npv,
    fset=lambda self, value: setattr(self.model.options, "update_npv", value),
    doc="Whether to update npv based on the coordination number and particle radius",
)

update_void_ratio_from_after_isotropic_loading_to_before class-attribute instance-attribute

update_void_ratio_from_after_isotropic_loading_to_before: bool = property(
    fget=lambda self: self.model.options.update_void_ratio_from_after_isotropic_loading_to_before,
    fset=lambda self, value: setattr(
        self.model.options,
        "update_void_ratio_from_after_isotropic_loading_to_before",
        value,
    ),
    doc="Whether to update the void ratio after the isotropic loading to the void ratio before the isotropicloading, useful if the initial void ratio is given after the isotropic loading",
)

use_isotropic_fabric_tensor_in_strain_averaging class-attribute instance-attribute

use_isotropic_fabric_tensor_in_strain_averaging: bool = property(
    fget=lambda self: self.model.options.use_isotropic_fabric_tensor_in_strain_averaging,
    fset=lambda self, value: setattr(
        self.model.options,
        "use_isotropic_fabric_tensor_in_strain_averaging",
        value,
    ),
    doc="Whether to use the isotropic fabric tensor in strain averaging",
)

use_isotropic_fabric_tensor_in_stress_localization class-attribute instance-attribute

use_isotropic_fabric_tensor_in_stress_localization: bool = property(
    fget=lambda self: self.model.options.use_isotropic_fabric_tensor_in_stress_localization,
    fset=lambda self, value: setattr(
        self.model.options,
        "use_isotropic_fabric_tensor_in_stress_localization",
        value,
    ),
    doc="Whether to use the isotropic fabric tensor in stress localization",
)

use_plastic_strain_in_fabric_evolution class-attribute instance-attribute

use_plastic_strain_in_fabric_evolution: bool = property(
    fget=lambda self: self.model.options.use_plastic_strain_in_fabric_evolution,
    fset=lambda self, value: setattr(
        self.model.options, "use_plastic_strain_in_fabric_evolution", value
    ),
    doc="Whether to use plastic strain in fabric evolution",
)

userDefinedCalculationOptions property

userDefinedCalculationOptions: Dict[str, Any]

The user-defined calculation options that are not in the default options.

verbose class-attribute instance-attribute

verbose: bool = property(
    fget=lambda self: self.model.options.verbose,
    fset=lambda self, value: setattr(self.model.options, "verbose", value),
    doc="Whether to print verbose information",
)

__contains__

__contains__(key: str) -> bool

Check if the option is supported.

__getitem__

__getitem__(key: str) -> Any

Get options

__init__

__init__(
    *model_types: Union[
        MicromechanicalBase,
        type,
        str | PathLike,
        AvailableModels,
        AvailableMicromechanicalModels,
        AvailableContactModels,
    ],
    args: tuple = (),
    kwargs: dict = None,
    no_stop: bool = False,
    backend: Literal["python", "cpp"] = backend,
    **options
)

Constructor for the micromechanical model manager base class.

PARAMETER DESCRIPTION
model_types

The micromechanical model to use. If no positional arguments are provided, the model will not be initialized. If one positional argument is provided, it should be:

  • a micromechanical model object
  • a micromechanical model class
  • a string of the form model_type-contact_type or model-type

If two positional arguments are provided, they should be:

  • (model_type | model_plugin_path, contact_type | contact_plugin_path)

In C++ backend, the micromechanical model type and contact law type can be a string of the file path to the compiled shared library.

For example, the following usages are valid:

  • model = Model(ChangHicherElasticModel): use the ChangHicherElasticModel class (Python)
  • model = Model(ChangHicherElasticModel()): use the ChangHicherElasticModel object (Python)
  • model = Model("CH-Elastic"): use the CH model with the Elastic contact law
  • model = Model("CH", "Elastic"): use the CH model with the Elastic contact law
  • model = Model("CH", "elastic.dll"): use the CH model with the elastic.dll shared library (C++)
  • model = Model("changhicher.dll", "Elastic"): use the changhicher.dll shared library with the Elastic contact law (C++)
  • model = Model("changhicher.dll", "elastic.dll"): use the changhicher.dll shared library with the elastic.dll shared library (C++)

TYPE: Union[MicromechanicalBase, type, str | PathLike, AvailableModels, AvailableMicromechanicalModels, AvailableContactModels] DEFAULT: ()

args

The positional arguments for the micromechanical model if the supplied model is a class.

TYPE: tuple DEFAULT: ()

kwargs

The keyword arguments for the micromechanical model if the supplied model is a class.

TYPE: dict DEFAULT: None

no_stop

Whether to stop the calculation when an error occurs.

TYPE: bool DEFAULT: False

backend

The backend to use, default is the configured backend.

TYPE: ('python', 'cpp') DEFAULT: "python"

options

The calculation options for the micromechanical model, the contact law, or the material.

DEFAULT: {}

__repr__

__repr__() -> str

Generate a summary of the model.

__setitem__

__setitem__(key: str, value: Any) -> None

Set options

addDatasetDirs

addDatasetDirs(*dirs: str | PathLike)

Add directories to search for datasets.

availableDatasets

availableDatasets() -> List[str]

Get the available datasets.

clearExperiments

clearExperiments()

Clear the experiments.

defaultBounds classmethod

defaultBounds() -> Dict[str, Tuple[float, float]]

The default bounds.

defaultParameters classmethod

defaultParameters(model_type: str, contact_type: str = '') -> Dict[str, float]

The default parameters.

defaultStandardDeviations classmethod

defaultStandardDeviations() -> Dict[str, float]

The default standard deviations.

filterExperiments

filterExperiments(
    *args: str,
    experiments: ExperimentsType | None = None,
    method: Literal[
        "equal", "startswith", "endswith", "contains", "glob"
    ] = "glob",
    strategy: Literal["include", "exclude"] = "include",
    inplace: bool = False,
    strict: bool = True,
    **kwargs
) -> Dict[str, Experiment] | None

Filter the experiments by the name of the experiments.

PARAMETER DESCRIPTION
args

Arguments to filter the experiments by the name.

TYPE: str DEFAULT: ()

experiments

Experiments to filter, by default None which means all experiments in the manager

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] | str | Iterable[str] DEFAULT: None

method

The method to filter the experiments, by default "glob"

TYPE: Literal['equal', 'startswith', 'endswith', 'contains', 'glob'] DEFAULT: 'glob'

strategy

The strategy to filter the experiments, by default "include"

TYPE: Literal['include', 'exclude'] DEFAULT: 'include'

inplace

Whether to filter the experiments in place, only used to replace the experiments in the manager, by default False

TYPE: bool DEFAULT: False

strict

If true, notes and options must match exactly with kwargs, otherwise, only items in options and notes are checked with kwargs for equality, by default True

TYPE: bool DEFAULT: True

kwargs

Additional notes or options that should be matched with the experiments

DEFAULT: {}

iterateExperiments

iterateExperiments(
    experiments: ExperimentsType | None = None,
) -> Generator[Experiment]

Iterate over the experiments.

loadCalibration

loadCalibration(filePath: str | Path)

Load parameters, options, and experiments from a calibration file.

loadExperiments

loadExperiments(
    filename: str | AvailableDatasets | PathLike,
) -> Dict[str, Experiment]

Load the experiments from a file and add them to the current experiments.

loadOptions

loadOptions(
    filePath: str | Path,
    *,
    key: str = "options",
    type: Literal["json", "toml", "yaml", "infer"] = "infer"
)

Load the calculation options from a JSON/TOML/YAML file.

loadParameters

loadParameters(
    filePath: str | Path,
    *,
    key: str = "parameters",
    type: Literal["json", "toml", "yaml", "infer"] = "infer"
)

Load the material parameters from a JSON/TOML/YAML file.

readExperiments

readExperiments(
    filename: str | AvailableDatasets | PathLike,
) -> Dict[str, Experiment]

Read the experiments from a file or from the existing datasets.

readParameters classmethod

readParameters(
    filePath: str | Path,
    *,
    key: str = "parameters",
    type: Literal["json", "toml", "yaml", "infer"] = "infer"
) -> dict[str, float]

Read the material parameters from a JSON/TOML/YAML file.

requiredParameters classmethod

requiredParameters(model_type: str, contact_type: str = '') -> List[str]

The required parameters.

run

run(
    experiment_name: str = "", *, no_stop: bool | None = None, **options
) -> SVExporter

Run the model, return the cached state variables if the calculation is already done before with the same string representation of model exporter.

PARAMETER DESCRIPTION
experiment_name

The name of the experiment for error printing.

TYPE: str DEFAULT: ''

no_stop

Override the no_stop option for the model, whether to stop the calculation when an error occurs.

TYPE: bool DEFAULT: None

options

The calculation options for the micromechanical model, the contact law, or the material.

DEFAULT: {}

RETURNS DESCRIPTION
stateVar

The state variables' exporter.

TYPE: SVExporter

saveExperiments

saveExperiments(
    filename: str | PathLike,
    indent: int = 4,
    model_dump_kwargs: Dict | None = None,
    **json_dump_kwargs
)

Save the experiments to a file.

setCalculationOptions

setCalculationOptions(
    opts: Dict[str, float] = None,
    *,
    errstate: Literal["raise", "warn", "ignore"] = "raise",
    **options
)

Set the calculation options for the micromechanical model, the contact law, or the material.

PARAMETER DESCRIPTION
errstate

How to handle unsupported options.

TYPE: Literal['raise', 'warn', 'ignore'] DEFAULT: 'raise'

opts

The calculation options for the micromechanical model, the contact law, the integration, or the material.

TYPE: Dict[str, float] DEFAULT: None

options

The calculation options for the micromechanical model, the contact law, the integration, or the material.

TYPE: Dict[str, float] DEFAULT: None

setDebug

setDebug(debug: bool = True)

Set the debug mode.

PARAMETER DESCRIPTION
debug

The debug mode.

TYPE: bool DEFAULT: True

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.

setParameters

setParameters(
    params: Dict[str, float] = None, experiment_name: str = "", **kwargs: float
) -> None

Set the material parameters. Keys can be in the form of module:qualname(key1,key2) to set the specialized parameters.

PARAMETER DESCRIPTION
experiment_name

The name of the experiment for experiment-specific parameters.

TYPE: str DEFAULT: ''

params

The parameters to set.

TYPE: Dict[str, float] DEFAULT: None

kwargs

The parameters to set.

TYPE: Dict[str, float] DEFAULT: None

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.

setupDebugVariable

setupDebugVariable(
    mixed_load_error: bool = None,
    mixed_loads: bool = None,
    sigx: bool = None,
    epsx: bool = None,
    integration_error: bool = None,
    integrations: bool = None,
    sigi: bool = None,
    sig: bool = None,
    sigm: bool = None,
    sigc: bool = None,
    eps: bool = None,
    epsm: bool = None,
    epsc: bool = None,
    dsig: bool = None,
    deps: bool = None,
    force: bool = None,
    disp: bool = None,
    yield_function: bool = None,
    dfdforce: bool = None,
    dgdforce: bool = None,
    hardening: bool = None,
    kp: bool = None,
    dlambda: bool = None,
    ddisp: bool = None,
    ddispp: bool = None,
    plastic_corrections: bool = None,
    e: bool = None,
    ec: bool = None,
    **kwargs
)

Set up the debug information, whether to enable debug information for specific fields.

setupModifiedModel

setupModifiedModel()

Set the model to the modified model.

setupOriginalModel

setupOriginalModel()

Set the model to the original model.

simulateExperiments

simulateExperiments(
    experiments: ExperimentsType | None = None,
    *,
    phase_steps: dict[str, int] | None = None,
    experiment_options: dict[str, dict[str, Any]] | None = None
) -> SVExporter | Dict[str, SVExporter] | List[SVExporter]

Simulate the experiments.

PARAMETER DESCRIPTION
experiments

The experiments to simulate.

TYPE: Dict[str, Experiment] | Experiment DEFAULT: None

phase_steps

Override the number of steps for each load phase, by default None

TYPE: dict[str, int] DEFAULT: None

experiment_options

Override the calculation options for each experiment, by default None

TYPE: dict[str, dict[str, Any]] DEFAULT: None

verifyAbaqusIncrement

verifyAbaqusIncrement(
    statev: List[float],
    deps: List[float],
    dispp: bool = False,
    cscalars: bool = False,
    cvectors: bool = False,
    *,
    raise_error: bool = True
)

Verify an Abaqus increment with given state variables and strain increment.

verifyAbaqusIncrements

verifyAbaqusIncrements(
    data: Union[Iterable, str, PathLike],
    dispp: bool = False,
    cscalars: bool = False,
    cvectors: bool = False,
    *,
    inherit_stress: bool = True,
    raise_error: bool = True
) -> SVExporter

Verify an Abaqus increments.

ParameterKey

Bases: str

A key for the model parameters in a global sense.

setup

setup(model: 'Model', value: float)

Set up the model with the value

PARAMETER DESCRIPTION
model

The model to be setup

TYPE: Model

value

The value to set

TYPE: float

PlotOfOptions

Bases: TypedDict

backend instance-attribute

backend: NotRequired[Literal['matplotlib', 'bokeh'] | str | None]

bokeh_show instance-attribute

bokeh_show: NotRequired[bool]

clip_xydata instance-attribute

clip_xydata: NotRequired[bool]

col instance-attribute

col: NotRequired[int | slice | Iterable[int]]

data instance-attribute

data: NotRequired[
    Union[
        List[SVExporter],
        SVExporter,
        List["YieldFunction"],
        "YieldFunction",
        List["ElasticityBase"],
        "ElasticityBase",
        None,
    ]
]

data_get_kwargs instance-attribute

data_get_kwargs: NotRequired[Dict[str, Any] | None]

data_set_experiment_options instance-attribute

data_set_experiment_options: NotRequired[bool]

experiment_get_kwargs instance-attribute

experiment_get_kwargs: NotRequired[Dict[str, Any] | None]

experiment_kwargs instance-attribute

experiment_kwargs: NotRequired[dict[str, Any]]

experiment_options instance-attribute

experiment_options: NotRequired[dict[str, dict[str, Any]] | None]

experiments instance-attribute

experiments: NotRequired[ExperimentsType | None]

idx instance-attribute

idx: NotRequired[int | slice | Iterable[int]]

label instance-attribute

label: NotRequired[str]

line_kwargs instance-attribute

line_kwargs: NotRequired[Iterable[Dict[str, Any]] | None]

line_kwargs_each instance-attribute

line_kwargs_each: NotRequired[Literal['experiment', 'line']]

method instance-attribute

method: NotRequired[Literal['plot', 'scatter'] | None]

ncols instance-attribute

ncols: NotRequired[int]

normalize instance-attribute

normalize: NotRequired[bool | Literal['max', 'mean', 'x'] | float]

normalize_x instance-attribute

normalize_x: NotRequired[float | None]

on instance-attribute

on: NotRequired[Plottable | None]

phase instance-attribute

phase: NotRequired[int | slice | Iterable[int]]

phase_steps instance-attribute

phase_steps: NotRequired[dict[str, int] | None]

props instance-attribute

props: NotRequired[Dict[str, Any] | None]

savgol_filter instance-attribute

savgol_filter: NotRequired[Dict[str, Any] | None]

simulation_kwargs instance-attribute

simulation_kwargs: NotRequired[dict[str, Any]]

step instance-attribute

step: NotRequired[int | slice | Iterable[int]]

subplots_kwargs instance-attribute

subplots_kwargs: NotRequired[dict | None]

tight_layout instance-attribute

tight_layout: NotRequired[bool]

type instance-attribute

type: NotRequired[Literal['experiment', 'simulation']]

x instance-attribute

x: NotRequired[str | Literal['first', 'auto']]

VisualizationModel

Bases: CalibrationModel

Visualization manager for the micromechanical model.

fabricplot

fabricplot(
    n_theta: int | None = None,
    n_phi: int | None = None,
    *,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    data: SVExporter | None = None,
    force: bool = False,
    on: Plottable | None = None,
    ncols: int = 2,
    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 evolution of fabric tensors.

macroplot

macroplot(
    *args: str,
    x: str | Literal["first", "auto"] = "auto",
    experiments: ExperimentsType | None = None,
    simulate_experiment_kwargs: dict | None = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    label: str = "{x} vs {y}",
    data: SVExporter | None = None,
    on: Plottable | None = None,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot macroscopic curves. Equivalent to

model.plot("100*epsa", "q", "-p", "q", "100*epsa", "100*epsv", "-p", "e", ...).

  • material parameters (model.parameters)
  • {x} and {y} for the name of the variable
See Also

microplot: Plot microscopic curves

PARAMETER DESCRIPTION
args

State variables to plot. If the number of arguments is an even number, multiple curves will be plotted with every two arguments as a pair of x and y. If the number of arguments is an odd number, the x will be the step number and the y will be all the arguments. For example, the following usages are valid:

  • .plot("fn", "fr"): plot fn against fr
  • .plot("fn", "fr", "un", "ur"): plot fn against fr and un against ur
  • .plot("fn", "fs, "ft"): plot step against fn, fs and ft

if you specify x="first":

  • .plot("step", "fn", "fs, "ft", x="first"): plot step against fn, fs and ft

or any other string:

  • .plot("fn", "fs, "ft", x="step"): plot step against fn, fs and ft

If you want to use a different strategy for the x-axis, you can specify it with x. If you want to plot multiple state variables with the same x-axis, you can specify multiple y-axis variables separated by any of comma, semicolon, or pipe (or any combination of them). For example:

  • .plot("step", "fn|fs|ft"): plot step against fn, fs and ft with the same x-axis

Multiple x-axis can also be specified. If both x and y have multiple variables, the number of x-axis must be equal to the number of y-axis.

TYPE: str DEFAULT: ()

x

Variable to plot on x-axis, by default "auto".

  • "auto": the default strategy, the x variable depends on the number of arguments described above
  • "first": use the first variable as x, the rest variables in args as y
  • any other string: use the specified variable as x, all the variables in args as y

TYPE: str DEFAULT: 'auto'

experiments

The experiments to plot, only one experiment is allowed.

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

simulate_experiment_kwargs

Keyword arguments for the simulateExperiments method for the experiment, by default None

TYPE: dict DEFAULT: None

phase

An integer or a slice indicates index of the phase.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

step

An integer or a slice indicates index of the step.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

idx

An integer or a slice indicates index of the integration point for contact variables.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

col

An integer or a slice indicates index of the column for variables with multiple columns, this argument will be ignored if the variable has only one column or the column index is already specified in var.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

label

Format string for the label in the legend, by default "{x} vs {y}"

TYPE: str DEFAULT: '{x} vs {y}'

data

State variables to plot, if not specified, the simulation will be run, by default None

TYPE: SVExporter DEFAULT: None

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

ncols

Number of columns in the figure grid, by default 2

TYPE: int DEFAULT: 2

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

line_kwargs

Line-specific keyword arguments, by default None

TYPE: Iterable[Dict[str, Any]] 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

savgol_filter

Keyword arguments for scipy.signal.savgol_filter

TYPE: dict DEFAULT: None

kwargs

Keyword arguments for plt.plot or bplt.line

DEFAULT: {}

RETURNS DESCRIPTION
Figure | GridPlot

The matplotlib figure or bokeh grid plot of the macroscopic curves

microplot

microplot(
    *args: str,
    experiments: ExperimentsType | None = None,
    simulate_experiment_kwargs: dict | None = None,
    beta: float = None,
    gamma: float = None,
    unit: Literal["rad", "deg"] = "rad",
    smooth: bool = False,
    data: SVExporter = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    label: str = "Step {step}",
    return_handles: bool = False,
    on: Plottable | None = None,
    ncols: int = 2,
    subplots_kwargs: dict | None = None,
    props: Dict[str, Any] | None = None,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Figure | Tuple[Figure, List[Line2D]]

Plot microscopic curves. Specify one (and only one) of beta or gamma to plot data of a specific azimuth, the other angle will be used for the x-axis.

Notes

The following placeholders are supported for arguments label and kwargs:

  • material parameters (model.parameters)
  • {name} for the name of the variable
  • {step} for the step index
  • {idx}, {beta} and {gamma} for contact variables
See Also

microplot: Plot microscopic curves

PARAMETER DESCRIPTION
args

Names of the variables to plot

TYPE: str DEFAULT: ()

experiments

The experiments to plot, only one experiment is allowed.

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

simulate_experiment_kwargs

Keyword arguments for the simulateExperiments method for the experiment, by default None

TYPE: dict DEFAULT: None

beta

The angle between the projection of the azimuth on the YZ plane and the Y axis

TYPE: float DEFAULT: None

gamma

The angle between the azimuth and the X axis

TYPE: float DEFAULT: None

unit

Unit of the angles, by default

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

smooth

Whether to smooth the data, by default True

TYPE: bool DEFAULT: False

data

State variables to plot, if not specified, the simulation will be run, by default None

TYPE: SVExporter DEFAULT: None

phase

An integer or a slice indicates index of the phase.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

step

Steps to plot

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

idx

Index of the integration point to plot, by default slice(None)

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

col

An integer or a slice indicates index of the column for variables with multiple columns, this argument will be ignored if the variable has only one column or the column index is already specified in var.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

label

Label for the legend, by default "Step {step}"

TYPE: str DEFAULT: 'Step {step}'

return_handles

Whether to return the handles of the plotted lines, by default False

TYPE: bool DEFAULT: False

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

ncols

Number of columns in the figure grid, by default 2

TYPE: int DEFAULT: 2

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

tight_layout

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

TYPE: bool DEFAULT: True

savgol_filter

Keyword arguments for scipy.signal.savgol_filter

TYPE: dict DEFAULT: None

kwargs

Keyword arguments for Axes.plot

DEFAULT: {}

RETURNS DESCRIPTION
Figure

Figure with microscopic curves

List[Line2D]

Handles of the plotted lines, only returned if return_handles is True

microplots

microplots(
    *,
    experiments: ExperimentsType | None = None,
    simulate_experiment_kwargs: dict | None = None,
    beta: float = None,
    gamma: float = None,
    unit: Literal["rad", "deg"] = "rad",
    smooth: bool = False,
    data: SVExporter = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    label: str = "Step {step}",
    on: Plottable | None = None,
    ncols: int = 2,
    subplots_kwargs: dict | None = None,
    props: Dict[str, Any] | None = None,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Figure

Plot microscopic curves for normal force, shear force, normal displacement, and shear displacement.

plot

plot(
    *args: str,
    x: str | Literal["first", "auto"] = "auto",
    experiments: ExperimentsType | None = None,
    simulate_experiment_kwargs: dict | None = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    label: str = "{x} vs {y}",
    data: Union[SVExporter, "YieldFunction", "ElasticityBase", None] = None,
    data_get_kwargs: Dict[str, Any] | None = None,
    normalize: bool | Literal["max", "mean", "x"] | float = False,
    normalize_x: float | None = None,
    on: Plottable | None = None,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot one (or multiple) line(s) of the simulation.

Notes

The following placeholders are supported for arguments label, kwargs and line_kwargs:

  • material parameters (model.parameters)
  • {x} and {y} for the name of the variable
  • {idx}, {beta} and {gamma} for contact variables
PARAMETER DESCRIPTION
args

State variables to plot. If the number of arguments is an even number, multiple curves will be plotted with every two arguments as a pair of x and y. If the number of arguments is an odd number, the x will be the step number and the y will be all the arguments. For example, the following usages are valid:

  • .plot("fn", "fr"): plot fn against fr
  • .plot("fn", "fr", "un", "ur"): plot fn against fr and un against ur
  • .plot("fn", "fs, "ft"): plot step against fn, fs and ft

if you specify x="first":

  • .plot("step", "fn", "fs, "ft", x="first"): plot step against fn, fs and ft

or any other string:

  • .plot("fn", "fs, "ft", x="step"): plot step against fn, fs and ft

If you want to use a different strategy for the x-axis, you can specify it with x. If you want to plot multiple state variables with the same x-axis, you can specify multiple y-axis variables separated by any of comma, semicolon, or pipe (or any combination of them). For example:

  • .plot("step", "fn|fs|ft"): plot step against fn, fs and ft with the same x-axis

Multiple x-axis can also be specified. If both x and y have multiple variables, the number of x-axis must be equal to the number of y-axis.

TYPE: str DEFAULT: ()

x

Variable to plot on x-axis, by default "auto".

  • "auto": the default strategy, the x variable depends on the number of arguments described above
  • "first": use the first variable as x, the rest variables in args as y
  • any other string: use the specified variable as x, all the variables in args as y

TYPE: str DEFAULT: 'auto'

experiments

The experiments to plot, only one experiment is allowed.

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

simulate_experiment_kwargs

Keyword arguments for the simulateExperiments method for the experiment, by default None

TYPE: dict DEFAULT: None

phase

An integer or a slice indicates index of the phase.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

step

An integer or a slice indicates index of the step.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

idx

An integer or a slice indicates index of the integration point for contact variables.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

col

An integer or a slice indicates index of the column for variables with multiple columns, this argument will be ignored if the variable has only one column or the column index is already specified in var.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

label

Format string for the label in the legend, supported placeholders, by default "{x} vs {y}"

TYPE: str DEFAULT: '{x} vs {y}'

data

State variables to plot, if not specified, the simulation will be run, by default None

TYPE: SVExporter | 'YieldFunction' | 'ElasticityBase' DEFAULT: None

data_get_kwargs

Extra keyword arguments for the get method of the data object, by default None

TYPE: Dict[str, Any] DEFAULT: None

normalize

Whether to normalize the data variables. 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: False

normalize_x

The x value to normalize the yield function.

TYPE: float DEFAULT: None

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

ncols

Number of columns in the figure grid, by default 2

TYPE: int DEFAULT: 2

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

line_kwargs

Line-specific keyword arguments, by default None

TYPE: Iterable[Dict[str, Any]] 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

savgol_filter

Keyword arguments for scipy.signal.savgol_filter

TYPE: dict DEFAULT: None

kwargs

Keyword arguments for plt.plot or bplt.line

DEFAULT: {}

RETURNS DESCRIPTION
Figure | GridPlot

The matplotlib figure or bokeh gridplot

plotComparisons

plotComparisons(
    *args: str,
    experiment_kwargs: Dict[str, Any] | None = None,
    simulation_kwargs: Dict[str, Any] | None = None,
    x: str | Literal["first", "auto"] = "auto",
    experiments: ExperimentsType | None = None,
    phase_steps: dict[str, int] | None = None,
    experiment_options: dict[str, dict[str, Any]] | None = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    normalize: bool | Literal["max", "mean", "x"] | float = False,
    normalize_x: float | None = None,
    label: str = "{experiment}",
    data: Union[
        List[SVExporter],
        SVExporter,
        List["YieldFunction"],
        "YieldFunction",
        List["ElasticityBase"],
        "ElasticityBase",
        None,
    ] = None,
    data_set_experiment_options: bool = False,
    data_get_kwargs: Dict[str, Any] | None = None,
    experiment_get_kwargs: Dict[str, Any] | None = None,
    clip_xydata: bool = False,
    on: Plottable | None = None,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    method: Literal["plot", "scatter"] | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    line_kwargs_each: Literal["experiment", "line"] = "experiment",
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot the comparisons between experiments and simulations.

plotExperiments

plotExperiments(
    *args: str,
    x: str | Literal["first", "auto"] = "auto",
    experiments: ExperimentsType | None = None,
    normalize: bool | Literal["max", "mean", "x"] | float = False,
    normalize_x: float | None = None,
    label: str = "{experiment}",
    experiment_get_kwargs: Dict[str, Any] | None = None,
    clip_xydata: bool = False,
    on: Plottable | None = None,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    method: Literal["plot", "scatter"] | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    line_kwargs_each: Literal["experiment", "line"] = "experiment",
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot the experiments.

plotSimulations

plotSimulations(
    *args: str,
    x: str | Literal["first", "auto"] = "auto",
    experiments: ExperimentsType | None = None,
    phase_steps: dict[str, int] | None = None,
    experiment_options: dict[str, dict[str, Any]] | None = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    normalize: bool | Literal["max", "mean", "x"] | float = False,
    normalize_x: float | None = None,
    label: str = "{experiment}",
    data: Union[
        List[SVExporter],
        SVExporter,
        List["YieldFunction"],
        "YieldFunction",
        List["ElasticityBase"],
        "ElasticityBase",
        None,
    ] = None,
    data_set_experiment_options: bool = False,
    data_get_kwargs: Dict[str, Any] | None = None,
    experiment_get_kwargs: Dict[str, Any] | None = None,
    clip_xydata: bool = False,
    on: Plottable | None = None,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    method: Literal["plot", "scatter"] | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    line_kwargs_each: Literal["experiment", "line"] = "experiment",
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot the simulations.

plotof

plotof(
    *args: str,
    x: str | Literal["first", "auto"] = "auto",
    type: Literal["experiment", "simulation"] = "experiment",
    experiments: ExperimentsType | None = None,
    phase_steps: dict[str, int] | None = None,
    experiment_options: dict[str, dict[str, Any]] | None = None,
    phase: int | slice | Iterable[int] = slice(None),
    step: int | slice | Iterable[int] = slice(None),
    idx: int | slice | Iterable[int] = slice(None),
    col: int | slice | Iterable[int] = slice(None),
    normalize: bool | Literal["max", "mean", "x"] | float = False,
    normalize_x: float | None = None,
    label: str = "{experiment}",
    data: Union[
        List[SVExporter],
        SVExporter,
        List["YieldFunction"],
        "YieldFunction",
        List["ElasticityBase"],
        "ElasticityBase",
        None,
    ] = None,
    data_set_experiment_options: bool = False,
    data_get_kwargs: Dict[str, Any] | None = None,
    experiment_get_kwargs: Dict[str, Any] | None = None,
    clip_xydata: bool = False,
    on: Plottable | None = None,
    ncols: int = 2,
    backend: Literal["matplotlib", "bokeh"] | str | None = None,
    subplots_kwargs: dict | None = None,
    method: Literal["plot", "scatter"] | None = None,
    line_kwargs: Iterable[Dict[str, Any]] | None = None,
    line_kwargs_each: Literal["experiment", "line"] = "experiment",
    props: Dict[str, Any] | None = None,
    bokeh_show: bool = False,
    tight_layout: bool = True,
    savgol_filter: Dict[str, Any] | None = None,
    **kwargs
) -> Union["MplFigure", "BkGridPlot"]

Plot the experiments and/or simulations.

Notes

The following placeholders are supported for arguments label, kwargs and line_kwargs:

  • material parameters (model.parameters)
  • experiment options (experiment.options) and notes (experiment.notes)
  • {x} and {y} for the name of the variable
  • {idx}, {beta} and {gamma} for contact variables
  • {experiment} for the name of the experiment
  • {type} for the type of the data, either "experiment" or "simulation"
PARAMETER DESCRIPTION
args

State variables to plot. If the number of arguments is an even number, multiple curves will be plotted with every two arguments as a pair of x and y. If the number of arguments is an odd number, the x will be the step number and the y will be all the arguments. For example, the following usages are valid:

  • .plot("fn", "fr"): plot fn against fr
  • .plot("fn", "fr", "un", "ur"): plot fn against fr and un against ur
  • .plot("fn", "fs, "ft"): plot step against fn, fs and ft

if you specify x="first":

  • .plot("step", "fn", "fs, "ft", x="first"): plot step against fn, fs and ft

or any other string:

  • .plot("fn", "fs, "ft", x="step"): plot step against fn, fs and ft

If you want to use a different strategy for the x-axis, you can specify it with x.

TYPE: str DEFAULT: ()

x

Variable to plot on x-axis, by default "auto".

  • "auto": the default strategy, the x variable depends on the number of arguments described above
  • "first": use the first variable as x, the rest variables in args as y
  • any other string: use the specified variable as x, all the variables in args as y

TYPE: str DEFAULT: 'auto'

type

The type of the plot, by default "experiment"

TYPE: str DEFAULT: 'experiment'

experiments

The experiments to plot, by default None which means all experiments in the manager

TYPE: Experiment | List[Experiment] | Dict[str, Experiment] DEFAULT: None

phase_steps

Override the number of steps for each load phase, by default None

TYPE: dict[str, int] DEFAULT: None

experiment_options

Override the options for each experiment, by default None

TYPE: dict[str, dict[str, Any]] DEFAULT: None

phase

An integer or a slice indicates index of the phase.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

step

An integer or a slice indicates index of the step.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

idx

An integer or a slice indicates index of the integration point for contact variables.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

col

An integer or a slice indicates index of the column for variables with multiple columns, this argument will be ignored if the variable has only one column or the column index is already specified in var.

TYPE: int | slice | Iterable[int] DEFAULT: slice(None)

normalize

Whether to normalize the data variables. 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: False

normalize_x

The x value to normalize the yield function.

TYPE: float DEFAULT: None

label

Format string for the label in the legend, by default {experiment}

TYPE: str DEFAULT: '{experiment}'

data

State variables to plot, if not specified, the simulation will be run, by default None

TYPE: List[SVExporter] | SVExporter | List['YieldFunction'] | 'YieldFunction' | List['ElasticityBase'] | 'ElasticityBase' DEFAULT: None

data_set_experiment_options

Whether to set the experiment options to the data, by default False

TYPE: bool DEFAULT: False

data_get_kwargs

Extra keyword arguments for the get method of the data object, the key can contain placeholders {x} and {y}, the value can be strings in the format of <expx>, <expy>, or any other variables that can be obtained from experiment.get(x) method, by default None

TYPE: Dict[str, Any] DEFAULT: None

experiment_get_kwargs

Extra keyword arguments for the get method of the experiment object, by default None

TYPE: Dict[str, Any] DEFAULT: None

clip_xydata

Clip the x and y data to the range of the experiment data, by default False

TYPE: bool DEFAULT: False

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

ncols

Number of columns in the figure grid, by default 2

TYPE: int DEFAULT: 2

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

method

Method to use for plotting, by default plot for simulations and scatter for experiments

TYPE: Literal['plot', 'scatter'] DEFAULT: None

line_kwargs

Keyword arguments for the lines, by default None

TYPE: Iterable[Dict[str, Any]] DEFAULT: None

line_kwargs_each

Whether to use the line kwargs for each line or for each experiment, by default "experiment"

TYPE: str DEFAULT: 'experiment'

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

savgol_filter

Keyword arguments for scipy.signal.savgol_filter

TYPE: dict DEFAULT: None

kwargs

Keyword arguments for plt.plot or bplt.line or plt.scatter or bplt.scatter

DEFAULT: {}

tensorplot classmethod

tensorplot(
    tensor: "ndarray",
    n_theta: int | None = None,
    n_phi: int | None = None,
    *,
    deviatoric: bool = True,
    on: Plottable | None = None,
    subplots_kwargs: dict | None = None,
    edgecolor: str = "red",
    linewidth: float = 0.5,
    rstride: int = 10,
    cstride: int = 10,
    alpha: float = 0.3,
    cmap: str = "Reds",
    plot_projection_contour: bool = True,
    xoffset: float | None = None,
    yoffset: float | None = None,
    zoffset: float | None = None,
    contour_kwargs: Dict[str, Any] | None = None,
    props: Dict[str, Any] | None = None,
    **kwargs
)

Plot a fabric tensor.

PARAMETER DESCRIPTION
deviatoric

Whether the fabric tensor is deviatoric tensor.

TYPE: bool DEFAULT: True

on

Axes to plot on, by default None

TYPE: PlotAxes DEFAULT: None

subplots_kwargs

Keyword arguments for creating the subplots, by default None

TYPE: dict DEFAULT: None

edgecolor

Color for the edges, by default "red"

TYPE: str DEFAULT: 'red'

linewidth

Line width, by default 0.5

TYPE: float DEFAULT: 0.5

rstride

Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount, by default 10

TYPE: int DEFAULT: 10

cstride

Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount, by default 10

TYPE: int DEFAULT: 10

alpha

Color alpha for the faces

TYPE: float DEFAULT: 0.3

cmap

Color map for the contour

TYPE: str DEFAULT: 'Reds'

plot_projection_contour

Whether to plot the contour of the projections, by default True

TYPE: bool DEFAULT: True

xoffset

Offsets for plotting the contour of the projections

TYPE: float DEFAULT: None

yoffset

Offsets for plotting the contour of the projections

TYPE: float DEFAULT: None

zoffset

Offsets for plotting the contour of the projections

TYPE: float DEFAULT: None

contour_kwargs

Keyword arguments for contour method

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

tight_layout

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

TYPE: bool

kwargs

Keyword arguments for plot_surface method

DEFAULT: {}