AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::DirectSolverData Class Reference

#include <DirectSolverData.h>

+ Inheritance diagram for agx::DirectSolverData:

Classes

class  ContactGroups
 Class that handles the grouping. More...
 

Public Types

typedef agx::ref_ptr
< ContactGroups > 
ContactGroupsRef
 
typedef agx::HashTable
< agx::UInt, agx::UIntVector > 
StrongInteractionTable
 

Public Member Functions

 DirectSolverData (agx::UInt numEquations, agx::UInt numBlockRows, agx::UInt numBlocks, agx::Solver::NlMcpConfig nlMcpConfig, agx::Bool gatherStatistics, INlSolveDataH5 *nlSolveDataH5)
 Construct given total number of equations in the direct system, number of block rows and the total number of blocks in the matrix. More...
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
void buildStrongInteractionTable (agx::Physics::InteractionGroupPtr islandGroup, agx::Physics::StrongInteractionData &strongInteractions, const agxData::IndexArray &globalToLocalIndexArray)
 Builds table that maps a rigid body to the other bodies it interacts with. More...
 
DirectSolverData * clone ()
 Clones solver data. More...
 
void commitVelocities (const agxData::IndexArray &indices, agxData::Array< agx::Vec3 > &linearVelocities, agxData::Array< agx::Vec3 > &angularVelocities, const agxData::Array< agx::RigidBodyState > &states) const
 Copy solution to velocity buffers. More...
 
const
agx::NlMixedCp::McpAlgorithm * 
getAlgorithm () const
 
agx::DirectSolverData::ContactGroups * getContactGroups () const
 
agx::IndexSet & getIndexSet ()
 
agx::LogicalStructure & getLogicalStructure ()
 
const agx::LogicalStructure & getLogicalStructure () const
 
agx::SparseMatrix & getMatrix ()
 
const agx::SparseMatrix & getMatrix () const
 
agx::UInt getNumBlockRows () const
 
agx::RealValarray & getQ ()
 
const agx::RealValarray & getQ () const
 
int getReferenceCount () const
 
agx::RealValarray & getSigns ()
 
const agx::RealValarray & getSigns () const
 
agx::RealValarray & getSolution ()
 
const agx::RealValarray & getSolution () const
 
agx::SparseRangeReal & getSparseBounds ()
 
const agx::SparseRangeReal & getSparseBounds () const
 
agx::StabilityReport * getStabilityReport () const
 
const
agx::DirectSolverData::StrongInteractionTable & 
getStrongInteractionTable () const
 
void initialize ()
 Initialize for a new solve. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void setContactGroups (agx::DirectSolverData::ContactGroups *contactGroups)
 Assign new contact groups object. More...
 
const agx::RealValarray & solve ()
 Solve the current configuration of the matrix, right hand side and bounds. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

 DirectSolverData ()=delete
 
virtual ~DirectSolverData ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

ContactGroupsRef m_contactGroups
 
LogicalStructure m_logicalStructure
 
Mutex m_mutex
 
NlMixedCpRef m_nlmcp
 
INlSolveDataH5 * m_nlSolveDataH5
 
UInt m_numBlockRows
 
UInt m_numBlocks
 
UInt m_numEquations
 
UInt m_numSolves
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
StabilityReportRef m_stabilityReport
 
StrongInteractionTable m_strongInteractionTable
 

Detailed Description

Definition at line 92 of file DirectSolverData.h.

Member Typedef Documentation

Constructor & Destructor Documentation

agx::DirectSolverData::DirectSolverData ( agx::UInt  numEquations,
agx::UInt  numBlockRows,
agx::UInt  numBlocks,
agx::Solver::NlMcpConfig  nlMcpConfig,
agx::Bool  gatherStatistics,
INlSolveDataH5 *  nlSolveDataH5 
)

Construct given total number of equations in the direct system, number of block rows and the total number of blocks in the matrix.

Parameters
numEquations- total number of equations
numBlockRows- total number of block rows in matrix
numBlocks- total number of blocks in matrix
nlMcpConfig- direct solver configuration
agx::DirectSolverData::DirectSolverData ( )
protecteddelete
virtual agx::DirectSolverData::~DirectSolverData ( )
protectedvirtual

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
void agx::DirectSolverData::buildStrongInteractionTable ( agx::Physics::InteractionGroupPtr  islandGroup,
agx::Physics::StrongInteractionData &  strongInteractions,
const agxData::IndexArray &  globalToLocalIndexArray 
)

Builds table that maps a rigid body to the other bodies it interacts with.

