AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxSDK::EnergyManager Class Reference

Keeps track of the energy flow in the system. More...

#include <EnergyManager.h>

+ Inheritance diagram for agxSDK::EnergyManager:

Public Member Functions

void add (const agx::Constraint *constraint)
 Enables energy calculations for a constraint.
 
void add (const agx::RigidBody *rigidBody)
 Enables energy calculations for a rigid body.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxSDK::EnergyManager)
 
agx::Real getDissipation (const agx::Constraint *constraint) const
 Get the dissipation for a constraint during the last timestep.
 
agx::Real getDissipation (const agx::ElementaryConstraint *constraint) const
 Get the dissipation for a secondary constraint during the last timestep.
 
agx::Real getDissipation (const agx::RigidBody *rb) const
 Get the dissipation from linear and angular velocity damping and external forces.
 
agx::Real getKineticEnergyChange (const agx::RigidBody *rb) const
 Get the change in kinetic energy for a rigid body during the last time step.
 
agx::Real getPotentialChange (const agx::Constraint *constraint) const
 Get the change in potential for a constraint during the last timestep.
 
agx::Real getPotentialChange (const agx::ElementaryConstraint *constraint) const
 Get the change in potential for a secondary constraint during the last timestep.
 
agx::Real getPotentialChange (const agx::RigidBody *rb) const
 Get the change in gravity potential for a rigid body during the last timestep.
 
agx::Real getPower (const agx::ElementaryConstraint *motor) const
 Get the power from a constraint motor.
 
agx::Real getRotationalEnergyChange (const agx::RigidBody *rb) const
 Get the change in kinetic energy from the rotational motion for a rigid body during the last time step.
 
agx::Real getTranslationalEnergyChange (const agx::RigidBody *rb) const
 Get the change in kinetic energy from the translational motion for a rigid body during the last time step.
 
void remove (const agx::Constraint *constraint)
 Removes the constraint from the EnergyManager.
 
void remove (const agx::RigidBody *rigidBody)
 Removes the rigid body from the EnergyManager.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Static Public Member Functions

static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agx::Real getKineticEnergy (const agx::RigidBody *rb)
 Get the kinetic energy for a rigid body.
 
static agx::Real getRotationalEnergy (const agx::RigidBody *rb)
 Get the rotational part of the kinetic energy of a rigid body.
 
static agx::Real getTranslationalEnergy (const agx::RigidBody *rb)
 Get the translational part of the kinetic energy of a rigid body.
 
- 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.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Additional Inherited Members

- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- 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.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Keeps track of the energy flow in the system.

Definition at line 46 of file agxSDK/EnergyManager.h.

Member Function Documentation

◆ add() [1/2]

void agxSDK::EnergyManager::add ( const agx::Constraint *  constraint)

Enables energy calculations for a constraint.

Parameters
constraint- The constraint.

◆ add() [2/2]

void agxSDK::EnergyManager::add ( const agx::RigidBody *  rigidBody)

Enables energy calculations for a rigid body.

Parameters
rigidBody- The rigid body.

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxSDK::EnergyManager::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxSDK::EnergyManager  )

◆ create()

static agxStream::Serializable * agxSDK::EnergyManager::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 50 of file agxSDK/EnergyManager.h.

◆ getDissipation() [1/3]

agx::Real agxSDK::EnergyManager::getDissipation ( const agx::Constraint *  constraint) const

Get the dissipation for a constraint during the last timestep.

Parameters
constraint- The constraint.
Returns
The energy dissipation from the constraint.

◆ getDissipation() [2/3]

agx::Real agxSDK::EnergyManager::getDissipation ( const agx::ElementaryConstraint *  constraint) const

Get the dissipation for a secondary constraint during the last timestep.

Parameters
constraint- The secondary constraint.
Returns
The energy dissipation from the secondary constraint.

◆ getDissipation() [3/3]

agx::Real agxSDK::EnergyManager::getDissipation ( const agx::RigidBody *  rb) const

Get the dissipation from linear and angular velocity damping and external forces.

All external forces is considered to be dissipative.

Parameters
rb- The rigid body.
Returns
The dissipation.

◆ getKineticEnergy()

static agx::Real agxSDK::EnergyManager::getKineticEnergy ( const agx::RigidBody *  rb)
static

Get the kinetic energy for a rigid body.

Parameters
rb- The rigid body.
Returns
The kinetic energy from translational and rotational motion.

◆ getKineticEnergyChange()

agx::Real agxSDK::EnergyManager::getKineticEnergyChange ( const agx::RigidBody *  rb) const

Get the change in kinetic energy for a rigid body during the last time step.

Parameters
rb- The rigid body.
Returns
The change in kinetic energy .

◆ getPotentialChange() [1/3]

agx::Real agxSDK::EnergyManager::getPotentialChange ( const agx::Constraint *  constraint) const

Get the change in potential for a constraint during the last timestep.

Parameters
constraint- The constraint.
Returns
The change of potential stored in the constraint.

◆ getPotentialChange() [2/3]

agx::Real agxSDK::EnergyManager::getPotentialChange ( const agx::ElementaryConstraint *  constraint) const

Get the change in potential for a secondary constraint during the last timestep.

Parameters
constraint- The secondary constraint.
Returns
The change of potential stored in the secondary constraint.

◆ getPotentialChange() [3/3]

agx::Real agxSDK::EnergyManager::getPotentialChange ( const agx::RigidBody *  rb) const

Get the change in gravity potential for a rigid body during the last timestep.

Parameters
rb- The rigid body.
Returns
The change in gravity potential for the rigid body.

◆ getPower()

agx::Real agxSDK::EnergyManager::getPower ( const agx::ElementaryConstraint *  motor) const

Get the power from a constraint motor.

The motor can be a Motor1D or an ElectricMotorController.

Parameters
motor- The constraint motor.
Returns
The power used by the motor.

◆ getRotationalEnergy()

static agx::Real agxSDK::EnergyManager::getRotationalEnergy ( const agx::RigidBody *  rb)
static

Get the rotational part of the kinetic energy of a rigid body.

Parameters
rb- The rigid body.
Returns
The kinetic energy from rotational motion.

◆ getRotationalEnergyChange()

agx::Real agxSDK::EnergyManager::getRotationalEnergyChange ( const agx::RigidBody *  rb) const

Get the change in kinetic energy from the rotational motion for a rigid body during the last time step.

Parameters
rb- The rigid body.
Returns
The change in kinetic energy from rotational motion.

◆ getTranslationalEnergy()

static agx::Real agxSDK::EnergyManager::getTranslationalEnergy ( const agx::RigidBody *  rb)
static

Get the translational part of the kinetic energy of a rigid body.

Parameters
rb- The rigid body.
Returns
The kinetic energy from translational motion.

◆ getTranslationalEnergyChange()

agx::Real agxSDK::EnergyManager::getTranslationalEnergyChange ( const agx::RigidBody *  rb) const

Get the change in kinetic energy from the translational motion for a rigid body during the last time step.

Parameters
rb- The rigid body.
Returns
The change in kinetic energy from translational motion.

◆ remove() [1/2]

void agxSDK::EnergyManager::remove ( const agx::Constraint *  constraint)

Removes the constraint from the EnergyManager.

Parameters
constraint- The constraint to be removed.

◆ remove() [2/2]

void agxSDK::EnergyManager::remove ( const agx::RigidBody *  rigidBody)

Removes the rigid body from the EnergyManager.

Parameters
rigidBody- The rigid body to be removed.

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