Project Chrono: chrono::ChVariablesShaft Class Reference

Public Member Functions | List of all members
chrono::ChVariablesShaft Class Reference

## Description

Specialized class for representing a 1-DOF item for a system, that is a shaft, with inertia and associated variable (rotational speed).

`#include <ChVariablesShaft.h>`

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

## Public Member Functions
ChVariablesShaft & | operator= (const ChVariablesShaft &other)
| Assignment operator: copy from other object.
double | GetInertia () const
| Get the inertia associated with rotation of the shaft.
double | GetInvInertia () const
| Get the inverse of the inertia associated with rotation of the shaft.
void | SetInertia (double inertia)
| Set the inertia associated with rotation of the shaft.
ChShaft * | GetShaft ()
void | SetShaft (ChShaft *shaft)
virtual void | ComputeMassInverseTimesVector (ChVectorRef result, ChVectorConstRef vect) const override
| Compute the product of the inverse mass matrix by a given vector and store in result.
virtual void | AddMassTimesVector (ChVectorRef result, ChVectorConstRef vect) const override
| Compute the product of the mass matrix by a given vector and increment result.
virtual void | AddMassTimesVectorInto (ChVectorRef result, ChVectorConstRef vect, const double ca) const override
| Add the product of the mass submatrix by a given vector, scaled by ca, to result.
virtual void | AddMassDiagonalInto (ChVectorRef result, const double ca) const override
| Add the diagonal of the mass matrix, as a vector scaled by ca, to result.
virtual void | PasteMassInto (ChSparseMatrix &mat, unsigned int start_row, unsigned int start_col, const double ca) const override
| Write the mass submatrix for these variables into the specified global matrix at the offsets of each variable.
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::ChVariables
| ChVariables (unsigned int dof)
ChVariables & | operator= (const ChVariables &other)
| Assignment operator: copy from other object.
void | SetDisabled (bool mdis)
| Deactivates/freezes the variable (these variables won't be modified by the system solver).
bool | IsDisabled () const
| Check if the variables have been deactivated (these variables won't be modified by the system solver).
bool | IsActive () const
| Check if these variables are currently active.
unsigned int | GetDOF () const
| The number of scalar variables in the vector qb (dof=degrees of freedom).
ChVectorRef | State ()
| Get a reference to the differential states encapsulated by these variables.
ChVectorRef | Force ()
| Get a reference to the generalized force corresponding to these variables.
void | SetOffset (unsigned int moff)
| Set offset in the global state vector.
unsigned int | GetOffset () const
| Get offset in the global state vector.

## Additional Inherited Members
Protected Attributes inherited from chrono::ChVariables
unsigned int | offset
| offset in global q state vector (needed by some solvers)
unsigned int | ndof
| number of degrees of freedom (number of contained scalar variables)

## Member Function Documentation

## ◆ AddMassDiagonalInto()

void chrono::ChVariablesShaft::AddMassDiagonalInto | ( | ChVectorRef | result,
|  | const double | ca ) const
| overridevirtual

Add the diagonal of the mass matrix, as a vector scaled by ca, to result.

Note: 'result' is a system-level vector of appropriate size. This function must index into this vector using the offsets of each variable.

Implements chrono::ChVariables.

## ◆ AddMassTimesVector()

void chrono::ChVariablesShaft::AddMassTimesVector | ( | ChVectorRef | result,
|  | ChVectorConstRef | vect ) const
| overridevirtual

Compute the product of the mass matrix by a given vector and increment result.

This function must perform the operation result += M * vect for a vector of same size as the variables state.

Implements chrono::ChVariables.

## ◆ AddMassTimesVectorInto()

void chrono::ChVariablesShaft::AddMassTimesVectorInto | ( | ChVectorRef | result,
|  | ChVectorConstRef | vect,
|  | const double | ca ) const
| overridevirtual

Add the product of the mass submatrix by a given vector, scaled by ca, to result.

Note: 'result' and 'vect' are system-level vectors of appropriate size. This function must index into these vectors using the offsets of each variable.

Implements chrono::ChVariables.

## ◆ ArchiveIn()

virtual void chrono::ChVariablesShaft::ArchiveIn | ( | ChArchiveIn & | archive_in | ) |
| inlineoverridevirtual

Method to allow de-serialization of transient data from archives.

Reimplemented from chrono::ChVariables.

## ◆ ArchiveOut()

virtual void chrono::ChVariablesShaft::ArchiveOut | ( | ChArchiveOut & | archive_out | ) |
| inlineoverridevirtual

Method to allow serialization of transient data to archives.

Reimplemented from chrono::ChVariables.

## ◆ ComputeMassInverseTimesVector()

void chrono::ChVariablesShaft::ComputeMassInverseTimesVector | ( | ChVectorRef | result,
|  | ChVectorConstRef | vect ) const
| overridevirtual

Compute the product of the inverse mass matrix by a given vector and store in result.

This function must calculate result = M^(-1) * vect for a vector of same size as the variables state.

Implements chrono::ChVariables.

## ◆ PasteMassInto()

void chrono::ChVariablesShaft::PasteMassInto | ( | ChSparseMatrix & | mat,
|  | unsigned int | start_row,
|  | unsigned int | start_col,
|  | const double | ca ) const
| overridevirtual

Write the mass submatrix for these variables into the specified global matrix at the offsets of each variable.

The masses will be scaled by the given factor 'ca'. The (start_row, start_col) pair specifies the top-left corner of the system-level mass matrix in the provided matrix. Assembling the system-level sparse matrix is required only if using a direct sparse solver or for debugging/reporting purposes.

Implements chrono::ChVariables.

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

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