Skip to content

contactlaw

ContactLawBase

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

debugVariable instance-attribute

debugVariable: DebugVariable = DebugVariable()

Debug information

material instance-attribute

material: Material = Material(props)

The material.

name instance-attribute

name: str

The name of the contact law

options instance-attribute

options: Options = Options()

The options

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

dfdforce

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

Calculate derivative of yield function 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
dfdforce

Derivative of yield function with respect to the force

TYPE: ndarray

dfdforce0

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

Calculate derivative of yield function 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
dfdforce

Derivative of yield function with respect to the force

TYPE: ndarray

dfdforce1

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

Calculate derivative of yield function 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
dfdforce

Derivative of yield function with respect to the force

TYPE: ndarray

dgdforce

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

Calculate derivative of potential function 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
dgdforce

Derivative of potential function with respect to the force

TYPE: ndarray

dgdforce0

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

Calculate derivative of potential function 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
dgdforce

Derivative of potential function with respect to the force

TYPE: ndarray

dgdforce1

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

Calculate derivative of potential function with respect to the force:

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

Index of the integration point

TYPE: int

dfdforce

Derivative of yield function with respect to the force

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
dgdforce

Derivative of potential function with respect to the force

TYPE: ndarray

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

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, dgdforce: ndarray, sv0: StateVariable, sv: StateVariable
) -> float

Plastic modulus in the equation of plastic multiplier including dgdforce, 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 displacement dkappa_ddispp (\(\frac{\partial\kappa}{\partial\boldsymbol{\delta}^p}\)) attribute in this class since it will be used in the updateHardeningVariables method to update hardening variables.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

dgdforce

Derivative of potential function with respect to the force

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
Kp

Plastic modulus in the equation of plastic multiplier

TYPE: float

plasticModulus0

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

Plastic modulus in the equation of plastic multiplier, coefficient of plastic multiplier:

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

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

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

dgdforce

Derivative of potential function with respect to the force

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
Kp

Plastic modulus in the equation of plastic multiplier

TYPE: ndarray

plasticModulus1

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

Plastic modulus in the equation of plastic multiplier including dgdforce, 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 displacement dkappa_ddispp (\(\frac{\partial\kappa}{\partial\boldsymbol{\delta}^p}\)) attribute in this class since it will be used in the updateHardeningVariables method to update hardening variables.

PARAMETER DESCRIPTION
idx

Index of the integration point

TYPE: int

dgdforce

Derivative of potential function with respect to the force

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

RETURNS DESCRIPTION
Kp

Plastic modulus in the equation of plastic multiplier

TYPE: float

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

potentialFunction

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

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

\[ G = G(\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 potential function

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.

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

yieldFunction

yieldFunction(
    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

yieldFunctionCorrection

yieldFunctionCorrection(
    idx: int, Ke: ndarray, 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

Ke

The stiffness matrix

TYPE: ndarray

sv0

Initial state variables

TYPE: StateVariable

sv

State variables

TYPE: StateVariable

yieldFunctions

yieldFunctions(
    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

ElastoplasticContactLaw

Bases: ContactLawBase

Base class for elastoplastic contact laws.

plasticMethod instance-attribute

plasticMethod: str

The plastic method

CPPM

CPPM(
    idx: int, Ke: ndarray, 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

Ke

The stiffness matrix

TYPE: ndarray

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, Ke: ndarray, 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

Ke

The stiffness matrix

TYPE: ndarray

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

isCPA

isCPA() -> bool

Whether tha plastic method is CPA.

isCPPM

isCPPM() -> bool

Whether tha plastic method is CPPM.

isExplicit

isExplicit() -> bool

Whether tha plastic method is explicit.

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

NonlinearElasticContactLaw

Bases: ContactLawBase

Nonlinear elastic contact law

dfdforce

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

postIncrement

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

yieldFunction

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