AGX Dynamics  2.37.2.0
agx::ContactNormal Class Reference

#include <CustomElementaryConstraints.h>

+ Inheritance diagram for agx::ContactNormal:

Public Member Functions

 ContactNormal ()
 
agx::Real getAdhesiveOverlap () const
 
const char * getClassName () const override
 
agx::Real getDepth () const
 
agx::Real getImpactSpeed () const
 
const agx::Vec3f & getN () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
const agx::Vec3f & getV1 () const
 
const agx::Vec3f & getV2 () const
 
virtual void restore (agxStream::InputArchive &in) override
 Restore this object from stream. More...
 
agx::ContactNormal * set (const agx::Vec3f &n, const agx::Vec3f &v1, const agx::Vec3f &v2, agx::Real c, agx::Real impactSpeed, agx::Real restitution, agx::Real impactCondition=agx::Real(-0.5), agx::Real adhesiveOverlap=agx::Real(0))
 
void setAdhesiveOverlap (agx::Real adhesiveOverlap)
 
void setDepth (agx::Real c)
 
void setImpactSpeed (Real impactSpeed)
 
void setN (const agx::Vec3f &n)
 
void setV1 (const agx::Vec3f &v1)
 
void setV2 (const agx::Vec3f &v2)
 
virtual void store (agxStream::OutputArchive &out) const override
 Store this object to stream. More...
 
- Public Member Functions inherited from agx::ElementaryConstraintN< 1 >
 ElementaryConstraintN (agx::Bool enable)
 Construct given enable flag. More...
 
- Public Member Functions inherited from agx::ElementaryConstraint
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::ElementaryConstraint)
 
void copyRowFrom (const ElementaryConstraint *source, agx::UInt sourceRow, agx::UInt destRow)
 Copy configuration row from the given ElementaryConstraint into this. More...
 
virtual agx::UInt getBounds (agx::RangeReal *bounds, agx::UInt row, agx::Real h) const
 Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)). More...
 
agx::Real getCompliance (agx::UInt row=0) const
 
virtual agx::Real getCurrentForce (const agx::UInt row=0) const
 Returns the force applied last time step by this elementary constraint. More...
 
const agx::Real * getCurrentForces () const
 
agx::Real getDamping (agx::UInt row=0) const
 
agx::Real getElasticity (agx::UInt row=0) const
 
virtual agx::Bool getEnable () const
 
agx::RangeReal & getForceRange (const agx::UInt row=0)
 
const agx::RangeReal & getForceRange (const agx::UInt row=0) const
 
const agx::ElementaryConstraint::NameType & getName () const
 
virtual agx::ConstraintNlmcpCallback * getNlCallback () const
 
agx::UInt getNumRows () const
 
agx::RegularizationParameters * getRegularizationParameters (const agx::UInt row=0)
 
const agx::RegularizationParameters * getRegularizationParameters (const agx::UInt row=0) const
 
virtual agx::UInt getVelocity (agx::Real *v, agx::UInt row) const
 Returns the velocity of this elementary constraint (extra, driving term on the right hand side). More...
 
virtual agx::Bool isActive () const
 An elementary constraint is defined to be active if enabled. More...
 
virtual agx::Bool isImpacting () const
 
virtual void linearizeCompliance (const agx::Real *violations, agx::Real *epsilons, agx::Real minPerturbation) const
 Modify epsilon so that this ElementaryConstraint appear to be linear in the "normal" deformantion space instead any other space that the ElementaryConstraint may be using. More...
 
virtual agx::UInt postSolveCallback (const agx::Real *solution, agx::UInt row, agx::Real h)
 Callback after solve, with the solution. More...
 
virtual void prepare ()
 Prepare call. More...
 
void reset ()
 Reset call. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore structural independent data from stream. More...
 
virtual void setAttachmentPair (const agx::AttachmentPair *ap)
 Call for elementary constraints dependent on attachment pairs. More...
 
void setCompliance (agx::Real compliance, int row)
 Assign compliance for a given row, or all rows if row = -1 (default). More...
 
void setCompliance (agx::Real compliance)
 
void setDamping (agx::Real damping, int row)
 Assign damping for a given row, or all rows if row = -1 (default). More...
 