Parameters
strongInteractions- strong interactions
globalToLocalIndexArray- index array that maps global body indices to island indices
DirectSolverData* agx::DirectSolverData::clone ( )

Clones solver data.

void agx::DirectSolverData::commitVelocities ( const agxData::IndexArray &  indices,
agxData::Array< agx::Vec3 > &  linearVelocities,
agxData::Array< agx::Vec3 > &  angularVelocities,
const agxData::Array< agx::RigidBodyState > &  states 
) const

Copy solution to velocity buffers.

Parameters
indices- direct body local to global indices
linearVelocities- linear velocity buffer
angularVelocities- angular velocity buffer
states- states
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
const agx::NlMixedCp::McpAlgorithm* agx::DirectSolverData::getAlgorithm ( ) const
Returns
The McpAlgorithm used by this solver.
agx::DirectSolverData::ContactGroups* agx::DirectSolverData::getContactGroups ( ) const
Returns
the contact grouping, if present (assigned externally)
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::IndexSet& agx::DirectSolverData::getIndexSet ( )
Returns
the current IndexSet
agx::LogicalStructure& agx::DirectSolverData::getLogicalStructure ( )
Returns
the logical structure of the matrix (used to permute the matrix)
const agx::LogicalStructure& agx::DirectSolverData::getLogicalStructure ( ) const
agx::SparseMatrix& agx::DirectSolverData::getMatrix ( )
Returns
the matrix
const agx::SparseMatrix& agx::DirectSolverData::getMatrix ( ) const
agx::UInt agx::DirectSolverData::getNumBlockRows ( ) const
Returns
the total number of block rows
agx::RealValarray& agx::DirectSolverData::getQ ( )
Returns
the negative right hand side q (Hx + q = w)
const agx::RealValarray& agx::DirectSolverData::getQ ( ) const
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::RealValarray& agx::DirectSolverData::getSigns ( )
Returns
the signs, should be -1 for constraints +1 for bodies
const agx::RealValarray& agx::DirectSolverData::getSigns ( ) const
agx::RealValarray& agx::DirectSolverData::getSolution ( )
Returns
the current solution
const agx::RealValarray& agx::DirectSolverData::getSolution ( ) const
agx::SparseRangeReal& agx::DirectSolverData::getSparseBounds ( )
Returns
sparse bounds object used by the NLMCP
const agx::SparseRangeReal& agx::DirectSolverData::getSparseBounds ( ) const
agx::StabilityReport* agx::DirectSolverData::getStabilityReport ( ) const
Returns
the stability report
const agx::DirectSolverData::StrongInteractionTable& agx::DirectSolverData::getStrongInteractionTable ( ) const
Returns
the strong interaction table that maps body to other strong interaction bodies (on the same row)
void agx::DirectSolverData::initialize ( )

Initialize for a new solve.

This method can be called many times, e.g., if this object is stored between time steps.

template<typename T >
bool agx::Referenced::is ( ) const
inherited
void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

void agx::DirectSolverData::setContactGroups ( agx::DirectSolverData::ContactGroups *  contactGroups)

Assign new contact groups object.

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

const agx::RealValarray& agx::DirectSolverData::solve ( )

Solve the current configuration of the matrix, right hand side and bounds.

The solution is stored and is accessible through getSolution().

Returns
the solution of the solve
void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

ContactGroupsRef agx::DirectSolverData::m_contactGroups
protected

Definition at line 265 of file DirectSolverData.h.

LogicalStructure agx::DirectSolverData::m_logicalStructure
protected

Definition at line 264 of file DirectSolverData.h.

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

NlMixedCpRef agx::DirectSolverData::m_nlmcp
protected

Definition at line 263 of file DirectSolverData.h.

INlSolveDataH5* agx::DirectSolverData::m_nlSolveDataH5
protected

Definition at line 269 of file DirectSolverData.h.

UInt agx::DirectSolverData::m_numBlockRows
protected

Definition at line 261 of file DirectSolverData.h.

UInt agx::DirectSolverData::m_numBlocks
protected

Definition at line 262 of file DirectSolverData.h.

UInt agx::DirectSolverData::m_numEquations
protected

Definition at line 260 of file DirectSolverData.h.

UInt agx::DirectSolverData::m_numSolves
protected

Definition at line 266 of file DirectSolverData.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

StabilityReportRef agx::DirectSolverData::m_stabilityReport
protected

Definition at line 267 of file DirectSolverData.h.

StrongInteractionTable agx::DirectSolverData::m_strongInteractionTable
protected

Definition at line 268 of file DirectSolverData.h.


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