chrono::ChVariablesBody Class Referenceabstract

## Description

Specialized class for representing a 6-DOF item for a system, that is a 3D rigid body, with mass matrix and associate variables (a 6 element vector, ex.speed) This is an abstract class, specialized for example in ChVariablesBodyOwnMass and ChVariablesBodySharedMass.

`#include <ChVariablesBody.h>`

Inheritance diagram for chrono::ChVariablesBody:

Collaboration diagram for chrono::ChVariablesBody:

## Public Member Functions | |

ChVariablesBody & | operator= (const ChVariablesBody &other) |

Assignment operator: copy from other object. | |

virtual double | GetBodyMass () const =0 |

Get the mass associated with translation of body. | |

virtual ChMatrix33 & | GetBodyInertia ()=0 |

Access the 3x3 inertia matrix. | |

virtual const ChMatrix33 & | GetBodyInertia () const =0 |

virtual ChMatrix33 & | GetBodyInvInertia ()=0 |

Access the 3x3 inertia matrix inverted. | |

virtual const ChMatrix33 & | GetBodyInvInertia () const =0 |

virtual int | Get_ndof () const override |

The number of scalar variables in the vector qb (dof=degrees of freedom) | |

void * | GetUserData () |

void | SetUserData (void *mdata) |

Public Member Functions inherited from chrono::ChVariables | |

ChVariables (int m_ndof) | |

ChVariables & | operator= (const ChVariables &other) |

Assignment operator: copy from other object. | |

void | SetDisabled (bool mdis) |

Deactivates/freezes the variable (these 'frozen', variables won't be modified by the system solver). More... | |

bool | IsDisabled () const |

Tells if the variables have been deactivated (these 'frozen', variables won't be modified by the system solver). More... | |

bool | IsActive () const |

Tells if these variables are currently active, in general, that is tells if they must be included into the system solver or not. More... | |

ChMatrix & | Get_qb () |

Returns reference to qb, body-relative part of degrees of freedom q in system: | M -Cq'|*|q|- | f|= |0| , c>0, l>0, l*r=0; | Cq 0 | |l| |-b| |c|. | |

virtual void | Compute_fb () |

Compute fb, body-relative part of known vector f in system. More... | |

ChMatrix & | Get_fb () |

Returns reference to fb, body-relative part of known vector f in system. More... | |

virtual void | Compute_invMb_v (ChMatrix< double > &result, const ChMatrix< double > &vect) const =0 |

Computes the product of the inverse mass matrix by a vector, and store in result: result = [invMb]*vect *** This function MUST BE OVERRIDDEN by specialized inherited classes. | |

virtual void | Compute_inc_invMb_v (ChMatrix< double > &result, const ChMatrix< double > &vect) const =0 |

Computes the product of the inverse mass matrix by a vector, and increment result: result += [invMb]*vect *** This function MUST BE OVERRIDDEN by specialized inherited classes. | |

virtual void | Compute_inc_Mb_v (ChMatrix< double > &result, const ChMatrix< double > &vect) const =0 |

Computes the product of the mass matrix by a vector, and increment result: result = [Mb]*vect *** This function MUST BE OVERRIDDEN by specialized inherited classes. | |

virtual void | MultiplyAndAdd (ChMatrix< double > &result, const ChMatrix< double > &vect, const double c_a) const =0 |

Computes the product of the corresponding block in the system matrix (ie. More... | |

virtual void | DiagonalAdd (ChMatrix< double > &result, const double c_a) const =0 |

Add the diagonal of the mass matrix scaled by c_a, to 'result', as a vector. More... | |

virtual void | Build_M (ChSparseMatrix &storage, int insrow, int inscol, const double c_a)=0 |

Build the mass submatrix (for these variables) multiplied by c_a, storing it in 'storage' sparse matrix, at given column/row offset. More... | |

void | SetOffset (int moff) |

Set offset in global q vector (set automatically by ChSystemDescriptor) | |

int | GetOffset () const |

Get offset in global q vector. | |

virtual void | ArchiveOUT (ChArchiveOut &marchive) |

virtual void | ArchiveIN (ChArchiveIn &marchive) |

## Additional Inherited Members | |

Protected Attributes inherited from chrono::ChVariables | |

int | offset |

offset in global q state vector (needed by some solvers) | |