void setDamping (agx::Real damping)
 
void setElasticity (agx::Real elasticity, int row)
 Assign elasticity for a given row, or all rows if row = -1 (default). More...
 
void setElasticity (agx::Real elasticity)
 
virtual void setEnable (agx::Bool enable)
 Enable/disable this elementary constraint. More...
 
void setForceRange (agx::RangeReal forceRange, const agx::UInt row=0)
 Assign force range to a given row. More...
 
void setForceRange (agx::Real lower, agx::Real upper, const agx::UInt row=0)
 Assign force range to a given row. More...
 
void setName (const agx::ElementaryConstraint::NameType &name)
 Name this elementary constraint. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store structural independent data to stream. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
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
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. 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 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...
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings. More...
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 

Protected Member Functions

virtual ~ContactNormal ()
 
virtual agx::UInt getJacobian (agx::Jacobian6DOFElement *G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState) override
 Returns the Jacobian of this elementary constraint. More...
 
virtual agx::UInt getViolation (agx::Real *g, agx::UInt row) override
 Returns the violation of this elementary constraint. More...
 
- Protected Member Functions inherited from agx::ElementaryConstraintN< 1 >
 ElementaryConstraintN ()
 Used during serialization restore. More...
 
- Protected Member Functions inherited from agx::ElementaryConstraint
 ElementaryConstraint (agx::Bool enable, agx::UInt numRows, agx::RegularizationParameters *regParamsBuffer, agx::Real *lastForcesBuffer, agx::RangeReal *userBoundsBuffer)
 Construct given data. More...
 
virtual ~ElementaryConstraint ()
 Reference counted object, protected destructor. More...
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor. More...
 
 Serializable (const Serializable &other)
 Copy constructor. More...
 
void generateUuid ()
 

Protected Attributes

agx::Real m_adhesiveOverlap
 
agx::Real m_c
 
agx::Real m_impactSpeed
 
agx::Vec3f m_n
 
agx::Vec3f m_v1
 
agx::Vec3f m_v2
 
- Protected Attributes inherited from agx::ElementaryConstraintN< 1 >
agx::RangeReal m_bounds [N]
 Bounds buffer. More...
 
agx::Real m_forces [N]
 Forces buffer. More...
 
agx::RegularizationParameters m_regParams [N]
 Regularization parameters buffer. More...
 
- Protected Attributes inherited from agx::ElementaryConstraint
agx::Bool m_enable
 enabled More...
 
agx::ref_ptr< agx::Referenced > m_internalData
 custom, internal data More...
 
agx::Real * m_lfs
 last forces More...
 
agx::ElementaryConstraint::NameType m_name
 name More...
 
agx::UInt m_numRows
 number of rows More...
 
agx::RegularizationParameters * m_rps
 regularization parameters More...
 
agx::RangeReal * m_ubs
 user bounds More...
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agx::ElementaryConstraint
typedef agx::Name NameType
 
typedef agx::VectorPOD< agx::ElementaryConstraint *> PtrContainer
 
typedef agx::Vector< agx::ref_ptr< agx::ElementaryConstraint > > RefContainer
 
- Static Protected Member Functions inherited from agx::Referenced
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...
 

Detailed Description

Definition at line 24 of file CustomElementaryConstraints.h.

Constructor & Destructor Documentation

◆ ContactNormal()

agx::ContactNormal::ContactNormal ( )

◆ ~ContactNormal()

virtual agx::ContactNormal::~ContactNormal ( )
protectedvirtual

Member Function Documentation

◆ create() [1/2]

static agxStream::Serializable* agx::ContactNormal::create ( )
inlinestatic

Definition at line 55 of file CustomElementaryConstraints.h.

◆ create() [2/2]

static agxStream::Serializable* agx::ContactNormal::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 55 of file CustomElementaryConstraints.h.

◆ getAdhesiveOverlap()

agx::Real agx::ContactNormal::getAdhesiveOverlap ( ) const

◆ getClassName()

const char* agx::ContactNormal::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 55 of file CustomElementaryConstraints.h.

◆ getConstructClassId()

static const char* agx::ContactNormal::getConstructClassId ( )
inlinestatic

