Constraints
Constraints are used to enforce certain conditions on the system. They are used to enforce boundary conditions, contact conditions, etc. Technically, constraints are implemented as a set of kernels, which are applied to the system matrix and the external load vector. In this regard, constraints are similar to elements, but they mey also use additional scalar variables to enforce the conditions. Unlike elements, they are not subject to external loads.
- class edelweissmeshfree.constraints.base.mpmconstraintbase.MPMConstraintBase(nDof)[source]
Initialize the VIJEntityBase.
- Attributes:
activeWhether this constraint is active or not.
fieldsOnNodesThe fields on the nodes this constraint is acting on.
nDofThe total number of degrees of freedom this constraint is associated with.
nameThe name of this constraint.
nodesThe nodes this constraint is acting on.
scalarVariablesThe list of assigned ScalarVariable.
- Parameters:
nDof (int)
Methods
applyConstraint(dU, PExt, V, timeStep)Apply the constraint, i.e., compute the 'kernels'.
assignAdditionalScalarVariables(scalarVariables)This is the list of constraint specific scalar variables which are assigned to this constraint.
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
getVIJContributionSize()Return the number of entries this entity contributes to the VIJ (COO) system matrix.
initializeVIJContribution(idcs, I_, J_, offset)Fill the global
IandJindex arrays for this constraint's VIJ contribution.updateConnectivity(model)This method is called before each new timeStep, after material point connectivity was updated, but before the global equation system is created.
- abstractmethod applyConstraint(dU, PExt, V, timeStep)[source]
Apply the constraint, i.e., compute the ‘kernels’. Add the contributions to the external load vector and the system matrix.
- Parameters:
dU (ndarray) – The current increment since the last time the constraint was applied.
PExt (ndarray) – The external load vector.
V (ndarray) – The system (stiffness) matrix.
timeStep (TimeStep) – The current step and total time.
- abstractmethod assignAdditionalScalarVariables(scalarVariables)[source]
This is the list of constraint specific scalar variables which are assigned to this constraint.
- Parameters:
scalarVariables (list[ScalarVariable]) – The list of ScalarVariable to be assigned.
- abstractmethod getNumberOfAdditionalNeededScalarVariables()[source]
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
- Returns:
The number of requested ScalarVariable
- Return type:
int
- abstractmethod updateConnectivity(model)[source]
This method is called before each new timeStep, after material point connectivity was updated, but before the global equation system is created. If the contribution to the global system changes, True is returned.
- Parameters:
model (MPMModel) – The current model.
- Returns:
The truth value if the connectivity has changed.
- Return type:
bool
- property active: bool
Whether this constraint is active or not.
- Returns:
The truth value.
- Return type:
bool
- abstract property fieldsOnNodes: list[list[str]]
The fields on the nodes this constraint is acting on.
- Returns:
The node-wise list of fields.
- Return type:
list[list[str]]
- abstract property nDof: int
The total number of degrees of freedom this constraint is associated with.
- Returns:
The total number of degrees of freedom.
- Return type:
int
- abstract property name: str
The name of this constraint.
- Returns:
The name.
- Return type:
str
- abstract property nodes: list[Node]
The nodes this constraint is acting on. Duplicates are _allowed_.
- Returns:
The list of nodes.
- Return type:
list[Node]
- abstract property scalarVariables: list[ScalarVariable]
The list of assigned ScalarVariable.
- Returns:
The list of scalar variables.
- Return type:
list[ScalarVariable]
PenaltyEqualValue constraint class
- class edelweissmeshfree.constraints.penaltyequalvalue.PenaltyEqualValue(name, model, constrainedMaterialPoints, field, prescribedComponent, penaltyParameter)[source]
Initialize the VIJEntityBase.
- Attributes:
activeWhether this constraint is active or not.
fieldsOnNodesThe fields on the nodes this constraint is acting on.
nDofThe total number of degrees of freedom this constraint is associated with.
nameThe name of this constraint.
nodesThe nodes this constraint is acting on.
scalarVariablesThe list of assigned ScalarVariable.
- Parameters:
name (str)
model (MPMModel)
constrainedMaterialPoints (list[MaterialPointBase])
field (str)
prescribedComponent (int)
penaltyParameter (float)
Methods
applyConstraint(dU, PExt, V, timeStep)Apply the constraint, i.e., compute the 'kernels'.
assignAdditionalScalarVariables(scalarVariables)This is the list of constraint specific scalar variables which are assigned to this constraint.
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
getVIJContributionSize()Return the number of entries this entity contributes to the VIJ (COO) system matrix.
initializeVIJContribution(idcs, I_, J_, offset)Fill the global
IandJindex arrays for this constraint's VIJ contribution.updateConnectivity(model)This method is called before each new timeStep, after material point connectivity was updated, but before the global equation system is created.
- applyConstraint(dU, PExt, V, timeStep)[source]
Apply the constraint, i.e., compute the ‘kernels’. Add the contributions to the external load vector and the system matrix.
- Parameters:
dU (ndarray) – The current increment since the last time the constraint was applied.
PExt (ndarray) – The external load vector.
V (ndarray) – The system (stiffness) matrix.
timeStep (TimeStep) – The current step and total time.
- assignAdditionalScalarVariables(scalarVariables)[source]
This is the list of constraint specific scalar variables which are assigned to this constraint.
- Parameters:
scalarVariables (list[ScalarVariable]) – The list of ScalarVariable to be assigned.
- getNumberOfAdditionalNeededScalarVariables()[source]
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
- Returns:
The number of requested ScalarVariable
- Return type:
int
- updateConnectivity(model)[source]
This method is called before each new timeStep, after material point connectivity was updated, but before the global equation system is created. If the contribution to the global system changes, True is returned.
- Parameters:
model – The current model.
- Returns:
The truth value if the connectivity has changed.
- Return type:
bool
- property fieldsOnNodes: list
The fields on the nodes this constraint is acting on.
- Returns:
The node-wise list of fields.
- Return type:
list[list[str]]
- property nDof: int
The total number of degrees of freedom this constraint is associated with.
- Returns:
The total number of degrees of freedom.
- Return type:
int
- property name: str
The name of this constraint.
- Returns:
The name.
- Return type:
str
- property nodes: list
The nodes this constraint is acting on. Duplicates are _allowed_.
- Returns:
The list of nodes.
- Return type:
list[Node]
- property scalarVariables: list
The list of assigned ScalarVariable.
- Returns:
The list of scalar variables.
- Return type:
list[ScalarVariable]
PenaltyConstrainMP2Node constraint class
- class edelweissmeshfree.constraints.penaltyconstrainmp2node.PenaltyConstrainMP2Node(name, model, slaveMP, masterNode, field, prescribedComponents, penaltyParameter)[source]
Initialize the VIJEntityBase.
- Attributes:
activeWhether this constraint is active or not.
fieldsOnNodesThe fields on the nodes this constraint is acting on.
nDofThe total number of degrees of freedom this constraint is associated with.
nameThe name of this constraint.
nodesThe nodes this constraint is acting on.
scalarVariablesThe list of assigned ScalarVariable.
- Parameters:
name (str)
model (MPMModel)
slaveMP (MaterialPointBase)
masterNode (Node)
field (str)
prescribedComponents (list[int])
penaltyParameter (float)
Methods
applyConstraint(dU, PExt, V, timeStep)Apply the penalty constraint to the residual and stiffness matrix.
assignAdditionalScalarVariables(scalarVariables)This is the list of constraint specific scalar variables which are assigned to this constraint.
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
getVIJContributionSize()Return the number of entries this entity contributes to the VIJ (COO) system matrix.
initializeVIJContribution(idcs, I_, J_, offset)Fill the global
IandJindex arrays for this constraint's VIJ contribution.updateConnectivity(model)Update the connectivity of the constraint.
- applyConstraint(dU, PExt, V, timeStep)[source]
Apply the penalty constraint to the residual and stiffness matrix.
- Parameters:
dU (ndarray) – The displacement vector.
PExt (ndarray) – The external force vector.
V (ndarray) – The stiffness matrix.
timeStep (TimeStep) – The time step.
- assignAdditionalScalarVariables(scalarVariables)[source]
This is the list of constraint specific scalar variables which are assigned to this constraint.
- Parameters:
scalarVariables (list[ScalarVariable]) – The list of ScalarVariable to be assigned.
- getNumberOfAdditionalNeededScalarVariables()[source]
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
- Returns:
The number of requested ScalarVariable
- Return type:
int
- updateConnectivity(model)[source]
Update the connectivity of the constraint.
- Parameters:
model (MPMModel) – The full MPMModel instance.
- Returns:
True if the connectivity has changed, False otherwise.
- Return type:
bool
- property fieldsOnNodes: list
The fields on the nodes this constraint is acting on.
- Returns:
The node-wise list of fields.
- Return type:
list[list[str]]
- property nDof: int
The total number of degrees of freedom this constraint is associated with.
- Returns:
The total number of degrees of freedom.
- Return type:
int
- property name: str
The name of this constraint.
- Returns:
The name.
- Return type:
str
- property nodes: list
The nodes this constraint is acting on. Duplicates are _allowed_.
- Returns:
The list of nodes.
- Return type:
list[Node]
- property scalarVariables: list
The list of assigned ScalarVariable.
- Returns:
The list of scalar variables.
- Return type:
list[ScalarVariable]
PenaltyWeakDirichlet constraint class
- class edelweissmeshfree.constraints.penaltyweakdirichlet.PenaltyWeakDirichlet(name, model, constrainedMaterialPoints, field, prescribedStepDelta, penaltyParameter, **kwargs)[source]
Initialize the VIJEntityBase.
- Attributes:
activeWhether this constraint is active or not.
fieldsOnNodesThe fields on the nodes this constraint is acting on.
nDofThe total number of degrees of freedom this constraint is associated with.
nameThe name of this constraint.
nodesThe nodes this constraint is acting on.
scalarVariablesThe list of assigned ScalarVariable.
- Parameters:
name (str)
model (MPMModel)
constrainedMaterialPoints (list[MaterialPointBase])
field (str)
prescribedStepDelta (dict)
penaltyParameter (float)
Methods
applyConstraint(dU, PExt, V, timeStep)Apply the constraint, i.e., compute the 'kernels'.
assignAdditionalScalarVariables(scalarVariables)This is the list of constraint specific scalar variables which are assigned to this constraint.
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
getVIJContributionSize()Return the number of entries this entity contributes to the VIJ (COO) system matrix.
initializeVIJContribution(idcs, I_, J_, offset)Fill the global
IandJindex arrays for this constraint's VIJ contribution.updateConnectivity(model)This method is called before each new timeStep, after material point connectivity was updated, but before the global equation system is created.
- applyConstraint(dU, PExt, V, timeStep)[source]
Apply the constraint, i.e., compute the ‘kernels’. Add the contributions to the external load vector and the system matrix.
- Parameters:
dU (ndarray) – The current increment since the last time the constraint was applied.
PExt (ndarray) – The external load vector.
V (ndarray) – The system (stiffness) matrix.
timeStep (TimeStep) – The current step and total time.
- assignAdditionalScalarVariables(scalarVariables)[source]
This is the list of constraint specific scalar variables which are assigned to this constraint.
- Parameters:
scalarVariables (list[ScalarVariable]) – The list of ScalarVariable to be assigned.
- getNumberOfAdditionalNeededScalarVariables()[source]
Tell the framework how many scalar variables (e.g., Lagrangian multipliers) this constraint needs.
- Returns:
The number of requested ScalarVariable
- Return type:
int
- updateConnectivity(model)[source]
This method is called before each new timeStep, after material point connectivity was updated, but before the global equation system is created. If the contribution to the global system changes, True is returned.
- Parameters:
model – The current model.
- Returns:
The truth value if the connectivity has changed.
- Return type:
bool
- property fieldsOnNodes: list
The fields on the nodes this constraint is acting on.
- Returns:
The node-wise list of fields.
- Return type:
list[list[str]]
- property nDof: int
The total number of degrees of freedom this constraint is associated with.
- Returns:
The total number of degrees of freedom.
- Return type:
int
- property name: str
The name of this constraint.
- Returns:
The name.
- Return type:
str
- property nodes: list
The nodes this constraint is acting on. Duplicates are _allowed_.
- Returns:
The list of nodes.
- Return type:
list[Node]
- property scalarVariables: list
The list of assigned ScalarVariable.
- Returns:
The list of scalar variables.
- Return type:
list[ScalarVariable]