MULTIBODY SIMULATION SOFTWARE - API documentation
Public Member Functions
chrono::ChLcpVariables Class Reference

#include <CHlcpVariables.h>

Inheritance diagram for chrono::ChLcpVariables:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ChLcpVariables (int m_ndof)
ChLcpVariablesoperator= (const ChLcpVariables &other)
void SetDisabled (bool mdis)
bool IsDisabled ()
bool IsActive ()
virtual int Get_ndof ()
ChMatrixGet_qb ()
virtual void Compute_fb ()
ChMatrixGet_fb ()
virtual void Compute_invMb_v (ChMatrix< float > &result, const ChMatrix< float > &vect)=0
virtual void Compute_invMb_v (ChMatrix< double > &result, const ChMatrix< double > &vect)=0
virtual void Compute_inc_invMb_v (ChMatrix< float > &result, const ChMatrix< float > &vect)=0
virtual void Compute_inc_invMb_v (ChMatrix< double > &result, const ChMatrix< double > &vect)=0
virtual void Compute_Mb_v (ChMatrix< float > &result, const ChMatrix< float > &vect)=0
virtual void Compute_Mb_v (ChMatrix< double > &result, const ChMatrix< double > &vect)=0
virtual void Build_M (ChSparseMatrix &storage, int insrow, int inscol)=0
void SetOffset (int moff)
int GetOffset ()

Detailed Description

Base class for representing LCP items which introduce 'variables', that is variables 'v' (and associated masses M) for a sparse linear complemetarity problem in the form:

| M -Cq'|*|v|- | f|= |0| , c>0, l>0, l*c=0; | Cq 0 | |l| |-b| |c|

(where all masses and variables are assembled in huge matrices, but there's no need to really build such matrices, in order to exploit sparsity).

Note: in sake of highest generalization, this base class does NOT include a mass submatrix (a sub part of the M matrix) but just declares the methods Compute_invMb_v() and Compute_Mb_v() (which are used by iterative solvers) and Build_M() (which is used by simplex solver), which MUST be implemented by child classes. This doing, some child classes too may implement all three methods without needing to store entire mass submatrices, if possible, in sake of efficiency.


Member Function Documentation

virtual void chrono::ChLcpVariables::Build_M ( ChSparseMatrix storage,
int  insrow,
int  inscol 
) [pure virtual]

Build the mass submatrix (for these variables) storing it in 'storage' sparse matrix, at given column/row offset. This function is used only by the ChLcpSimplex solver (iterative solvers don't need to know jacobians explicitly) This function MUST BE OVERRIDDEN by specialized inherited classes

Implemented in chrono::ChLcpVariablesBodySharedMass, chrono::ChLcpVariablesBodyOwnMass, chrono::ChLcpVariablesNode, and chrono::ChLcpVariablesGeneric.

virtual void chrono::ChLcpVariables::Compute_fb ( ) [virtual]

Compute fb, body-relative part of known vector f in system. This function MAY BE OVERRIDDEN by specialized inherited classes (example, for impulsive multibody simulation, this may be fb=dt*Forces+[M]*previous_v ). Another option is to set values into fb vectors, accessing them by Get_fb() from an external procedure, for each body, before starting the LCP solver.

virtual void chrono::ChLcpVariables::Compute_inc_invMb_v ( ChMatrix< float > &  result,
const ChMatrix< float > &  vect 
) [pure virtual]

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

Implemented in chrono::ChLcpVariablesBodySharedMass, chrono::ChLcpVariablesBodyOwnMass, chrono::ChLcpVariablesGeneric, and chrono::ChLcpVariablesNode.

virtual void chrono::ChLcpVariables::Compute_invMb_v ( ChMatrix< float > &  result,
const ChMatrix< float > &  vect 
) [pure virtual]

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

Implemented in chrono::ChLcpVariablesBodySharedMass, chrono::ChLcpVariablesBodyOwnMass, chrono::ChLcpVariablesGeneric, and chrono::ChLcpVariablesNode.

virtual void chrono::ChLcpVariables::Compute_Mb_v ( ChMatrix< float > &  result,
const ChMatrix< float > &  vect 
) [pure virtual]

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

Implemented in chrono::ChLcpVariablesBodySharedMass, chrono::ChLcpVariablesBodyOwnMass, chrono::ChLcpVariablesNode, and chrono::ChLcpVariablesGeneric.

ChMatrix& chrono::ChLcpVariables::Get_fb ( )

Returns reference to fb, body-relative part of known vector f in system. | M -Cq'|*|q|- | f|= |0| , c>0, l>0, l*r=0; | Cq 0 | |l| |-b| |c| This function can be used to set values of fb vector before starting the LCP solver.

virtual int chrono::ChLcpVariables::Get_ndof ( ) [virtual]

The number of scalar variables in the vector qb (dof=degrees of freedom) This function MUST BE OVERRIDDEN by specialized inherited classes.

Reimplemented in chrono::ChLcpVariablesGeneric, chrono::ChLcpVariablesNode, and chrono::ChLcpVariablesBody.

ChMatrix& chrono::ChLcpVariables::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|

bool chrono::ChLcpVariables::IsActive ( )

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

bool chrono::ChLcpVariables::IsDisabled ( )

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

void chrono::ChLcpVariables::SetDisabled ( bool  mdis)

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

void chrono::ChLcpVariables::SetOffset ( int  moff)

Set offset in global state (not needed by iterative solvers, but simplex solver needs it, so we must waste some bytes for this book-keeping index.) Reserved for ChLcpSimpexSolver.


CHRONO::ENGINE
C++ library for multibody simulation, (C) Alessandro Tasora
This API documentation has been generated on Tue Jul 10 2012 by Doxygen