Skip to content

types

__all__ module-attribute

__all__ = [
    "AnyType",
    "ContactLawBase",
    "DebugVariable",
    "ElastoplasticContactLaw",
    "FabricTensor",
    "Integration",
    "LoadPhase",
    "Load",
    "Material",
    "MicromechanicalBase",
    "NonlinearElasticContactLaw",
    "Options",
    "StateVariable",
]

ContactLawBase

Base class for contact laws. Define the relationship between the force and displacement increment

_increment instance-attribute

_increment: numba_int = 0

The contact increment

_integration instance-attribute

_integration: numba_int = 0

The macro-micro integration step

_mixedLoad instance-attribute

_mixedLoad: numba_int = 0

The mixed load step

_phase instance-attribute

_phase: numba_int = 0

The load phase

_plasticCorrection instance-attribute

_plasticCorrection: numba_int = 0

The contact plastic correction step

_step instance-attribute

_step: numba_int = 0

The load step

debugVariable instance-attribute

debugVariable: DebugVariable = DebugVariable()

Debug information

material instance-attribute

material: Material = Material(props)

The material.

name instance-attribute

name: str = 'Undefined'

The name of the contact law

options instance-attribute

options: Options = Options()

The options

type instance-attribute

type: str

The type of the contact law

CSL

CSL(idx: int, sv0: StateVariable, sv: StateVariable) -> float

Calculate critical void ratio. You must define the critical void ratio in the elastoplastic contact law, but it is not necessary for the nonlinear elastic contact law, though you can still define it to use in the nonlinear integration method.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
ec

Critical void ratio

TYPE: float

__init__

__init__(props: dict[str, float] = None)

Constructor for the base class of all contact laws.

abstractSetup

abstractSetup()

Post-initialization for the contact law.

check

check(idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable)

Check the increment is reasonable

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

elasticStiffness

elasticStiffness(
    idx: int, fn: float, sv0: StateVariable, sv: StateVariable
) -> ndarray

Calculate the elastic stiffness matrix, a 3x3 matrix in the following form:

\[ \mathbf{K}_e = \begin{bmatrix} k_n & 0 & 0 \\ 0 & k_t & 0 \\ 0 & 0 & k_t \end{bmatrix} \]
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

fn

Normal force

TYPE: float

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
Ke

Elastic stiffness matrix

TYPE: ndarray

forceDisplacement

