AGXDynamics  2.31.1.0
agx::NlMixedCp Class Reference

Class that implements a method to solve linear- or nonlinear complementary problems. More...

#include <MixedLCP.h>

+ Inheritance diagram for agx::NlMixedCp:

Classes

class  McpAlgorithm
 Interface class for algorithm to solve general mixed complementarity problem. More...
 

Public Types

typedef agx::ref_ptr< McpAlgorithm > McpAlgorithmRef
 

Public Member Functions

 NlMixedCp (agx::NlMixedCp::McpAlgorithm *mcpAlgorithm)
 
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
 
const agx::NlMixedCp::McpAlgorithm * getAlgorithm () const
 
agx::SparseMatrix & getMatrix ()
 
const agx::SparseMatrix & getMatrix () 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
 
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...
 
virtual void setSize (agx::UInt numEquations)
 Set the size of the system. More...
 
virtual agx::UInt solve (agx::Bool warm=false, agx::StabilityReport *stabilityReport=nullptr, agx::INlSolveDataH5 *nlSolveDataH5=nullptr)
 Solves the system, returns the total number of iterations made in the inner (mcp) loop. 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

static NlMixedCpRef create (agx::Solver::NlMcpConfig config, bool gatherStatistics)
 Creates default solver assuming symmetric-, sparse- and lower triangle matrix. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~NlMixedCp ()
 
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

Solver::NlMcpConfig m_config
 
agx::IndexSet m_indexSet
 
agx::SparseInverse m_inv
 
agx::SparseMatrix m_matrix
 
agx::UInt m_maxNumOuterIterations
 
agx::NlMixedCp::McpAlgorithmRef m_mcp
 
Mutex m_mutex
 
ObserverContainer m_observers
 
agx::Real m_outerGlobalTolerance
 
agx::RealValarray m_q
 
AtomicValue m_refCount
 
agx::RealValarray m_signs
 
agx::SparseRangeReal m_sparseBounds
 
agx::RealValarray m_z
 
agx::RealValarray m_z0
 

Detailed Description

Class that implements a method to solve linear- or nonlinear complementary problems.

Definition at line 107 of file MixedLCP.h.

Member Typedef Documentation

◆ McpAlgorithmRef

Constructor & Destructor Documentation

◆ NlMixedCp()

agx::NlMixedCp::NlMixedCp ( agx::NlMixedCp::McpAlgorithm *  mcpAlgorithm)

◆ ~NlMixedCp()

virtual agx::NlMixedCp::~NlMixedCp ( )
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

◆ create()

static NlMixedCpRef agx::NlMixedCp::create ( agx::Solver::NlMcpConfig  config,
bool  gatherStatistics 
)
static

Creates default solver assuming symmetric-, sparse- and lower triangle matrix.

◆ deleteUsingDeleteHandler()

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

◆ getAlgorithm()

const agx::NlMixedCp::McpAlgorithm* agx::NlMixedCp::getAlgorithm ( ) const

◆ getDeleteHandler()

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

◆ getMatrix() [1/2]

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

◆ getMatrix() [2/2]

const agx::SparseMatrix& agx::NlMixedCp::getMatrix ( ) const
Returns
the matrix

◆ getQ() [1/2]

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

◆ getQ() [2/2]

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

◆ getReferenceCount()

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

◆ getSigns() [1/2]

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

◆ getSigns() [2/2]

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

◆ getSolution() [1/2]

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

◆ getSolution() [2/2]

const agx::RealValarray& agx::NlMixedCp::getSolution ( ) const
Returns
the current solution

◆ getSparseBounds() [1/2]

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

◆ getSparseBounds() [2/2]

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

◆ 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.

◆ 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.

◆ setSize()

virtual void agx::NlMixedCp::setSize ( agx::UInt  numEquations)
virtual

Set the size of the system.

Calling this method will clear all data.

◆ solve()

virtual agx::UInt agx::NlMixedCp::solve ( agx::Bool  warm = false,
agx::StabilityReport *  stabilityReport = nullptr,
agx::INlSolveDataH5 *  nlSolveDataH5 = nullptr 
)
virtual

Solves the system, returns the total number of iterations made in the inner (mcp) loop.

◆ 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_config

Solver::NlMcpConfig agx::NlMixedCp::m_config
protected

Definition at line 443 of file MixedLCP.h.

◆ m_indexSet

agx::IndexSet agx::NlMixedCp::m_indexSet
protected

Definition at line 451 of file MixedLCP.h.

◆ m_inv

agx::SparseInverse agx::NlMixedCp::m_inv
protected

Definition at line 452 of file MixedLCP.h.

◆ m_matrix

agx::SparseMatrix agx::NlMixedCp::m_matrix
protected

Definition at line 445 of file MixedLCP.h.

◆ m_maxNumOuterIterations

agx::UInt agx::NlMixedCp::m_maxNumOuterIterations
protected

Definition at line 453 of file MixedLCP.h.

◆ m_mcp

agx::NlMixedCp::McpAlgorithmRef agx::NlMixedCp::m_mcp
protected

Definition at line 444 of file MixedLCP.h.

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_outerGlobalTolerance

agx::Real agx::NlMixedCp::m_outerGlobalTolerance
protected

Definition at line 454 of file MixedLCP.h.

◆ m_q

agx::RealValarray agx::NlMixedCp::m_q
protected

Definition at line 446 of file MixedLCP.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

◆ m_signs

agx::RealValarray agx::NlMixedCp::m_signs
protected

Definition at line 450 of file MixedLCP.h.

◆ m_sparseBounds

agx::SparseRangeReal agx::NlMixedCp::m_sparseBounds
protected

Definition at line 449 of file MixedLCP.h.

◆ m_z

agx::RealValarray agx::NlMixedCp::m_z
protected

Definition at line 447 of file MixedLCP.h.

◆ m_z0

agx::RealValarray agx::NlMixedCp::m_z0
protected

Definition at line 448 of file MixedLCP.h.


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