Project Chrono: chrono::ChConstraintThree Class Reference

Public Member Functions | Protected Attributes | List of all members
chrono::ChConstraintThree Class Referenceabstract

## Description

This class is inherited by the base ChConstraint(), which does almost nothing.

So here this class implements the functionality for a constraint between a THREE objects of type ChVariables(), and defines three constraint matrices, whose column number automatically matches the number of elements in variables vectors. Before starting the solver one must provide the proper values in constraints (and update them if necessary), i.e. must set at least the c_i and b_i values, and jacobians.

`#include <ChConstraintThree.h>`

Inheritance diagram for chrono::ChConstraintThree:
[legend]
Collaboration diagram for chrono::ChConstraintThree:
[legend]

## Public Member Functions
| ChConstraintThree ()
| Default constructor.
| ChConstraintThree (const ChConstraintThree &other)
| Copy constructor.
ChConstraintThree & | operator= (const ChConstraintThree &other)
| Assignment operator: copy from other object.
virtual ChRowVectorRef | Get_Cq_a ()=0
| Access jacobian vector.
virtual ChRowVectorRef | Get_Cq_b ()=0
| Access jacobian vector.
virtual ChRowVectorRef | Get_Cq_c ()=0
| Access jacobian vector.
virtual ChVectorRef | Get_Eq_a ()=0
| Access auxiliary vector (ex: used by iterative solvers).
virtual ChVectorRef | Get_Eq_b ()=0
| Access auxiliary vector (ex: used by iterative solvers).
virtual ChVectorRef | Get_Eq_c ()=0
| Access auxiliary vector (ex: used by iterative solvers).
ChVariables * | GetVariables_a ()
| Access the first variable object.
ChVariables * | GetVariables_b ()
| Access the second variable object.
ChVariables * | GetVariables_c ()
| Access the second variable object.
virtual void | SetVariables (ChVariables *mvariables_a, ChVariables *mvariables_b, ChVariables *mvariables_c)=0
| Set references to the constrained objects, each of ChVariables type, automatically creating/resizing jacobians if needed.
virtual void | ArchiveOut (ChArchiveOut &archive_out) override
| Method to allow serialization of transient data to archives.
virtual void | ArchiveIn (ChArchiveIn &archive_in) override
| Method to allow de serialization of transient data from archives.
Public Member Functions inherited from chrono::ChConstraint
| ChConstraint (const ChConstraint &other)
virtual ChConstraint * | Clone () const =0
| "Virtual" copy constructor.
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.
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.
void | SetMode (Mode mmode)
| Set the mode of the constraint.
bool | IsActive () const
| Indicate whether the constraint is currently active.
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.
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).
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).
virtual void | Update_auxiliary ()
| This function updates the following auxiliary data:
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 Update_auxiliary() .
virtual double | ComputeJacobianTimesState ()=0
| Compute the product between the Jacobian of this constraint, [Cq_i], and the vector of variables.
virtual void | IncrementState (double deltal)=0
| Increment the vector of variables with the quantity [invM]*[Cq_i]'*deltal.
virtual void | AddJacobianTimesVectorInto (double &result, ChVectorConstRef vect) const =0
| Add the product of the corresponding block in the system matrix by 'vect' and add to result.
virtual void | AddJacobianTransposedTimesScalarInto (ChVectorRef result, double l) const =0
| Add the product of the corresponding transposed block in the system matrix by 'l' and add to result.
virtual void | Project ()
| Project the value of a possible 'l_i' value of constraint reaction onto admissible orthant/set.
virtual double | Violation (double mc_i)
| Return the constraint violation.
virtual void | PasteJacobianInto (ChSparseMatrix &mat, unsigned int start_row, unsigned int start_col) const =0
| Write the constraint Jacobian into the specified global matrix at the offsets of the associated variables.
virtual void | PasteJacobianTransposedInto (ChSparseMatrix &mat, unsigned int start_row, unsigned int start_col) const =0
| Write the transposed constraint Jacobian into the specified global matrix at the offsets of the associated variables.
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.

## Protected Attributes
ChVariables * | variables_a
| The first constrained object.
ChVariables * | variables_b
| The second constrained object.
ChVariables * | variables_c
| The third constrained object.
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.
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 class | Mode { FREE , LOCK , UNILATERAL , FRICTION }
| Constraint mode. More...

## Member Function Documentation

## ◆ ArchiveIn()

void chrono::ChConstraintThree::ArchiveIn | ( | ChArchiveIn & | archive_in | ) |
| overridevirtual

Method to allow de serialization of transient data from archives.

Reimplemented from chrono::ChConstraint.

Reimplemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ ArchiveOut()

void chrono::ChConstraintThree::ArchiveOut | ( | ChArchiveOut & | archive_out | ) |
| overridevirtual

Method to allow serialization of transient data to archives.

Reimplemented from chrono::ChConstraint.

Reimplemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ Get_Cq_a()

virtual ChRowVectorRef chrono::ChConstraintThree::Get_Cq_a | ( |  | ) |
| pure virtual

Access jacobian vector.

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ Get_Cq_b()

virtual ChRowVectorRef chrono::ChConstraintThree::Get_Cq_b | ( |  | ) |
| pure virtual

Access jacobian vector.

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ Get_Cq_c()

virtual ChRowVectorRef chrono::ChConstraintThree::Get_Cq_c | ( |  | ) |
| pure virtual

Access jacobian vector.

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ Get_Eq_a()

virtual ChVectorRef chrono::ChConstraintThree::Get_Eq_a | ( |  | ) |
| pure virtual

Access auxiliary vector (ex: used by iterative solvers).

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ Get_Eq_b()

virtual ChVectorRef chrono::ChConstraintThree::Get_Eq_b | ( |  | ) |
| pure virtual

Access auxiliary vector (ex: used by iterative solvers).

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ Get_Eq_c()

virtual ChVectorRef chrono::ChConstraintThree::Get_Eq_c | ( |  | ) |
| pure virtual

Access auxiliary vector (ex: used by iterative solvers).

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

## ◆ SetVariables()

virtual void chrono::ChConstraintThree::SetVariables | ( | ChVariables * | mvariables_a,
|  | ChVariables * | mvariables_b,
|  | ChVariables * | mvariables_c )
| pure virtual

Set references to the constrained objects, each of ChVariables type, automatically creating/resizing jacobians if needed.

Implemented in chrono::ChConstraintThreeBBShaft, and chrono::ChConstraintThreeGeneric.

The documentation for this class was generated from the following files:

- D:/W/B/src/chrono-9.0.1/src/chrono/solver/ChConstraintThree.h
- D:/W/B/src/chrono-9.0.1/src/chrono/solver/ChConstraintThree.cpp