forceDisplacement(
    idx: int, ddisp: ndarray, Ke: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Integrate the force-displacement contact law, update the following variables:

  • sv.force: force

The following steps are performed:

  • Go to the last step if the displacement increment is zero
  • preIntegration: called before the integration
  • integrate: integrate the force-displacement contact law to update the contact force
  • postIntegration: called after the integration
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

Ke

Elastic stiffness matrix

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The stiffness matrix

frictionCoefficient

frictionCoefficient(idx: int, sv0: StateVariable, sv: StateVariable) -> float

Calculate the friction coefficient combined with different criteria.

increment

increment(
    idx: int, ddisp: ndarray, Ke: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Increment the displacement and calculate the force. The following steps are performed:

  • preIncrement: called before the increment
  • Return the stiffness matrix if the displacement increment is zero
  • disp += ddisp: update the displacement
  • K = stiffness: calculate the stiffness matrix
  • force += K @ ddisp: update the force
  • check: check the convergence
  • postIncrement: called after the increment
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

Ke

Elastic stiffness matrix

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The stiffness matrix

initialize

initialize(sv: StateVariable)

Initialize the state variables for the contact law

RETURNS DESCRIPTION
sv

Initial state variables

TYPE: StateVariable

integrate

integrate(
    idx: int, ddisp: ndarray, Ke: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Integrate the force-displacement contact law, with a number of increments.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment calculated from the elastic trial from the force increment

TYPE: ndarray

Ke

Elastic stiffness matrix

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The stiffness matrix at the end of the increment

postIncrement

postIncrement(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> None

Post-processing after each increment for the contact law

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

postIntegration

postIntegration(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> None

Post-processing after the contact integration

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

preIncrement

preIncrement(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> None

Pre-processing before each increment for the contact law

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

preIntegration

preIntegration(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> None

Pre-processing before the contact integration

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

The displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

setup

setup()

Set up specific contact law.

stiffness

stiffness(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Stiffness matrix for the contact law. You are required to define the nonlinear relationship between the force and displacement increment:

\[ \begin{bmatrix} \mathrm{d}f_n \\ \mathrm{d}f_s \\ \mathrm{d}f_t \end{bmatrix} = \begin{bmatrix} K_{nn} & K_{ns} & K_{nt} \\ K_{sn} & K_{ss} & K_{st} \\ K_{tn} & K_{ts} & K_{tt} \end{bmatrix} \begin{bmatrix} \mathrm{d}\delta_n \\ \mathrm{d}\delta_s \\ \mathrm{d}\delta_t \end{bmatrix} \]

symmetricContactScalars

symmetricContactScalars() -> List[str]

Symmetric contact scalar variables.

symmetricContactVectors

symmetricContactVectors() -> List[str]

Symmetric contact vector variables.

DebugVariable

debug instance-attribute

debug: bool = False

enables instance-attribute

enables: Dict[str, bool] = empty(string, boolean)

Whether to enable debug information for specific fields

scalars instance-attribute

scalars: Dict[str, List[Scalar]] = empty(string, ScalarListType)

Scalar debug information

vectors instance-attribute

vectors: Dict[str, List[Vector]] = empty(string, ScalarListType)

Vector debug information

__init__

__init__()

appendScalar

appendScalar(field: str, index: dict, value: numba_float)

Append scalar debug information.

appendVector

appendVector(field: str, index: dict, value: VectorXf)

Append vector debug information.

clear

clear()

Clear the debug information.

initialize

initialize()

Initialize the debug information.

setEnables

setEnables(enables: Dict[str, bool])

ElastoplasticContactLaw

Bases: ContactLawBase

Base class for elastoplastic contact laws.

plasticMethod instance-attribute

plasticMethod: str

The plastic method

CPPM

CPPM(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Solve plastic problem (plastic strain) with the closest point projection method (CPPM)

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

Displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

Current state variables

TYPE: StateVariable

RETURNS DESCRIPTION
Kep

Elasto-plastic stiffness matrix

TYPE: ndarray

ExplicitCPA

ExplicitCPA(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Solve plastic problem (plastic strain) with the explicit or cutting plane algorithm (CPA)

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

Displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

Current state variables

TYPE: StateVariable

RETURNS DESCRIPTION
Kep

Elasto-plastic stiffness matrix

TYPE: ndarray

abstractSetup

abstractSetup()

dfdforce

dfdforce(idx: int, sv0: StateVariable, sv: StateVariable) -> ndarray

Calculate derivative of yield function f with respect to the force:

\[ \frac{\partial F}{\partial \boldsymbol{f}} \]
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
dfdsig

Derivative of yield function f with respect to the force

TYPE: ndarray

dgdforce

dgdforce(idx: int, sv0: StateVariable, sv: StateVariable) -> ndarray

Calculate derivative of potential function g with respect to the force:

\[ \frac{\partial G}{\partial \boldsymbol{f}} \]
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
dgdsig

Derivative of potential function g with respect to the stress

TYPE: ndarray

hardening

hardening(
    idx: int, dgdsig: ndarray, sv0: StateVariable, sv: StateVariable
) -> float

Hardening items in the equation of plastic multiplier, coefficient of plastic multiplier:

\[ \sum\frac{\partial F}{\partial\kappa}\frac{\partial\kappa}{\partial\boldsymbol{\delta}^p} \frac{\partial G}{\partial\boldsymbol{f}} \]

make sure to define the derivative of plastic multiplier with respect to plastic strain dkappa_ddispp (:math:\frac{\partial\kappa}{\partial\boldsymbol{\delta}^p}) attribute in this class since it will be used in the :meth:.updateHardeningVariables method to update hardening variables.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

dgdsig

Derivative of potential function g with respect to the force

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
hardening

Hardening items in the equation of plastic multiplier

TYPE: float

integrate

integrate(
    idx: int, ddisp: ndarray, Ke: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

isCPA

isCPA() -> bool

Whether tha plastic method is CPA.

isCPPM

isCPPM() -> bool

Whether tha plastic method is CPPM.

isConverged

isConverged(
    idx: int, f: float, trial: bool, sv0: StateVariable, sv: StateVariable
) -> bool

Determine whether the contact force state is converged to the yield surface or the force state is in the elastic region.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

f

Yield function value

TYPE: float

trial

Whether it is for elastic trial

TYPE: bool

sv0

Initial state variables

TYPE: StateVariable

sv

Current state variables

TYPE: StateVariable

RETURNS DESCRIPTION
bool

Whether the contact force state is converged to the yield surface or the force state is in the elastic region

isExplicit

isExplicit() -> bool

Whether tha plastic method is explicit.

maintainYieldSurface

maintainYieldSurface(
    idx: int,
    ddisp: ndarray,
    dforce: ndarray,
    sv0: StateVariable,
    sv: StateVariable,
)

Revert state variables from elastic state to maintain the force state on the yield surface

Notes

This method should be overridden when the force state is already plastic, but the mixed load iteration converges to the elastic state. This is similar to the yield surface correction method, but the force state is in the elastic region initially caused by the mixed load iteration. However, previous mixed load iteration indicates that the force state is already in the plastic region. This method is used to update the state variables to keep the force state on the yield surface.

If you override this method, make sure to initialize the sv.cscalars["plastic"] state variable to an array of zeros with the same size as the number of integration points in the initialize method of the contact law.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

ddisp

Displacement increment

TYPE: ndarray

dforce

Force increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

Current state variables

TYPE: StateVariable

plasticModulus

plasticModulus(
    idx: int,
    Ke: ndarray,
    dfdforce: ndarray,
    dgdforce: ndarray,
    hardening: float,
    sv0: StateVariable,
    sv: StateVariable,
) -> float

Calculate the plastic modulus

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

Ke

Elastic stiffness matrix

TYPE: ndarray

dfdforce

Derivative of the yield function with respect to the force

TYPE: ndarray

dgdforce

Derivative of the hardening variable with respect to the force

TYPE: ndarray

hardening

Hardening item

TYPE: float

sv0

Initial state variables

TYPE: StateVariable

sv

Current state variables

TYPE: StateVariable

RETURNS DESCRIPTION
float

Plastic modulus

plasticMultiplier

plasticMultiplier(
    idx: int,
    f: float,
    Ke: ndarray,
    ddisp: ndarray,
    dfdforce: ndarray,
    Kp: float,
    sv0: StateVariable,
    sv: StateVariable,
) -> float

Calculate the plastic multiplier

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

f

Yield function value

TYPE: float

Ke

Elastic stiffness matrix

TYPE: ndarray

ddisp

Displacement increment

TYPE: ndarray

dfdforce

Derivative of the yield function with respect to the force

TYPE: ndarray

Kp

Plastic modulus

TYPE: float

sv0

Initial state variables

TYPE: StateVariable

sv

Current state variables

TYPE: StateVariable

RETURNS DESCRIPTION
float

Plastic multiplier

revertHardeningVariables

revertHardeningVariables(
    idx: int,
    dlambda: float,
    ddispp: ndarray,
    sv0: StateVariable,
    sv: StateVariable,
)

Revert hardening variables.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

dlambda

Plastic multiplier

TYPE: float

ddispp

Plastic displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

setPlasticMethod

setPlasticMethod(method: str)

Set the plastic method

PARAMETER DESCRIPTION
method

The plastic method

TYPE: str

stiffness

stiffness(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

updateHardeningVariables

updateHardeningVariables(
    idx: int,
    dlambda: float,
    ddispp: ndarray,
    sv0: StateVariable,
    sv: StateVariable,
)

Update hardening variables, the derivative of plastic multiplier with respect to plastic strain is available in the dkappa_ddispp (:math:\frac{\partial\kappa}{\partial\boldsymbol{\delta}^p}) attribute:

\[ \mathrm{d}\kappa = \frac{\partial\kappa}{\partial\boldsymbol{\delta}^p}\mathrm{d}\boldsymbol{\delta}^p \]
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

dlambda

Plastic multiplier

TYPE: float

ddispp

Plastic displacement increment

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

yieldSurface

yieldSurface(
    idx: int, fn: float, fr: float, sv0: StateVariable, sv: StateVariable
) -> float

Calculate yield function. You are required to define the yield function of the contact force and the state variables:

\[ F = F(\boldsymbol{f}, \kappa) \]
PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

fn

Normal force

TYPE: float

fr

Shear force

TYPE: float

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
float

Value of the yield function

yieldSurfaceCorrection

yieldSurfaceCorrection(idx: int, sv0: StateVariable, sv: StateVariable)

Update state variables after every plastic increment to keep the force state on the yield surface

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

yieldSurfaces

yieldSurfaces(
    idx: int, fn: ndarray, fr: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

Calculate yield function for multiple times

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

fn

Normal force

TYPE: ndarray

fr

Shear force

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

Values of the yield function

FabricTensor

Base class for fabric tensors.

_density instance-attribute

_density: VectorXf = zeros(0, dtype=numpy_float)

density

changed instance-attribute

fabric tensor changed flags

coefs instance-attribute

coefs: Dict[str, numba_float] = empty(string, numba_float)

Fabric tensor coefficients

evolution instance-attribute

evolution: str = evolution

evolution type

rotated instance-attribute

rotated: bool = False

whether the fabric is rotated

tensor instance-attribute

tensor: MatrixXf = eye(3, dtype=numpy_float)

fabric tensor

type instance-attribute

type: str = type

Fabric tensor type

Fij

Fij() -> ndarray

The deviatoric fabric tensor.

__init__

__init__(
    type: AvailableFabricTypes = "chang1990-ext",
    evolution: AvailableFabricEvolutionTypes = "zhao2020",
    coefs: Dict[str, float] = None,
)

Initialize the fabric tensor.

density

density(beta: ndarray, gamma: ndarray) -> ndarray

Directional density function.

evolve

evolve(sv0: StateVariable, sv: StateVariable, use_plastic_strain: bool = True)

Update the fabric tensor.

PARAMETER DESCRIPTION
sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables at the end of the increment.

TYPE: StateVariable

use_plastic_strain

Whether to use the plastic strain for fabric evolution

TYPE: bool DEFAULT: True

initialize

initialize()

Initialize the fabric tensor.

requiresEvolution

requiresEvolution() -> bool

Check if the fabric tensor requires evolution.

requiresUpdate

requiresUpdate() -> bool

Check if the fabric tensor requires update.

rotate

rotate(rotate: bool = True)

Rotate the fabric tensor, set rotate to False to revert the rotation.

setParameters

setParameters(
    type: AvailableFabricTypes = "chang1990-ext",
    evolution: AvailableFabricEvolutionTypes = "zhao2020",
    coefs: Dict[str, float] = None,
)

Set the fabric tensor parameters.

setupDefaultParameters

setupDefaultParameters()

Set the default fabric tensor parameters.

Integration

_Aij instance-attribute

_Aij: MatrixXf = zeros((0, 0), dtype=numpy_float)

fabric tensor

_beta instance-attribute

_beta: VectorXf = zeros(0, dtype=numpy_float)

azimuthal angles of the integration points in the x-y plane

_gamma instance-attribute

_gamma: VectorXf = zeros(0, dtype=numpy_float)

azimuthal angles of the integration points z-axis

_l instance-attribute

_l: MatrixXf = zeros((0, 3), dtype=numpy_float)

contact vectors of the integration points

_p instance-attribute

_p: List[MatrixXf] = empty_list(MatrixXf)

transition matrices

_s instance-attribute

_s: MatrixXf = zeros((0, 3), dtype=numpy_float)

first shear direction

_t instance-attribute

_t: MatrixXf = zeros((0, 3), dtype=numpy_float)

second shear direction

_weight instance-attribute

_weight: VectorXf = zeros(0, dtype=numpy_float)

weight

changed instance-attribute

fabric instance-attribute

fabric: FabricTensor = FabricTensor('chang1990-ext', 'zhao2020', None)

fabric tensor

gauss_weight instance-attribute

gauss_weight: VectorXf = zeros(0, dtype=numpy_float)

weights of the integration points

n instance-attribute

n: MatrixXf = zeros((0, 3), dtype=numpy_float)

azimuthal angles of the integration points

npv instance-attribute

number of contacts per unit volume

radius instance-attribute

radius: numba_float = numba_float(radius)

particle radius

Aij

Aij() -> ndarray

The fabric tensor Aij, an array of shape (3, 3).

\[ A_{ij} = \left[(2r)^2 \frac{N}{V} \left(\frac{2}{15}F_{ij} + \frac{1}{3} I\right) \right]^{-1} \]
RETURNS DESCRIPTION
ndarray

The fabric tensor.

Aij_

Aij_() -> ndarray

Calculate the fabric tensor Aij from the definition, an array of shape (3, 3).

\[ A_{ij} = \frac{1}{V} \sum_{c=1}^{N}{l_i^c l_j^c} \]

__init__

__init__(npv: float = 1000000000.0, radius=0.00065)

Constructor for the Gauss integration class.

PARAMETER DESCRIPTION
npv

number of contacts per unit volume

TYPE: float DEFAULT: 1000000000.0

radius

particle radius

TYPE: float DEFAULT: 0.00065

beta

beta() -> ndarray

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

RETURNS DESCRIPTION
ndarray

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

bi

bi(idx: int) -> ndarray

gamma

gamma() -> ndarray

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

RETURNS DESCRIPTION
ndarray

The azimuthal angles of the integration points x-axis.

gi

gi(idx: int) -> ndarray

indexOf

indexOf(
    beta: float = -1.0, gamma: float = -1.0, tol: float = 1e-06
) -> Tuple[ndarray, ndarray]

Return the indices of the integration points with the given beta and gamma angles and the corresponding angles. Specify one (and only one) of beta or gamma.

PARAMETER DESCRIPTION
beta

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

TYPE: float DEFAULT: -1.0

gamma

The angle between the azimuth and the X axis

TYPE: float DEFAULT: -1.0

tol

The tolerance for the comparison of the angles, by default 1e-6

TYPE: float DEFAULT: 1e-06

RETURNS DESCRIPTION
ndarray

The indices of the integration points

ndarray

The corresponding angles, depending on the given angles, gamma when beta is given and vice versa

initialize

initialize(sv: StateVariable) -> None

Initialize the integration points.

l

l() -> ndarray

The contact vectors of the integration points, an array of shape (n, 3).

RETURNS DESCRIPTION
ndarray

The integration points in the x-y plane.

li

li(idx: int) -> ndarray

p

p(idx: int) -> ndarray

The transformation matrix, an array of shape (3, 3).

RETURNS DESCRIPTION
ndarray

The transformation matrix.

reset

reset() -> None

Reset temporary variables.

rho

rho() -> float

Normalized packing density.

rotate

rotate(F: ndarray, idx: int) -> ndarray

Rotate the fabric tensor.

rotates

rotates(F: ndarray) -> List[ndarray]

Rotate the fabric tensors.

s

s() -> ndarray

The first shear direction, an array of shape (n, 3).

setAnisotropicParameters

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

Set the anisotropic parameters.

PARAMETER DESCRIPTION
type

The type of the anisotropic parameter.

TYPE: str DEFAULT: 'chang1990-ext'

evolution

The evolution type of the anisotropic parameter.

TYPE: str DEFAULT: 'zhao2020'

coefs

The coefficients of the anisotropic parameter.

TYPE: Dict[str, float] DEFAULT: None

setGauss37

setGauss37(full: bool = False)

Set the Gauss37 integration points.

PARAMETER DESCRIPTION
full

Full 37*2 integration points.

TYPE: bool DEFAULT: False

setGauss61

setGauss61(full: bool = False)

Set the Gauss61 integration points.

PARAMETER DESCRIPTION
full

Full 61*2 integration points.

TYPE: bool DEFAULT: False

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

setParameters

setParameters(npv: float, radius: float) -> None

Set the parameters.

PARAMETER DESCRIPTION
npv

number of contacts per unit volume

TYPE: float

radius

particle radius

TYPE: float

si

si(idx: int) -> ndarray

size

size() -> int

The number of integration points.

RETURNS DESCRIPTION
int

The number of integration points.

t

t() -> ndarray

The second shear direction, an array of shape (n, 3).

ti

ti(idx: int) -> ndarray

weight

weight() -> ndarray

The weights of the integration points, an array of shape (n,).

RETURNS DESCRIPTION
ndarray

The weights of the integration points.

wi

wi(idx: int) -> ndarray

Load

load phases manager.

phases instance-attribute

phases: List[LoadPhase] = List([p for _ in range(0)])

load phases

__init__

__init__()

Constructor for the load class.

addConfinementPhase

addConfinementPhase(epsa_max: float, steps: int) -> LoadPhase

Add a confinement load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

epsa_max

Maximum strain.

TYPE: float

RETURNS DESCRIPTION
LoadPhase

The load phase.

addDrainedTriaxialPhase

addDrainedTriaxialPhase(sigc: float, epsa_max: float, steps: int) -> LoadPhase

Add a drained triaxial load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

sigc

Confined stress.

TYPE: float

epsa_max

Maximum strain.

TYPE: float

RETURNS DESCRIPTION
LoadPhase

The load phase.

addIsotropicPhase

addIsotropicPhase(sigc: float, steps: int) -> LoadPhase

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) -> LoadPhase

Add a load phase.

PARAMETER DESCRIPTION
phase

The load phase.

TYPE: LoadPhase

RETURNS DESCRIPTION
LoadPhase

The load phase.

addTrueTriaxialPhase

addTrueTriaxialPhase(
    sig3: float, b: float, epsa_max: float, steps: int
) -> LoadPhase

Add a true triaxial load phase.

PARAMETER DESCRIPTION
sig3

Minimum principal stress.

TYPE: float

b

Intermediate stress ratio.

TYPE: float

epsa_max

Maximum strain.

TYPE: float

steps

Number of steps.

TYPE: int

RETURNS DESCRIPTION
LoadPhase

The load phase.

addTrueTriaxialWithConstantShearPhase

addTrueTriaxialWithConstantShearPhase(
    p: float, b: float, steps: int
) -> LoadPhase

Add a true triaxial load phase with constant shear stress.

PARAMETER DESCRIPTION
p

Mean stress.

TYPE: float

b

Intermediate stress ratio.

TYPE: float

steps

Number of steps.

TYPE: int

RETURNS DESCRIPTION
LoadPhase

The load phase.

addUndrainedTriaxialPhase

addUndrainedTriaxialPhase(epsa_max: float, steps: int) -> LoadPhase

Add an undrained triaxial load phase.

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

epsa_max

Maximum strain.

TYPE: float

RETURNS DESCRIPTION
LoadPhase

The load phase.

addUndrainedTriaxialWithoutShearPhase

addUndrainedTriaxialWithoutShearPhase(epsa_max: float, steps: int) -> LoadPhase

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

PARAMETER DESCRIPTION
steps

Number of steps.

TYPE: int

epsa_max

Maximum strain.

TYPE: float

RETURNS DESCRIPTION
LoadPhase

The load phase.

clear

clear()

Clear the load phases.

initialize

initialize(sv: StateVariable)

Initialize the load.

PARAMETER DESCRIPTION
sv

The state variables.

TYPE: StateVariable

LoadPhase

A class for a single load phase.

b instance-attribute

b: float = numpy_float(-1.0)

Intermediate stress ratio

control instance-attribute

control: VectorXf = control

Control type of the load, 0 for stress control, 1 for strain control, -1 for ignored

final instance-attribute

final: VectorXf = final

Final mixed stress/strain

initial instance-attribute

initial: VectorXf = initial

Initial mixed stress/strain

steps instance-attribute

steps: numba_int = numba_int(steps)

Number of steps

total instance-attribute

total: VectorXf = total

Control whether the load is incremental or total, 0 for incremental, 1 for total

__init__

__init__(
    initial: ndarray = zeros(6, dtype=numpy_float),
    final: ndarray = zeros(6, dtype=numpy_float),
    control: ndarray = zeros(6, dtype=numpy_float),
    total: ndarray = zeros(6, dtype=numpy_float),
    steps: int = 100,
)

Constructor for the load phase class.

PARAMETER DESCRIPTION
initial

Initial mixed stress/strain.

TYPE: ndarray DEFAULT: zeros(6, dtype=numpy_float)

final

Final mixed stress/strain.

TYPE: ndarray DEFAULT: zeros(6, dtype=numpy_float)

control

The control type of the load increment, 0 for stress control, 1 for strain control, -1 for ignored.

TYPE: ndarray DEFAULT: zeros(6, dtype=numpy_float)

total

Control whether the load is incremental or total, 0 for incremental, 1 for total.

TYPE: ndarray DEFAULT: zeros(6, dtype=numpy_float)

steps

Number of steps.

TYPE: int DEFAULT: 100

finalize

finalize(sig: ndarray) -> ndarray

Finalize the load phase to ensure the intermediate stress ratio is satisfied.

initialize

initialize(sv: StateVariable)

Initialize the load phase.

PARAMETER DESCRIPTION
sv

The state variables.

TYPE: StateVariable

isCompatibleWith

isCompatibleWith(previous: 'LoadPhase') -> bool

Check if the load phase is compatible with the previous load phase.

PARAMETER DESCRIPTION
previous

Previous load phase.

TYPE: LoadPhase

RETURNS DESCRIPTION
bool

True if compatible, False otherwise.

isIsotropic

isIsotropic(tol: float = 1e-06) -> bool

Check if the load phase is isotropic.

makeCompatibleWith

makeCompatibleWith(previous: 'LoadPhase')

Make the load phase compatible with the previous load phase.

PARAMETER DESCRIPTION
previous

Previous load phase.

TYPE: LoadPhase

requiresFinalization

requiresFinalization() -> bool

Check if the load phase requires finalization.

Material

Material parameters.

Note

Not using a numba TypedDict because it is slower.

Properties ending with underscores are anisotropic parameters.

Ad instance-attribute

Ad: numba_float = pop('Ad', 0.6)

a dilation parameter

Lambda instance-attribute

Lambda: numba_float = pop('Lambda', 0.06)

compression -> slope of CSL line (lambda)

R instance-attribute

R: numba_float = pop('R', 0.0)

:math:R, A material constant, :math:k_n=k_t\times R

V instance-attribute

V: numba_float = pop('V', 0.0)

A large positive parameter

X instance-attribute

X: numba_float = pop('X', 0.0)

A positive model parameter

b instance-attribute

b: numba_float = pop('b', 1e-07)

:math:b, Control the evolution rate of the grain breakage

c instance-attribute

c: numba_float = pop('c', 0.0)

Usual ratio of extension to compression quantities

ch instance-attribute

ch: numba_float = pop('ch', 0.0)

Stress-ratio-related hardening parameters

chi0 instance-attribute

chi0: numba_float = pop('chi0', 0.0)

:math:\chi_0, Initial bounding ratio

cohesion instance-attribute

cohesion: numba_float = pop('cohesion', 0.0)

adhesive stress

custom instance-attribute

custom: Dict[str, numba_float] = empty(string, numba_float)

Custom parameters

e0 instance-attribute

e0: numba_float = pop('e0', 0.6)

initial void ratio

ec0 instance-attribute

ec0: numba_float = pop('ec0', 0.7)

initial critical void ratio

emax instance-attribute

emax: numba_float = pop('emax', 0.8)

:math:e_{\max}, Maximal void ratio

emin instance-attribute

emin: numba_float = pop('emin', 0.4)

:math:e_{\min}, Minimal void ratio

eref instance-attribute

eref: numba_float = pop('eref', 0.81)

void ratio at the critical state

eref0 instance-attribute

eref0: numba_float = pop('eref0', 0.81)

initial critical void ratio

erefu instance-attribute

erefu: numba_float = pop('erefu', 0.8)

:math:e_{refu}, Ultimate reference void ratio

fabrics instance-attribute

fabrics: Dict[str, FabricTensor] = empty(string, FabricTensorType)

Anisotropic fabric tensors

fb0 instance-attribute

fb0: numba_float = pop('fb0', 0.0)

:math:\sigma_{b0}, Initial adhesive normal stress

fc0 instance-attribute

fc0: numba_float = pop('fc0', 100.0)

:math:\sigma_{c0}, Initial pre-consolidated stress

fnr instance-attribute

fnr: numba_float = pop('fnr', 0.0)

Mean effective stress when log(e) = 1 in the LCC line (log(e) - log(p) space)

fref instance-attribute

fref: numba_float = pop('fref', 0.0001)

reference force

h0 instance-attribute

h0: numba_float = pop('h0', 0.0)

Stress-ratio-related hardening parameters

hp instance-attribute

hp: numba_float = pop('hp', 5000.0)

:math:h_p, Related to plastic modulus of bounding surface effect

integration instance-attribute

integration: Integration = Integration(1000000000.0, 0.00065)

Integration

kappa instance-attribute

kappa: numba_float = pop('kappa', 0.01)

slope of swelling line

kn0 instance-attribute

kn0: numba_float = pop('kn0', 80.0)

initial normal force

kp instance-attribute

kp: numba_float = pop('kp', 0.0)

:math:k_p, A parameter in the SimSand yield formula

kpr instance-attribute

kpr: numba_float = pop('kpr', 1.0)

a ratio of normal stiffness (k_n) to peak stiffness (k_p)

krr instance-attribute

krr: numba_float = pop('krr', 0.4)

a ratio of normal stiffness (k_n) to tangential stiffness (k_r)

kt0 instance-attribute

kt0: numba_float = pop('kt0', 0.0)

:math:K_{t0}, Reference shear modulus

m instance-attribute

m: numba_float = pop('m', 0.0)

:math:m, Control the distance between NCL and CSL

n instance-attribute

n: numba_float = pop('n', 1.0)

:math:n, Control the shape of yield surface

nd instance-attribute

nd: numba_float = pop('nd', 0.5)

the exponential in the phase-transformation angle

ne instance-attribute

ne: numba_float = pop('ne', 0.0)

an exponent in the normal stiffness

ng instance-attribute

ng: numba_float = pop('ng', 0.0)

:math:n_g, An exponent in the formula of nonlinear shear modulus

np instance-attribute

np: numba_float = pop('np', 1.0)

the exponential in the dynamic friction angle

nw instance-attribute

nw: numba_float = pop('nw', 1.0)

:math:n_w, Control the effect of plastic work to the grain breakage

phi instance-attribute

phi: numba_float = pop('phi', 33.0)

inter-particle friction angle

pref instance-attribute

pref: numba_float = pop('pref', Pat)

reference load at critical state

rho instance-attribute

rho: numba_float = pop('rho', 0.0)

:math:\rho, Control the decreasing rate of CSL due to grain breakage

rhoc instance-attribute

rhoc: numba_float = pop('rhoc', 0.0)

Slope of the LCC line in the log(e) - log(p) space

theta instance-attribute

theta: numba_float = pop('theta', 0.0)

A constant exponent in the hardening behavior of p0

vf instance-attribute

vf: numba_float = pop('vf', 0.0)

:math:\nu_f, Final poisson ratio

vi instance-attribute

vi: numba_float = pop('vi', 0.5)

:math:\nu_i, Initial poisson ratio

xi instance-attribute

xi: numba_float = pop('xi', 0.5)

:math:\xi, Control the nonlinearity of CSL line

xib instance-attribute

xib: numba_float = pop('xib', 0.0)

:math:\xi_b, A soil constant controls hardening rule of :math:\xi_b

xic instance-attribute

xic: numba_float = pop('xic', 0.0)

:math:\xi_c, A soil constant controls hardening rule of :math:\xi_c

Ad_

Ad_(idx: int) -> float

Lambda_

Lambda_(idx: int) -> float

Mc

Mc(
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

Return the critical state slope for compression.

Mc_

Mc_(
    idx: int,
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

Return the critical state slope for compression.

Me

Me(
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

Return the critical state slope for extension.

Me_

Me_(
    idx: int,
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

Return the critical state slope for extension.

R_

R_(idx: int) -> float

V_

V_(idx: int) -> float

X_

X_(idx: int) -> float

__contains__

__contains__(key: str) -> bool

Check if the parameter exists.

__getitem__

__getitem__(key: str) -> float

Get the value of a parameter. This method is might be slower than direct getting the attribute.

__init__

__init__(props: dict[str, float] = None) -> None

Initialize the material parameters.

__setitem__

__setitem__(key: str, value: float)

Set the value of a parameter. This method is might be slower than direct setting the attribute.

anisotropicFactor

anisotropicFactor(key: str, idx: int) -> float

Return the anisotropic factor.

PARAMETER DESCRIPTION
key

The key of the anisotropic parameter.

TYPE: str

idx

The index of the integration point.

TYPE: int

b_

b_(idx: int) -> float

c_

c_(idx: int) -> float

ch_

ch_(idx: int) -> float

chi0_

chi0_(idx: int) -> float

cohesion_

cohesion_(idx: int) -> float

custom_

custom_(key: str, idx: int) -> float

e0_

e0_(idx: int) -> float

ec0_

ec0_(idx: int) -> float

emax_

emax_(idx: int) -> float

emin_

emin_(idx: int) -> float

eref0_

eref0_(idx: int) -> float

eref_

eref_(idx: int) -> float

erefu_

erefu_(idx: int) -> float

fb0_

fb0_(idx: int) -> float

fc0_

fc0_(idx: int) -> float

fnr_

fnr_(idx: int) -> float

fref_

fref_(idx: int) -> float

get

get(key: str, default_: float = 0.0) -> float

Get a parameter value.

get_

get_(key: str, idx: int, default_: float = 0.0) -> float

Get a parameter value with anisotropic factor.

PARAMETER DESCRIPTION
key

The key of the parameter.

TYPE: str

idx

The index of the integration point.

TYPE: int

default_

The default value of the parameter.

TYPE: float DEFAULT: 0.0

h0_

h0_(idx: int) -> float

hp_

hp_(idx: int) -> float

initialize

initialize(sv: StateVariable)

Initialize the material parameters.

kappa_

kappa_(idx: int) -> float

kn0_

kn0_(idx: int) -> float

kp_

kp_(idx: int) -> float

kpr_

kpr_(idx: int) -> float

krr_

krr_(idx: int) -> float

kt0_

kt0_(idx: int) -> float

m_

m_(idx: int) -> float

mu

mu(
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

Return the friction coefficient.

mu_

mu_(
    idx: int,
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

n_

n_(idx: int) -> float

nd_

nd_(idx: int) -> float

ne_

ne_(idx: int) -> float

ng_

ng_(idx: int) -> float

np_

np_(idx: int) -> float

nw_

nw_(idx: int) -> float

phi_

phi_(
    idx: int,
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

phi_combined

phi_combined(
    ba: float = 0.0,
    Ra: float = 1.0,
    weight_mises: float = 0.0,
    weight_tresca: float = 0.0,
    weight_mohr_coulomb: float = 1.0,
    weight_smp: float = 0.0,
) -> float

Friction angle considering combined failure criteria

pref_

pref_(idx: int) -> float

rho_

rho_(idx: int) -> float

rhoc_

rhoc_(idx: int) -> float

set

set(key: str, value: float)

Set a parameter value.

setAnisotropicParameters

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

Set anisotropic parameters.

PARAMETER DESCRIPTION
key

The key of the anisotropic parameter.

TYPE: str

type

The type of the anisotropic parameter.

TYPE: str DEFAULT: 'chang1990-ext'

evolution

The evolution type of the anisotropic parameter.

TYPE: str DEFAULT: 'zhao2020'

coefs

The coefficients of the anisotropic parameter.

TYPE: Dict[str, float] DEFAULT: None

sin_phi_mises

sin_phi_mises(ba: float = 0.0, Ra: float = 1.0) -> float

Friction angle sine of Von Mises failure criteria

sin_phi_smp

sin_phi_smp(ba: float = 0.0, Ra: float = 1.0) -> float

Friction angle sine of SMP failure criteria

sin_phi_tresca

sin_phi_tresca(ba: float = 0.0, Ra: float = 1.0) -> float

Friction angle sine of Tresca failure criteria

theta_

theta_(idx: int) -> float

vf_

vf_(idx: int) -> float

vi_

vi_(idx: int) -> float

xi_

xi_(idx: int) -> float

xib_

xib_(idx: int) -> float

xic_

xic_(idx: int) -> float

MicromechanicalBase

Base class for all micro-mechanical models.

_e0 instance-attribute

_e0: numba_float = 0.0

Original void ratio

_integration instance-attribute

_integration: numba_int = 0

current integration index

_mixedLoad instance-attribute

_mixedLoad: numba_int = 0

current mixed load index

_phase instance-attribute

_phase: numba_int = 0

current phase index

_step instance-attribute

_step: numba_int = 0

current step index

contact instance-attribute

contact: ContactLawBase = createContactLaw(props)

The contact law.

debugVariable instance-attribute

debugVariable: DebugVariable = DebugVariable()

Debug information

integration instance-attribute

integration: Integration = Integration(npv, radius)

The integration points.

load instance-attribute

load: Load = Load()

The load.

name instance-attribute

name: str = 'Undefined'

The name of the model.

options instance-attribute

options: Options = Options()

The options

stateVars instance-attribute

stateVars: List[StateVariable] = List(
    [StateVariable(0, False) for _ in range(0)]
)

The state variables.

__init__

__init__(
    props: Dict[str, float] | None = None,
    npv: float = 1000000000.0,
    radius: float = 0.00065,
)

Constructor for the base class of all micromechanical models.

PARAMETER DESCRIPTION
props

The material properties, by default None

TYPE: Dict[str, float] DEFAULT: None

npv

The number of particles per volume, by default 1e9

TYPE: float DEFAULT: 1000000000.0

radius

The particle radius, by default 0.65e-3

TYPE: float DEFAULT: 0.00065

averageStrain

averageStrain(disp: ndarray, sv0: StateVariable, sv: StateVariable) -> ndarray

Average the contact displacement into the strain tensor.

PARAMETER DESCRIPTION
disp

The contact displacement.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The averaged strain tensor, shape (6,).

averageStress

averageStress(force: ndarray, sv0: StateVariable, sv: StateVariable) -> ndarray

Average the contact force into the stress tensor.

PARAMETER DESCRIPTION
force

The contact force.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The averaged stress tensor, shape (6,).

contactIntegrate

contactIntegrate(
    idx: int,
    dforce: ndarray,
    ddisp: ndarray,
    sv0: StateVariable,
    sv: StateVariable,
)

Integrate the contact law.

PARAMETER DESCRIPTION
dforce

The contact force increment.

TYPE: ndarray

ddisp

The contact displacement increment.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

contactIntegrates

contactIntegrates(
    dforce: ndarray, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
)

Integrate all the contact laws with cache.

PARAMETER DESCRIPTION
dforce

The contact force increment.

TYPE: ndarray

ddisp

The contact displacement increment.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

createContactLaw

createContactLaw(props: dict[str, float] = None) -> ContactLawBase

The default contact law.

PARAMETER DESCRIPTION
props

The material properties, by default None

TYPE: dict[str, float] DEFAULT: None

RETURNS DESCRIPTION
ContactLawBase

The default contact law.

fabricEvolution

fabricEvolution(sv0: StateVariable, sv: StateVariable)

Evolve the fabric tensor.

PARAMETER DESCRIPTION
sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables at the end of the increment.

TYPE: StateVariable

increment

increment(
    dx: ndarray,
    x: ndarray,
    S: ndarray,
    E: ndarray,
    G: ndarray,
    sv0: StateVariable,
    sv: StateVariable,
) -> ndarray

Run the model for one increment.

PARAMETER DESCRIPTION
dx

The mixed load increment.

TYPE: ndarray

x

The mixed load.

TYPE: ndarray

S

The stress control matrix.

TYPE: ndarray

E

The strain control matrix.

TYPE: ndarray

G

The ignored control matrix.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables at the end of the increment.

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The updated stress.

initialize

initialize() -> StateVariable

Initialize the state variables.

RETURNS DESCRIPTION
StateVariable

The state variables.

localizeStrain

localizeStrain(eps: ndarray, sv0: StateVariable, sv: StateVariable) -> ndarray

Localize the strain to the contact displacement.

PARAMETER DESCRIPTION
eps

The strain or strain increment.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The displacement or displacement increment.

localizeStress

localizeStress(sig: ndarray, sv0: StateVariable, sv: StateVariable) -> ndarray

Localize the stress to the contact force.

PARAMETER DESCRIPTION
sig

The stress or stress increment.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

RETURNS DESCRIPTION
ndarray

The force or force increment.

macroMicroIntegrate

macroMicroIntegrate(
    K: ndarray,
    dsig: ndarray,
    deps: ndarray,
    sv0: StateVariable,
    sv: StateVariable,
) -> None

Macro-Micro Integration. The following state variables need to be updated:

  • sv.force: the contact force.
  • sv.disp: the contact displacement.
  • sv.sig: the global stress.
  • sv.eps: the global strain.
PARAMETER DESCRIPTION
K

The stiffness matrix.

TYPE: ndarray

dsig

The stress increment.

TYPE: ndarray

deps

The strain increment.

TYPE: ndarray

sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variables.

TYPE: StateVariable

postInitialize

postInitialize(sv: StateVariable) -> None

Post-initialize the state variables.

PARAMETER DESCRIPTION
sv

The state variables.

TYPE: StateVariable

postProcess

postProcess(sv: StateVariable) -> None

Post-process the state variables.

PARAMETER DESCRIPTION
sv

The state variables.

TYPE: StateVariable

resetCustomStateVariables

resetCustomStateVariables(sv0: StateVariable, sv: StateVariable)

Reset the custom state variables to zeros existing in the current state variables but not in the initial state variables.

PARAMETER DESCRIPTION
sv0

The initial state variables.

TYPE: StateVariable

sv

The current state variables.

TYPE: StateVariable

run

run() -> List[StateVariable]

Run the model.

RETURNS DESCRIPTION
List[StateVariable]

The state variables.

setContactLaw

setContactLaw(contact)

Set the contact law.

PARAMETER DESCRIPTION
contact

The contact law.

TYPE: ContactLawBase

setup

setup()

Post initialization for the micromechanical model.

stiffness

stiffness(
    sv0: StateVariable,
    sv: StateVariable,
    kn: ndarray = None,
    ks: ndarray = None,
    original: bool = False,
) -> ndarray

Calculate the stiffness matrix.

PARAMETER DESCRIPTION
sv0

The state variables at the beginning of the increment.

TYPE: StateVariable

sv

The state variable.

TYPE: StateVariable

kn

The contact normal stiffness, by default None

TYPE: ndarray DEFAULT: None

ks

The contact shear stiffness, by default None

TYPE: ndarray DEFAULT: None

original

Return the original 9x9 stiffness matrix, by default False

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
ndarray

The elastic stiffness matrix.

NonlinearElasticContactLaw

Bases: ContactLawBase

Nonlinear elastic contact law

abstractSetup

abstractSetup()

integrate

integrate(
    idx: int, ddisp: ndarray, Ke: ndarray, sv0: StateVariable, sv: StateVariable
) -> ndarray

postIncrement

postIncrement(
    idx: int, ddisp: ndarray, sv0: StateVariable, sv: StateVariable
) -> None

Options

Options for micromechanical models

best_fit_strain_averaging instance-attribute

best_fit_strain_averaging: bool = True

Use the best-fit hypothesis for strain averaging

cache instance-attribute

cache: bool = True

Cache contact variables

cache_precision instance-attribute

cache_precision: numba_int = 15

Cache contact variables precision

contact_check_convergence instance-attribute

contact_check_convergence: bool = True

Whether to check the convergence

contact_check_plastic_multiplier instance-attribute

contact_check_plastic_multiplier: bool = True

Whether to check the sign of plastic multiplier

contact_ensure_force_state_on_yield_surface instance-attribute

contact_ensure_force_state_on_yield_surface: bool = False

Whether to ensure the force state is on the yield surface

contact_friction_angle_combined instance-attribute

contact_friction_angle_combined: bool = False

Whether to combine the friction angle from different criteria

contact_friction_angle_weight_mises instance-attribute

contact_friction_angle_weight_mises: numba_float = 0.0

Weight for Von Mises criterion in the friction angle

contact_friction_angle_weight_mohr_coulomb instance-attribute

contact_friction_angle_weight_mohr_coulomb: numba_float = 1.0

Weight for Mohr-Coulomb criterion in the friction angle

contact_friction_angle_weight_smp instance-attribute

contact_friction_angle_weight_smp: numba_float = 0.0

Weight for SMP criterion in the friction angle

contact_friction_angle_weight_tresca instance-attribute

contact_friction_angle_weight_tresca: numba_float = 0.0

Weight for Tresca criterion in the friction angle

contact_linear_critical_state_line instance-attribute

contact_linear_critical_state_line: bool = False

Whether to use linear critical state line for OSIMSAND contact law

contact_max_increment instance-attribute

contact_max_increment: numba_float = 0.1

Maximum force ratio increment

contact_max_iterations instance-attribute

contact_max_iterations: numba_int = 100

Maximum number of iterations

contact_min_normal_force instance-attribute

contact_min_normal_force: numba_float = 1e-10

Minimum normal force

contact_plastic_method_multiplier instance-attribute

contact_plastic_method_multiplier: numba_float = 1.0

Multiplier for the contact plastic method

contact_sanisand_constant_hardening_parameter instance-attribute

contact_sanisand_constant_hardening_parameter: bool = True

Whether to use constant hardening parameter h for the SANISAND contact law

contact_sanisand_maintain_yield_surface instance-attribute

contact_sanisand_maintain_yield_surface: bool = False

Whether to main yield surface for the SANISAND contact law

contact_tolerance instance-attribute

contact_tolerance: numba_float = 1e-10

Contact tolerance

debug instance-attribute

debug: bool = False

Debug mode

disp_steps instance-attribute

disp_steps: numba_int = -1

Print debug information every disp_steps steps

ignore_distractions instance-attribute

ignore_distractions: bool = True

Whether to ignore distractions

ignore_fabric_evolution_for_isotropic_loading instance-attribute

ignore_fabric_evolution_for_isotropic_loading: bool = False

Whether to ignore fabric evolution for isotropic loading

ignore_fabric_rotations_for_isotropic_loading instance-attribute

ignore_fabric_rotations_for_isotropic_loading: bool = False

Whether to ignore fabric rotations for isotropic loading

increment_plastic_displacement instance-attribute

increment_plastic_displacement: bool = True

Increment plastic displacement to the total displacement

integration_absolute_tolerance instance-attribute

integration_absolute_tolerance: numba_float = 1e-10

Absolute tolerance for the unbalanced force

integration_check_absolute_convergence instance-attribute

integration_check_absolute_convergence: bool = False

Whether to check absolute contact integration error instead of the relative error

integration_check_convergence instance-attribute

integration_check_convergence: bool = True

Whether to converge the macro-micro integration algorithm when the number of iterations reaches the maximum

integration_loading_ratio instance-attribute

integration_loading_ratio: numba_float = 1.0

Macro-micro integration loading ratio for the contact force and displacement

integration_max_iterations instance-attribute

integration_max_iterations: numba_int = 100

Maximum number of macro-micro integration iterations

integration_max_substepping_ratio instance-attribute

integration_max_substepping_ratio: numba_float = -1.0

Maximum macro-micro integration substepping ratio

integration_min_substepping_ratio instance-attribute

integration_min_substepping_ratio: numba_float = -1.0

Minimum macro-micro integration substepping ratio

integration_relative_tolerance instance-attribute

integration_relative_tolerance: numba_float = 0.001

Relative tolerance for the unbalanced force

integration_substepping_relative_to_increment instance-attribute

integration_substepping_relative_to_increment: bool = False

Whether to use the macro-micro integration substepping relative to the increment of last step

kinematic_hypothesis instance-attribute

kinematic_hypothesis: bool = False

Whether to use the kinematic hypothesis

mixed_load_absolute_tolerance instance-attribute

mixed_load_absolute_tolerance: numba_float = 1e-05

Absolute tolerance for the mixed load

mixed_load_check_absolute_convergence instance-attribute

mixed_load_check_absolute_convergence: bool = False

Whether to check absolute tolerance for the mixed load

mixed_load_check_convergence instance-attribute

mixed_load_check_convergence: bool = True

Whether to converge the mixed load control algorithm when the number of iterations reaches the maximum

mixed_load_check_strain_convergence instance-attribute

mixed_load_check_strain_convergence: bool = True

Check strain convergence of the mixed load control algorithm

mixed_load_max_iterations instance-attribute

mixed_load_max_iterations: numba_int = 100

Maximum number of iterations for the mixed load control algorithm

mixed_load_max_larger_steps instance-attribute

mixed_load_max_larger_steps: numba_int = -1

Maximum number of larger steps for the mixed load control algorithm

mixed_load_relative_tolerance instance-attribute

mixed_load_relative_tolerance: numba_float = 0.001

Relative tolerance for the mixed load

precise_incremental_volumetric_strain instance-attribute

precise_incremental_volumetric_strain: bool = False

Whether to use the precise incremental volumetric strain to update void ratio

run_contact_integration_steps instance-attribute

run_contact_integration_steps: numba_int = -1

Number of macro-micro integration iterations to run

run_mixed_load_steps instance-attribute

run_mixed_load_steps: numba_int = -1

Number of mixed load iterations to run

run_steps instance-attribute

run_steps: numba_int = -1

Number of steps to run

separate_mean_deviatoric_stress_strain instance-attribute

separate_mean_deviatoric_stress_strain: bool = False

Whether to apply mean stress and deviatoric stress/strain separately in the mixed load control algorithm

update_fabric_coefs instance-attribute

update_fabric_coefs: bool = False

Whether to update fabric coefficients

update_npv instance-attribute

update_npv: bool = False

Whether to update npv based on the coordination number and particle radius

update_void_ratio_from_after_isotropic_loading_to_before instance-attribute

update_void_ratio_from_after_isotropic_loading_to_before: bool = False

Whether to update the void ratio after the isotropic loading to the void ratio before the isotropic loading, useful if the initial void ratio is given after the isotropic loading

use_isotropic_fabric_tensor_in_strain_averaging instance-attribute

use_isotropic_fabric_tensor_in_strain_averaging: bool = True

Whether to evolve fabric tensor in strain averaging

use_isotropic_fabric_tensor_in_stress_localization instance-attribute

use_isotropic_fabric_tensor_in_stress_localization: bool = False

Whether to evolve fabric tensor in stress localization

use_plastic_strain_in_fabric_evolution instance-attribute

use_plastic_strain_in_fabric_evolution: bool = True

Whether to use plastic strain in fabric evolution

verbose instance-attribute

verbose: bool = False

Whether to print verbose information

__init__

__init__()

StateVariable

A instance-attribute

fabric tensor A

F instance-attribute

fabric tensor F

cached_num instance-attribute

cached_num: numba_int = 0

cached number of integration points

contact_min_normal_force instance-attribute

contact_min_normal_force: numba_float

minimum normal force

cscalars instance-attribute

cscalars: Dict[str, VectorXf]

custom scalar fields for contacts, a 1D numpy array of size (size,) is expected for each contact

cvectors instance-attribute

cvectors: Dict[str, MatrixXf]

custom vector fields for contacts, a 2D numpy array of size (size, ...) is expected for each contact

disp instance-attribute

disp: MatrixXf

displacement

dispp instance-attribute

dispp: MatrixXf

plastic displacement

e instance-attribute

e: numba_float = 0.0

void ratio

ec instance-attribute

ec: numba_float = 0.0

critical void ratio

eps instance-attribute

eps: VectorXf

strain

epsp instance-attribute

epsp: VectorXf

plastic strain

epspu instance-attribute

epspu: VectorXf

plastic strain from displacements

force instance-attribute

force: MatrixXf

force

phase instance-attribute

phase: numba_int = 0

load phase index

phi instance-attribute

phi: numba_float = 0.0

critical friction angle

scalars instance-attribute

scalars: Dict[str, numba_float]

custom scalar fields

sig instance-attribute

sig: VectorXf

stress

size instance-attribute

size: numba_int = size

Size of the integration points

vectors instance-attribute

vectors: Dict[str, VectorXf]

custom vector fields

w instance-attribute

:math:w, Plastic work

A11

A11() -> float

Fabric tensor component A11

A12

A12() -> float

Fabric tensor component A12

A13

A13() -> float

Fabric tensor component A13

A22

A22() -> float

Fabric tensor component A22

A23

A23() -> float

Fabric tensor component A23

A33

A33() -> float

Fabric tensor component A33

Aij

Aij() -> ndarray

Fabric tensor, shape (3, 3)

F11

F11() -> float

Fabric tensor component F11

F12

F12() -> float

Fabric tensor component F12

F13

F13() -> float

Fabric tensor component F13

F22

F22() -> float

Fabric tensor component F22

F23

F23() -> float

Fabric tensor component F23

F33

F33() -> float

Fabric tensor component F33

FN11

FN11() -> float

Fabric tensor of contact normal force component FN11

FN12

FN12() -> float

Fabric tensor of contact normal force component FN12

FN13

FN13() -> float

Fabric tensor of contact normal force component FN13

FN22

FN22() -> float

Fabric tensor of contact normal force component FN22

FN23

FN23() -> float

Fabric tensor of contact normal force component FN23

FN33

FN33() -> float

Fabric tensor of contact normal force component FN33

FNij

FNij() -> ndarray

Fabric tensor of contact normal force, shape (3, 3)

FT11

FT11() -> float

Fabric tensor of contact shear force component FR11

FT12

FT12() -> float

Fabric tensor of contact shear force component FR12

FT13

FT13() -> float

Fabric tensor of contact shear force component FR13

FT22

FT22() -> float

Fabric tensor of contact shear force component FR22

FT23

FT23() -> float

Fabric tensor of contact shear force component FR23

FT33

FT33() -> float

Fabric tensor of contact shear force component FR33

FTij

FTij() -> ndarray

Fabric tensor of contact shear force, shape (3, 3)

Fij

Fij() -> ndarray

Fabric tensor, shape (3, 3)

I1

I1() -> float

First invariant of stress

I2

I2() -> float

Second invariant of stress

I3

I3() -> float

Third invariant of stress

J2

J2() -> float

Second invariant of deviatoric stress

J3

J3() -> float

Third invariant of deviatoric stress

M

M() -> float

Slope of the critical state line

Mc

Mc() -> float

Slope of the critical state line for compression

Me

Me() -> float

Slope of the critical state line for extension

Ra

Ra() -> float

Major stress ratio siga1/siga3

__init__

__init__(size: int = 37, initialize_arrays: bool = True)

Constructor of the state variable

PARAMETER DESCRIPTION
size

Size of the integration points

TYPE: int DEFAULT: 37

initialize_arrays

Whether to initialize numpy arrays, by default True, if False, the numpy arrays are empty

TYPE: bool DEFAULT: True

an

an() -> float

Degree of fabric anisotropy for the contact normal force

anisotropicStressTensor

anisotropicStressTensor() -> Tensor2

Anisotropic stress tensor

ar

ar() -> float

Degree of fabric anisotropy

at

at() -> float

Degree of fabric anisotropy for the contact shear force

b

b() -> float

Lode parameter

ba

ba() -> float

Lode parameter with anisotropy

copy

copy() -> 'StateVariable'

A copy of the state variable

copyContactStateVariables

copyContactStateVariables(
    from_idx: int,
    to_idx: int,
    symmetric: bool = False,
    cscalars: List[str] = None,
    cvectors: List[str] = None,
)

Copy the contact state variables from one integration point to another

PARAMETER DESCRIPTION
from_idx

Index of the integration point to copy from

TYPE: int

to_idx

Index of the integration point to copy to

TYPE: int

symmetric

Whether to revert the symmetric contact state variables, by default False

TYPE: bool DEFAULT: False

cscalars

Custom scalar fields to be multiplied by -1, by default None

TYPE: List[str] DEFAULT: None

cvectors

Custom vector fields to be multiplied by -1, by default None

TYPE: List[str] DEFAULT: None

copyTo

copyTo(sv: StateVariable)

Copy state variables to another

eeq

eeq() -> float

Equivalent strain

elasticStiffnessMatrix

elasticStiffnessMatrix() -> ndarray

Elastic stiffness matrix, shape (3, 3)

RETURNS DESCRIPTION
ndarray

Elastic stiffness matrix

epsa

epsa() -> float

Axial strain

epsd

epsd() -> float

General shear strain

epsij

epsij() -> ndarray

Deviatoric strain tensor

epskk

epskk() -> ndarray

Mean strain tensor

epsm

epsm() -> ndarray

Strain in a matrix form

epspa

epspa() -> float

Axial plastic strain

epspd

epspd() -> float

General plastic shear strain

epspij

epspij() -> ndarray

Deviatoric plastic strain tensor

epspkk

epspkk() -> ndarray

Mean plastic strain tensor

epspm

epspm() -> ndarray

Plastic strain in a matrix form

epspua

epspua() -> float

Axial plastic strain from displacements

epspud

epspud() -> float

General plastic shear strain from displacements

epspuij

epspuij() -> ndarray

Deviatoric plastic strain tensor from displacements

epspukk

epspukk() -> ndarray

Mean plastic strain tensor from displacements

epspum

epspum() -> ndarray

Plastic strain from displacements in a matrix form

epspuv

epspuv() -> float

Volumetric plastic strain from displacements

epspuva

epspuva() -> float

Volumetric plastic strain from displacements

epspv

epspv() -> float

Volumetric plastic strain

epspva

epspva() -> float

Volumetric plastic strain

epsv

epsv() -> float

Volumetric strain

epsva

epsva() -> float

Volumetric strain approximation

eta

eta() -> float

Stress ratio

feta

feta() -> ndarray

Shear force ratio for every integration point, shape (size,)

fetai

fetai(idx: int) -> float

Shear force ratio at the integration point with index idx

fn

fn() -> ndarray

Normal force for every integration point, shape (size,)

fnci

fnci(idx: int, cohesion: float = 0.0) -> float

Normal force with minimum cohesion at the integration point with index idx

fni

fni(idx: int) -> float

Normal force at the integration point with index idx

fr

fr() -> ndarray

Shear force for every integration point, shape (size,)

fri

fri(idx: int) -> float

Shear force at the integration point with index idx

fs

fs() -> ndarray

Shear force at the first direction for every integration point, shape (size,)

fsi

fsi(idx: int) -> float

Shear force at the first direction at the integration point with index idx

fst

fst() -> ndarray

Shear force for every integration point, shape (size, 2)

fsti

fsti(idx: int) -> ndarray

Shear force at the integration point with index idx, shape (2,)

ft

ft() -> ndarray

Shear force at the second direction for every integration point, shape (size,)

fti

fti(idx: int) -> float

Shear force at the second direction at the integration point with index idx

hash

hash(
    dfi: ndarray,
    idx: int,
    precision: int = 15,
    symmetric: bool = False,
    cscalars: List[str] = None,
    cvectors: List[str] = None,
) -> int

Hash the contact state variables at the integration point with index idx

PARAMETER DESCRIPTION
dfi

Contact force increment

TYPE: ndarray

idx

Index of the integration point

TYPE: int

precision

Precision of the hash value, by default 15

TYPE: int DEFAULT: 15

symmetric

Whether to revert the symmetric contact state variables, by default False

TYPE: bool DEFAULT: False

cscalars

Custom scalar fields to be multiplied by -1, by default None

TYPE: List[str] DEFAULT: None

cvectors

Custom vector fields to be multiplied by -1, by default None

TYPE: List[str] DEFAULT: None

RETURNS DESCRIPTION
int

Hash value

lode

lode() -> float

Lode angle

lodea

lodea() -> float

Lode angle with anisotropy

negp

negp() -> float

Negative mean stress, usually used in Geotechnical Engineering

nsi

nsi(idx: int) -> float

Direction of the shear force in the first direction with index idx

nsti

nsti(idx: int) -> ndarray

Direction of the shear force in two dimensions with index idx, shape (2,)

nti

nti(idx: int) -> float

Direction of the shear force in the second direction with index idx

p

p() -> float

Mean stress

peeq

peeq() -> float

Equivalent plastic strain

plasticDisplacementStrainTensor

plasticDisplacementStrainTensor() -> Tensor2

Plastic strain tensor from displacements

plasticStrainTensor

plasticStrainTensor() -> Tensor2

Plastic strain tensor

pueeq

pueeq() -> float

Equivalent plastic strain from displacements

q

q() -> float

Deviatoric stress

revertSymmetricContactStateVariables

revertSymmetricContactStateVariables(
    idx: int, cscalars: List[str] = None, cvectors: List[str] = None
)

Revert contact force, displacement and specified custom variables by multiplying them with -1

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

cscalars

Custom scalar fields to be multiplied by -1, by default None

TYPE: List[str] DEFAULT: None

cvectors

Custom vector fields to be multiplied by -1, by default None

TYPE: List[str] DEFAULT: None

sig11

sig11() -> float

First principal stress

sig123

sig123()

Principal stresses

sig22

sig22() -> float

Second principal stress

sig33

sig33() -> float

Third principal stress

siga11

siga11() -> float

First principal stress with anisotropy

siga123

siga123()

Principal stresses with anisotropy

siga22

siga22() -> float

Second principal stress with anisotropy

siga33

siga33() -> float

Third principal stress with anisotropy

sigkk

sigkk() -> ndarray

Mean stress tensor

sigm

sigm() -> ndarray

Stress in a matrix form

strainTensor

strainTensor() -> Tensor2

Strain tensor

stressTensor

stressTensor() -> Tensor2

Stress tensor

tauij

tauij() -> ndarray

Deviatoric stress tensor

un

un() -> ndarray

Normal displacement for every integration point, shape (size,)

uni

uni(idx: int) -> float

Normal displacement at the integration point with index idx

upn

upn() -> ndarray

Normal plastic displacement for every integration point, shape (size,)

upni

upni(idx: int) -> float

Normal plastic displacement at the integration point with index idx

upr

upr() -> ndarray

Shear plastic displacement for every integration point, shape (size,)

upri

upri(idx: int) -> float

Shear plastic displacement at the integration point with index idx

ups

ups() -> ndarray

Shear plastic displacement at the first direction for every integration point, shape (size,)

upsi

upsi(idx: int) -> float

Shear plastic displacement at the first direction at the integration point with index idx

upst

upst() -> ndarray

Shear plastic displacement for every integration point, shape (size, 2)

upsti

upsti(idx: int) -> ndarray

Shear plastic displacement at the integration point with index idx, shape (2,)

upt

upt() -> ndarray

Shear plastic displacement at the second direction for every integration point, shape (size,)

upti

upti(idx: int) -> float

Shear plastic displacement at the second direction at the integration point with index idx

ur

ur() -> ndarray

Shear displacement for every integration point, shape (size,)

uri

uri(idx: int) -> float

Shear displacement at the integration point with index idx

us

us() -> ndarray

Shear displacement at the first direction for every integration point, shape (size,)

usi

usi(idx: int) -> float

Shear displacement at the first direction at the integration point with index idx

ust

ust() -> ndarray

Shear displacement for every integration point, shape (size, 2)

usti

usti(idx: int) -> ndarray

Shear displacement at the integration point with index idx, shape (2,)

ut

ut() -> ndarray

Shear displacement at the second direction for every integration point, shape (size,)

uti

uti(idx: int) -> float

Shear displacement at the second direction at the integration point with index idx