AGXDynamics  2.31.1.0
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

◆ ContactGroupsRef

◆ StrongInteractionTable

Constructor & Destructor Documentation

◆ DirectSolverData() [1/2]

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

◆ DirectSolverData() [2/2]

agx::DirectSolverData::DirectSolverData ( )
protecteddelete

◆ ~DirectSolverData()

virtual agx::DirectSolverData::~DirectSolverData ( )
protectedvirtual

Member Function Documentation

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

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(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

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

◆ asSafe() [1/2]

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

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

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

◆ asSafe() [2/2]

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

◆ buildStrongInteractionTable()

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

◆ clone()

DirectSolverData* agx::DirectSolverData::clone ( )

Clones solver data.

◆ commitVelocities()

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

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ getAlgorithm()

const agx::NlMixedCp::McpAlgorithm* agx::DirectSolverData::getAlgorithm ( ) const
Returns
The McpAlgorithm used by this solver.

◆ getContactGroups()

agx::DirectSolverData::ContactGroups* agx::DirectSolverData::getContactGroups ( ) const
Returns
the contact grouping, if present (assigned externally)

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getIndexSet()

agx::IndexSet& agx::DirectSolverData::getIndexSet ( )
Returns
the current IndexSet

◆ getLogicalStructure() [1/2]

agx::LogicalStructure& agx::DirectSolverData::getLogicalStructure ( )
Returns
the logical structure of the matrix (used to permute the matrix)

◆ getLogicalStructure() [2/2]

const agx::LogicalStructure& agx::DirectSolverData::getLogicalStructure ( ) const

◆ getMatrix() [1/2]

agx::SparseMatrix& agx::DirectSolverData::getMatrix ( )
Returns
the matrix

◆ getMatrix() [2/2]

const agx::SparseMatrix& agx::DirectSolverData::getMatrix ( ) const

◆ getNumBlockRows()

agx::UInt agx::DirectSolverData::getNumBlockRows ( ) const
Returns
the total number of block rows

◆ getQ() [1/2]

agx::RealValarray& agx::DirectSolverData::getQ ( )
Returns
the negative right hand side q (Hx + q = w)

◆ getQ() [2/2]

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

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ getSigns() [1/2]

agx::RealValarray& agx::DirectSolverData::getSigns ( )
Returns
the signs, should be -1 for constraints +1 for bodies

◆ getSigns() [2/2]

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

◆ getSolution() [1/2]

agx::RealValarray& agx::DirectSolverData::getSolution ( )
Returns
the current solution

◆ getSolution() [2/2]

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

◆ getSparseBounds() [1/2]

agx::SparseRangeReal& agx::DirectSolverData::getSparseBounds ( )
Returns
sparse bounds object used by the NLMCP

◆ getSparseBounds() [2/2]

const agx::SparseRangeReal& agx::DirectSolverData::getSparseBounds ( ) const

◆ getStabilityReport()

agx::StabilityReport* agx::DirectSolverData::getStabilityReport ( ) const
Returns
the stability report

◆ getStrongInteractionTable()

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)

◆ initialize()

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.

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ reference()

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.

◆ setContactGroups()

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

Assign new contact groups object.

◆ setDeleteHandler()

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

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

◆ solve()

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

◆ unreference()

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.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

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.

◆ ValidateCast()

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

Member Data Documentation

◆ m_contactGroups

ContactGroupsRef agx::DirectSolverData::m_contactGroups
protected

Definition at line 265 of file DirectSolverData.h.

◆ m_logicalStructure

LogicalStructure agx::DirectSolverData::m_logicalStructure
protected

Definition at line 264 of file DirectSolverData.h.

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_nlmcp

NlMixedCpRef agx::DirectSolverData::m_nlmcp
protected

Definition at line 263 of file DirectSolverData.h.

◆ m_nlSolveDataH5

INlSolveDataH5* agx::DirectSolverData::m_nlSolveDataH5
protected

Definition at line 269 of file DirectSolverData.h.

◆ m_numBlockRows

UInt agx::DirectSolverData::m_numBlockRows
protected

Definition at line 261 of file DirectSolverData.h.

◆ m_numBlocks

UInt agx::DirectSolverData::m_numBlocks
protected

Definition at line 262 of file DirectSolverData.h.

◆ m_numEquations

UInt agx::DirectSolverData::m_numEquations
protected

Definition at line 260 of file DirectSolverData.h.

◆ m_numSolves

UInt agx::DirectSolverData::m_numSolves
protected

Definition at line 266 of file DirectSolverData.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

◆ m_stabilityReport

StabilityReportRef agx::DirectSolverData::m_stabilityReport
protected

Definition at line 267 of file DirectSolverData.h.

◆ m_strongInteractionTable

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: