AGXDynamics  2.31.1.0
agx::ScaleBoxCallback Class Reference

Scale box friction model solver callback. More...

#include <NlmcpCallback.h>

+ Inheritance diagram for agx::ScaleBoxCallback:

Public Member Functions

 ScaleBoxCallback (const agx::FrictionModel *frictionModel, agx::UInt numNormals, const agx::Vec3 &frictionCoefficients)
 
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
 
virtual agx::Real calculateResidual (const agx::NlmcpCallback::Args &args) const override
 Calculate residual given current solution. More...
 
agx::UInt getDirectRow () const
 
agx::UInt getIterativeRow () const
 
agx::UInt getNumRows () const
 
int getReferenceCount () const
 
agx::UInt getSparseBoundsIndex () const
 
virtual agx::Bool initialize (const agx::NlmcpCallback::Args &args) override
 This method is a test for the non-linear solver if this callback is active for non-linear solve. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
virtual void postIterativeSolve (const agx::NlmcpCallback::Args &args) const override
 Before direct solve, after iterative solve. 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 setDirectRow (agx::UInt directRow)
 
void setIterativeRow (agx::UInt iterativeRow)
 
void setNumRows (agx::UInt numRows)
 
void setSparseBoundsIndex (agx::UInt sparseBoundsIndex)
 
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...
 
virtual void update (const agx::NlmcpCallback::Args &args) const override
 Update call when bounds and/or q may be updated given the current solution z. More...
 

Static Public Member Functions

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

Protected Member Functions

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

agx::Real m_frictionCoefficients [2]
 
const agx::FrictionModel * m_frictionModel
 
Mutex m_mutex
 
agx::UInt m_numNormals
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Scale box friction model solver callback.

Updates bounds during non-linear direct solves.

Definition at line 223 of file NlmcpCallback.h.

Constructor & Destructor Documentation

◆ ScaleBoxCallback()

agx::ScaleBoxCallback::ScaleBoxCallback ( const agx::FrictionModel *  frictionModel,
agx::UInt  numNormals,
const agx::Vec3 &  frictionCoefficients 
)

◆ ~ScaleBoxCallback()

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

◆ calculateResidual()

virtual agx::Real agx::ScaleBoxCallback::calculateResidual ( const agx::NlmcpCallback::Args &  args) const
overridevirtual

Calculate residual given current solution.

Implements agx::NlmcpCallback.

◆ deleteUsingDeleteHandler()

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

◆ getDeleteHandler()

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

◆ getDirectRow()

agx::UInt agx::NlmcpCallback::getDirectRow ( ) const
inherited
Returns
the permuted start row in global matrix

Definition at line 159 of file NlmcpCallback.h.

◆ getIterativeRow()

agx::UInt agx::NlmcpCallback::getIterativeRow ( ) const
inherited
Returns
the row used in iterative buffers

Definition at line 164 of file NlmcpCallback.h.

◆ getNumRows()

agx::UInt agx::NlmcpCallback::getNumRows ( ) const
inherited
Returns
the number of rows this callback handles

Definition at line 174 of file NlmcpCallback.h.

◆ getReferenceCount()

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

◆ getSparseBoundsIndex()

agx::UInt agx::NlmcpCallback::getSparseBoundsIndex ( ) const
inherited
Returns
the index in sparse bounds (argument in update method)

Definition at line 169 of file NlmcpCallback.h.

◆ initialize()

virtual agx::Bool agx::ScaleBoxCallback::initialize ( const agx::NlmcpCallback::Args &  args)
overridevirtual

This method is a test for the non-linear solver if this callback is active for non-linear solve.

Returns
true if active and should receive update calls from inner loop of the non-linear solver, false if this callback isn't interested in updates

Implements agx::NlmcpCallback.

◆ is()

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

◆ postIterativeSolve()

virtual void agx::ScaleBoxCallback::postIterativeSolve ( const agx::NlmcpCallback::Args &  args) const
overridevirtual

Before direct solve, after iterative solve.

Implements agx::NlmcpCallback.

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

◆ setDirectRow()

void agx::NlmcpCallback::setDirectRow ( agx::UInt  directRow)
inherited

◆ setIterativeRow()

void agx::NlmcpCallback::setIterativeRow ( agx::UInt  iterativeRow)
inherited

◆ setNumRows()

void agx::NlmcpCallback::setNumRows ( agx::UInt  numRows)
inherited

◆ setSparseBoundsIndex()

void agx::NlmcpCallback::setSparseBoundsIndex ( agx::UInt  sparseBoundsIndex)
inherited

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

◆ update()

virtual void agx::ScaleBoxCallback::update ( const agx::NlmcpCallback::Args &  args) const
overridevirtual

Update call when bounds and/or q may be updated given the current solution z.

Implements agx::NlmcpCallback.

◆ ValidateCast()

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

Member Data Documentation

◆ m_frictionCoefficients

agx::Real agx::ScaleBoxCallback::m_frictionCoefficients[2]
protected

Definition at line 240 of file NlmcpCallback.h.

◆ m_frictionModel

const agx::FrictionModel* agx::ScaleBoxCallback::m_frictionModel
protected

Definition at line 241 of file NlmcpCallback.h.

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_numNormals

agx::UInt agx::ScaleBoxCallback::m_numNormals
protected

Definition at line 239 of file NlmcpCallback.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.


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