Skip to content

contactlaw

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.

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

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