Definition at line 55 of file CustomElementaryConstraints.h.

◆ getDepth()

agx::Real agx::ContactNormal::getDepth ( ) const

◆ getImpactSpeed()

agx::Real agx::ContactNormal::getImpactSpeed ( ) const

◆ getJacobian()

virtual agx::UInt agx::ContactNormal::getJacobian ( agx::Jacobian6DOFElement *  G,
agx::UInt  numBlocks,
agx::UInt  row,
agx::GWriteState::Enum  writeState 
)
overrideprotectedvirtual

Returns the Jacobian of this elementary constraint.

Note that the Jacobian buffer has to be provided by the caller.

Parameters
G- Jacobian buffer
numBlocks- number of blocks in the global Jacobian (e.g., number of bodies in the main constraint)
row- start row in Jacobian buffer
writeState- state of the main constraint (the order in which the Jacobian is written defines this state)
Returns
the number of elements used in G

Reimplemented from agx::ElementaryConstraint.

◆ getN()

const agx::Vec3f& agx::ContactNormal::getN ( ) const

◆ getStorageAgent()

agxStream::StorageAgent* agx::ContactNormal::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 55 of file CustomElementaryConstraints.h.

◆ getV1()

const agx::Vec3f& agx::ContactNormal::getV1 ( ) const

◆ getV2()

const agx::Vec3f& agx::ContactNormal::getV2 ( ) const

◆ getViolation()

virtual agx::UInt agx::ContactNormal::getViolation ( agx::Real *  g,
agx::UInt  row 
)
overrideprotectedvirtual

Returns the violation of this elementary constraint.

Note that the violation buffer has to be provided by the caller.

Parameters
g- violation buffer
row- start row in violation buffer g
Returns
the number of rows used (= elements written) in violation buffer

Reimplemented from agx::ElementaryConstraint.

◆ restore()

virtual void agx::ContactNormal::restore ( agxStream::InputArchive &  in)
overridevirtual

Restore this object from stream.

Reimplemented from agx::ElementaryConstraint.

◆ set()

agx::ContactNormal* agx::ContactNormal::set ( const agx::Vec3f &  n,
const agx::Vec3f &  v1,
const agx::Vec3f &  v2,
agx::Real  c,
agx::Real  impactSpeed,
agx::Real  restitution,
agx::Real  impactCondition = agx::Real(-0.5),
agx::Real  adhesiveOverlap = agx::Real(0) 
)

◆ setAdhesiveOverlap()

void agx::ContactNormal::setAdhesiveOverlap ( agx::Real  adhesiveOverlap)

◆ setDepth()

void agx::ContactNormal::setDepth ( agx::Real  c)

◆ setImpactSpeed()

void agx::ContactNormal::setImpactSpeed ( Real  impactSpeed)

◆ setN()

void agx::ContactNormal::setN ( const agx::Vec3f &  n)

◆ setV1()

void agx::ContactNormal::setV1 ( const agx::Vec3f &  v1)

◆ setV2()

void agx::ContactNormal::setV2 ( const agx::Vec3f &  v2)

◆ store()

virtual void agx::ContactNormal::store ( agxStream::OutputArchive &  out) const
overridevirtual

Store this object to stream.

Reimplemented from agx::ElementaryConstraint.

Member Data Documentation

◆ m_adhesiveOverlap

agx::Real agx::ContactNormal::m_adhesiveOverlap
protected

Definition at line 69 of file CustomElementaryConstraints.h.

◆ m_c

agx::Real agx::ContactNormal::m_c
protected

Definition at line 67 of file CustomElementaryConstraints.h.

◆ m_impactSpeed

agx::Real agx::ContactNormal::m_impactSpeed
protected

Definition at line 68 of file CustomElementaryConstraints.h.

◆ m_n

agx::Vec3f agx::ContactNormal::m_n
protected

Definition at line 64 of file CustomElementaryConstraints.h.

◆ m_v1

agx::Vec3f agx::ContactNormal::m_v1
protected

Definition at line 65 of file CustomElementaryConstraints.h.

◆ m_v2

agx::Vec3f agx::ContactNormal::m_v2
protected

Definition at line 66 of file CustomElementaryConstraints.h.


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