Description
Constraint combining two tuples, each referencing 1, 2, or 3 variable objects.
This allows representing a constraint between two objects with different number of variable sets. Typically used for implementing unilateral contact constraints, this could represent for example a contact between an edge with 2 "xyz" variables and a triangle with 3 "xyz" variables; in this case, the contact constraint Jacobian is split in 2 + 3 chunks.
#include <ChConstraintTwoTuples.h>


Public Member Functions | |
| ChConstraintTwoTuples (const ChConstraintTwoTuples &other) | |
| virtual ChConstraintTwoTuples * | Clone () const override |
| "Virtual" copy constructor (covariant return type). | |
| ChConstraintTwoTuples & | operator= (const ChConstraintTwoTuples &other) |
| Assignment operator: copy from other object. | |
| ChConstraintTuple * | TupleA () |
| Access tuple a. | |
| ChConstraintTuple * | TupleB () |
| Access tuple b. | |
| void | SetTuples (ChConstraintTuple *tupleA, ChConstraintTuple *tupleB) |
| Set the two tuples. | |
| void | SetTuplesFromContactables (ChContactable *objA, ChContactable *objB) |
| Set the two tuples from two contactable objects. | |
| virtual void | UpdateAuxiliary () override |
| This function updates the following auxiliary data: More... | |
| virtual double | ComputeJacobianTimesState () override |
| Compute the product between the Jacobian of this constraint, [Cq_i], and the vector of variables. More... | |
| virtual void | IncrementState (double deltal) override |
| Increment the vector of variables with the quantity [invM]*[Cq_i]'*deltal. More... | |
| virtual void | AddJacobianTimesVectorInto (double &result, ChVectorConstRef vect) const override |
| Add the product of the corresponding block in the system matrix by 'vect' and add to result. More... | |
| virtual void | AddJacobianTransposedTimesScalarInto (ChVectorRef result, double l) const override |
| Add the product of the corresponding transposed block in the system matrix by 'l' and add to result. More... | |
| virtual void | PasteJacobianInto (ChSparseMatrix &mat, unsigned int start_row, unsigned int start_col) const override |
| Write the constraint Jacobian into the specified global matrix at the offsets of the associated variables. More... | |
| virtual void | PasteJacobianTransposedInto (ChSparseMatrix &mat, unsigned int start_row, unsigned int start_col) const override |
| Write the transposed constraint Jacobian into the specified global matrix at the offsets of the associated variables. More... | |
Public Member Functions inherited from chrono::ChConstraint | |
| ChConstraint (const ChConstraint &other) | |
| ChConstraint & | operator= (const ChConstraint &other) |
| Assignment operator: copy from other object. | |
| bool | operator== (const ChConstraint &other) const |
| Comparison (compares only flags, not the Jacobians). | |
| bool | IsValid () const |
| Indicate if the constraint data is currently valid. | |
| void | SetValid (bool mon) |
| Set the "valid" state of this constraint. | |
| bool | IsDisabled () const |
| Indicate if the constraint is currently turned on or off. | |
| void | SetDisabled (bool mon) |
| bool | IsRedundant () const |
| Indicate if the constraint is redundant or singular. | |
| void | SetRedundant (bool mon) |
| Mark the constraint as redundant. | |
| bool | IsBroken () const |
| Indicate if the constraint is broken, due to excess pulling/pushing. | |
| void | SetBroken (bool mon) |
| Set the constraint as broken. More... | |
| virtual bool | IsUnilateral () const |
| Indicate if the constraint is unilateral (typical complementarity constraint). | |
| virtual bool | IsLinear () const |
| Indicate if the constraint is linear. | |
| Mode | GetMode () const |
| Get the mode of the constraint. More... | |
| void | SetMode (Mode mmode) |
| Set the mode of the constraint. | |
| bool | IsActive () const |
| Indicate whether the constraint is currently active. More... | |
| void | SetActive (bool isactive) |
| Set the status of the constraint to active. | |
| virtual double | ComputeResidual () |
| Compute the residual of the constraint using the linear expression. More... | |
| double | GetResidual () const |
| Return the residual of this constraint. | |
| void | SetRightHandSide (const double mb) |
| Sets the known term b_i in [Cq_i]*q + b_i = 0, where: c_i = [Cq_i]*q + b_i = 0. | |
| double | GetRightHandSide () const |
| Return the known term b_i in [Cq_i]*q + b_i = 0, where: c_i= [Cq_i]*q + b_i = 0. | |
| void | SetComplianceTerm (const double mcfm) |
| Set the constraint force mixing term (default=0). More... | |
| double | GetComplianceTerm () const |
| Return the constraint force mixing term. | |
| void | SetLagrangeMultiplier (double ml_i) |
| Set the value of the corresponding Lagrange multiplier (constraint reaction). | |
| double | GetLagrangeMultiplier () const |
| Return the corresponding Lagrange multiplier (constraint reaction). | |
| double | GetSchurComplement () const |
| Return the 'g_i' product, that is [Cq_i]*[invM_i]*[Cq_i]' (+cfm) | |
| void | SetSchurComplement (double m_g_i) |
| Usually you should not use the SetSchurComplement function, because g_i should be automatically computed during the UpdateAuxiliary() . | |
| virtual void | Project () |
| Project the value of a possible 'l_i' value of constraint reaction onto admissible orthant/set. More... | |
| virtual double | Violation (double mc_i) |
| Return the constraint violation. More... | |
| void | SetOffset (unsigned int off) |
| Set offset in global q vector (set automatically by ChSystemDescriptor) | |
| unsigned int | GetOffset () const |
| Get offset in global q vector. | |
| virtual void | ArchiveOut (ChArchiveOut &archive_out) |
| Method to allow serialization of transient data to archives. | |
| virtual void | ArchiveIn (ChArchiveIn &archive_in) |
| Method to allow de-serialization of transient data from archives. | |
Protected Attributes | |
| ChConstraintTuple * | tuple_a |
| ChConstraintTuple * | tuple_b |
Protected Attributes inherited from chrono::ChConstraint | |
| double | c_i |
| constraint residual (if satisfied, c must be 0) | |
| double | l_i |
| Lagrange multiplier (reaction) | |
| double | b_i |
| right-hand side term in [Cq_i]*q+b_i=0 , note: c_i= [Cq_i]*q + b_i | |
| double | cfm_i |
| Constraint force mixing if needed to add some numerical 'compliance' in the constraint. More... | |
| Mode | mode |
| mode of the constraint | |
| double | g_i |
| product [Cq_i]*[invM_i]*[Cq_i]' (+cfm) | |
| unsigned int | offset |
| offset in global "l" state vector (needed by some solvers) | |
Additional Inherited Members | |
Public Types inherited from chrono::ChConstraint | |
| enum | Mode { Mode::FREE, Mode::LOCK, Mode::UNILATERAL, Mode::FRICTION } |
| Constraint mode. More... | |
Member Function Documentation
◆ AddJacobianTimesVectorInto()
|
overridevirtual |
Add the product of the corresponding block in the system matrix by 'vect' and add to result.
Note: 'vect' is assumed to be of proper size; the procedure uses the ChVariable offsets to index in 'vect'.
Implements chrono::ChConstraint.
◆ AddJacobianTransposedTimesScalarInto()
|
overridevirtual |
Add the product of the corresponding transposed block in the system matrix by 'l' and add to result.
Note: 'result' is assumed to be of proper size; the procedure uses the ChVariable offsets to index in 'result'.
Implements chrono::ChConstraint.
◆ ComputeJacobianTimesState()
|
overridevirtual |
Compute the product between the Jacobian of this constraint, [Cq_i], and the vector of variables.
In other words, perform the operation:
CV = [Cq_i] * v
Implements chrono::ChConstraint.
◆ IncrementState()
|
overridevirtual |
Increment the vector of variables with the quantity [invM]*[Cq_i]'*deltal.
In other words, perform the operation:
v += [invM] * [Cq_i]' * deltal or else v+=[Eq_i] * deltal
Implements chrono::ChConstraint.
◆ PasteJacobianInto()
|
overridevirtual |
Write the constraint Jacobian into the specified global matrix at the offsets of the associated variables.
The (start_row, start_col) pair specifies the top-left corner of the system-level constraint Jacobian in the provided matrix.
Implements chrono::ChConstraint.
◆ PasteJacobianTransposedInto()
|
overridevirtual |
Write the transposed constraint Jacobian into the specified global matrix at the offsets of the associated variables.
The (start_row, start_col) pair specifies the top-left corner of the system-level constraint Jacobian in the provided matrix.
Implements chrono::ChConstraint.
◆ UpdateAuxiliary()
|
overridevirtual |
This function updates the following auxiliary data:
- the Eq_a and Eq_b matrices
- the g_i product This function is often called by solvers at the beginning of the solution process. Note: This function must be overridden by specialized derived classes, which have some Jacobians.
Reimplemented from chrono::ChConstraint.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono/solver/ChConstraintTwoTuples.h
- /builds/uwsbel/chrono/src/chrono/solver/ChConstraintTwoTuples.cpp
Public Member Functions inherited from