AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::GenericElementaryConstraint Class Referenceabstract

Generic elementary constraint with minimal amount of user callbacks to reduce development/prototype time and trivially exported using SWIG to e.g., Python or C#. More...

#include <GenericElementaryConstraint.h>

+ Inheritance diagram for agx::GenericElementaryConstraint:

Public Types

typedef agx::Name NameType
 
typedef agx::VectorPOD
< agx::ElementaryConstraint * > 
PtrContainer
 
typedef agx::Vector
< agx::ref_ptr
< agx::ElementaryConstraint > > 
RefContainer
 

Public Member Functions

 GenericElementaryConstraint (agx::UInt numRows)
 Construct given the number of rows in this elementary constraint. More...
 
 GenericElementaryConstraint (agx::UInt numRows, agx::Bool enable)
 Construct given the number of rows in this elementary constraint and default enable flag. More...
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::ElementaryConstraint)
 
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 copyRowFrom (const ElementaryConstraint *source, agx::UInt sourceRow, agx::UInt destRow)
 Copy configuration row from the given ElementaryConstraint into this. More...
 
void fetchData ()
 Performing callbacks and collecting data in serial. More...
 
const agx::AttachmentPair * getAttachmentPair () const
 
agx::UInt getBounds (agx::RangeReal *bounds, agx::UInt row, agx::Real h) const override
 Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)). More...
 
virtual const char * getClassName () const
 
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
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::RangeReal & getForceRange (const agx::UInt row=0)
 
const agx::RangeReal & getForceRange (const agx::UInt row=0) const
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
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...
 
const
agx::ElementaryConstraint::NameType & 
getName () const
 
virtual
agx::ConstraintNlmcpCallback * 
getNlCallback () const
 
agx::UInt getNumRows () const
 
int getReferenceCount () const
 
agx::RegularizationParameters * getRegularizationParameters (const agx::UInt row=0)
 
const
agx::RegularizationParameters * 
getRegularizationParameters (const agx::UInt row=0) const
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
agx::UInt getVelocity (agx::Real *v, agx::UInt row) const override
 Returns the velocity of this elementary constraint (extra, driving term on the right hand side). More...
 
agx::UInt getViolation (agx::Real *g, agx::UInt row) override
 Returns the violation of this elementary constraint. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
agx::Bool isActive () const override
 An elementary constraint is defined to be active if enabled. More...
 
bool isFinished () const
 
agx::Bool isImpacting () const override
 
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::Bool onPrepare ()
 Callback when the elementary constraints in the constraint receives the prepare call. More...
 
virtual void onWriteData (agx::GenericConstraintBodyData *rb1Data, agx::GenericConstraintBodyData *rb2Data, agx::GenericConstraintData *constraintData)
 Callback when to write Jacobian and constraint data if this elementary constraint is active. More...
 
virtual agx::UInt postSolveCallback (const agx::Real *solution, agx::UInt row, agx::Real h)
 Callback after solve, with the solution. More...
 
void prepare () override
 Prepare call. 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 reset ()
 Reset call. More...
 
virtual void restore (agxStream::InputArchive &in) override
 Restore this object from stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore structural independent data from stream. More...
 
void setAttachmentPair (const agx::AttachmentPair *ap) override
 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 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 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...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 Store this object to stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store structural independent data to stream. 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 void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~GenericElementaryConstraint ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 

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::Bool m_enable
 enabled More...
 
agx::ref_ptr< agx::Referenced > m_internalData
 custom, internal data More...
 
agx::Real * m_lfs
 last forces More...
 
Mutex m_mutex
 
agx::ElementaryConstraint::NameType m_name
 name More...
 
agx::UInt m_numRows
 number of rows More...
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
agx::RegularizationParameters * m_rps
 regularization parameters More...
 
agx::RangeReal * m_ubs
 user bounds More...
 

Detailed Description

Generic elementary constraint with minimal amount of user callbacks to reduce development/prototype time and trivially exported using SWIG to e.g., Python or C#.

This elementary constraint is only valid for one or two body constraints.

Python example for elementary Dot1: class MyDot1(agx.GenericElementaryConstraint): def init(self, dir1, dir2): super().__init__( 1 ) self.dir1 = dir1 self.dir2 = dir2

def onWriteData(self, rb1Data: agx.GenericConstraintBodyData, rb2Data: agx.GenericConstraintBodyData, constraintData: agx.GenericConstraintData): a1 = self.getAttachmentPair().getAttachment1() # type: agx.Attachment a2 = self.getAttachmentPair().getAttachment2() # type: agx.Attachment v1 = a1.get( self.dir1 ) # type: agx.Vec3 v2 = a2.get( self.dir2 ) # type: agx.Vec3

rb1Data.setJacobian( 0, agx.Vec3(), v1.cross( v2 ) ) rb2Data.setJacobian( 0, agx.Vec3(), v2.cross( v1 ) ) constraintData.setViolation( 0, v1 * v2 )

myHinge.addElementaryConstraint( "D1_VN", MyDot1( agx.Attachment.V, agx.Attachment.N ) ) myHinge.addElementaryConstraint( "D1_UN", MyDot1( agx.Attachment.U, agx.Attachment.N ) )

Definition at line 53 of file GenericElementaryConstraint.h.

Member Typedef Documentation

Definition at line 58 of file ElementaryConstraint.h.

Constructor & Destructor Documentation

agx::GenericElementaryConstraint::GenericElementaryConstraint ( agx::UInt  numRows)

Construct given the number of rows in this elementary constraint.

Note
Using this constructor the enable flag is set to true.
Parameters
numRows- number of rows in this elementary constraint
agx::GenericElementaryConstraint::GenericElementaryConstraint ( agx::UInt  numRows,
agx::Bool  enable 
)

Construct given the number of rows in this elementary constraint and default enable flag.

Parameters
numRows- number of rows in this elementary constraint
enable- true to be enabled by default, false disabled
virtual agx::GenericElementaryConstraint::~GenericElementaryConstraint ( )
protectedvirtual

Member Function Documentation

agx::ElementaryConstraint::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( agx::ElementaryConstraint  )
inherited
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
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(), and agx::InternalData::getOrCreate().

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

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

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

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
void agx::ElementaryConstraint::copyRowFrom ( const ElementaryConstraint *  source,
agx::UInt  sourceRow,
agx::UInt  destRow 
)
inherited

Copy configuration row from the given ElementaryConstraint into this.

Parameters
source- The ElementaryConstraint to copy from.
sourceRow- The index of the row in the given ElementaryConstraint to copy from.
destRow- The index to the row in this to which the configuration should be copied.
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
void agx::GenericElementaryConstraint::fetchData ( )

Performing callbacks and collecting data in serial.

void agxStream::Serializable::generateUuid ( )
protectedinherited
const agx::AttachmentPair* agx::GenericElementaryConstraint::getAttachmentPair ( ) const
Returns
the attachment pair in the constraint
agx::UInt agx::GenericElementaryConstraint::getBounds ( agx::RangeReal *  bounds,
agx::UInt  row,
agx::Real  h 
) const
overridevirtual

Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)).

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

Note
Dimension of the Lagrange Multipliers are Force * Time (argument h = time step length).
Parameters
bounds- bounds buffer
row- start row in bounds buffer bounds
h- current time step length
Returns
the number of rows used (= elements written) in the bounds buffer

Reimplemented from agx::ElementaryConstraint.

virtual const char* agxStream::Serializable::getClassName ( ) const
virtualinherited
Returns
the class name of this class.

Reimplemented in agxWire::StopNode, agxWire::ConnectingNode, agxWire::EyeNode, agxWire::BodyFixedNode, agx::RigidBody, agx::Twist, agxWire::FreeNode, agx::ScrewController, agx::LockController, agxModel::WaterWrapper, agx::MergedBody, agx::MergedBody, agxModel::ConstantWindGenerator, agx::RangeController, agxModel::ConstantWaterFlowGenerator, agx::MergedBody, agx::ElectricMotorController, agx::MergedBody, agx::FrictionController, agx::MergedBody, agx::TargetSpeedController, agxModel::WindAndWaterController, agxSDK::Assembly, agx::QuatLock, agx::SphericalRel, agx::Spherical, agxWire::WireSimpleDrumController, agx::Dot2, agxModel::FractureAlgorithmBreakOnStress, agx::Swing, agxModel::FractureAlgorithmBreakOnContactForce, agx::Dot1, agxModel::FractureAlgorithmBreakOnContact, agx::Frame, agxPowerLine::detail::DimensionState3Dof< DimensionType >, agxUtil::ConstraintHolder, agxDriveTrain::PidControlledEngine, agxCable::CableDamage, agxControl::TeleportToSensorOperation, agxCollide::Geometry, agxDriveTrain::deprecated::Clutch, agxModel::Terrain, agxModel::TerrainDataInterface, agx::ObserverFrame, agxControl::StoreParticlesOperation, agxModel::SlidingNodeAttachment, agxDriveTrain::deprecated::GearBox, agxControl::EventSensor, agxPowerLine::Connection, agxModel::FractureGenerator, agxControl::LoadParticleAGXFileOperation, agxPowerLine::TranslationalConstraintImplementation, agxModel::RotatingNodeAttachment, agxModel::TwoBodyTire, agxPowerLine::detail::DimensionState1Dof< DimensionType >, agxModel::Deformable1DNodeRoute, agxPowerLine::ElementaryTranslationalConstraint, agxControl::SetVelocityOperation, agx::AddedMassInteraction, agxPowerLine::TranslationalActuator, agxDriveTrain::RpmController, agx::RigidBodyAttachment, agxVehicle::Track, agxModel::RigidNodeAttachment, agxControl::WriteParticleDataToAGXOperation, agxModel::TerrainIterativeProjectedConeFrictionModel, agxModel::Deformable1DSphereGeometryFactory, agxModel::DeformableParticleCreator, agxPowerLine::GearConstraintImplementation, agxControl::MakeParticleKinematicOperation, agxModel::ConvexSoil, agx::IterativeProjectedConeFriction, agxSDK::SimulationStatisticsListener, agxSDK::LinkedStructure, agx::ConstantNormalForceOrientedBoxFrictionModel, agxDriveTrain::deprecated::FixedGear, agxVehicle::TrackProperties, agxHydraulics::HydraulicPumpActuator, agxPowerLine::ElementaryGearConstraint, agxModel::Deformable1DPointRoute, agxModel::PointNodeAttachment, agx::PropertyContainer, agxModel::SoilParticle, agxSDK::MaterialManager::MaterialManagerSerializer, agxModel::Deformable1DCylinderGeometryFactory, agxDriveTrain::deprecated::HighLevelDifferential, agxPowerLine::TorqueGenerator, agxPowerLine::PowerLine, agx::ScaleBoxFrictionModel, agxHydraulics::PistonActuator, agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation, agx::SeparationAngle, agxWire::ConvexAreaDefinition, agxCollide::Trimesh, agxControl::LoadParticleJournalOperation, agxControl::ReplaceParticleMaterialOperation, agxWire::ShapeContactNode, agxModel::Deformable1DCapsuleGeometryFactory, agx::CubicSplineLookupTable, agxHydraulics::HydraulicMotorActuator, agxSDK::GeometryContactMergeSplitThresholds, agxDriveTrain::deprecated::TorqueConverterTable, agxDriveTrain::HolonomicGear, agxModel::Deformable1DNode, agx::BoxFrictionModel, agxPowerLine::RotationalConnector, agxWire::CircularAreaDefinition, agxPowerLine::ActuatorBodyUnit, agxPowerLine::RotationalActuator, agxModel::Deformable1DBulkProperties, agx::Attachment, agxModel::Deformable1D, agx::GranularImpactDataWriter, agxPowerLine::PowerTimeIntegralLookupTable, agx::WheelJoint, agx::OrientedIterativeProjectedConeFrictionModel, agxControl::ParticleContactDumper, agxDriveTrain::deprecated::TorqueConverter, agxCable::Route, agx::Hinge, agx::RotationalAngle, agx::CubicFunction2D, agxControl::RecordParticleShapshotJournalOperation, agxDriveTrain::deprecated::HighLevelGearBox, agxTerrain::TerrainRasterizer, agxVehicle::Wheel, agxControl::SensorOperation, agxHydraulics::FlowDimension, agxModel::HeightFieldDeformerJournalRecorder, agxModel::ParticleAttributes, agxDriveTrain::Engine, agxWire::EyeNodeArea, agxModel::SurfaceVelocityConveyorBelt, agxCable::PathRoute, agx::WorldFrameBallJoint, agx::OrientedScaleBoxFrictionModel, agxPowerLine::LinearLookupTable, agxCollide::Line, agxDriveTrain::Differential, agxVehicle::TrackRoute, agxCollide::RenderMaterial, agxControl::MeasurementSensor, agxModel::DeformableMineFace, agx::AutoSleepThreshold, agxCollide::CollisionGroupManager, agxControl::ColorParticles, agxHydraulics::NeedleValve, agxModel::DeformableParticleMesh, agxDriveTrain::ElectricMotor, agxDriveTrain::SlipGear, agxModel::OneBodyTire, agxPowerLine::ActuatorRotationalDimension, agxCable::SegmentingRoute, agx::LinearLookupTable, agx::MergeSplit, agxCollide::RenderData, agxControl::RecordParticleJournalOperation, agxPowerLine::RotationalTranslationalHolonomicConnector, agxUtil::RawMesh, agxPowerLine::RotationalDimension, agxModel::WindAndWaterController::WindGenerator, agx::Physics::GranularBodySystem, agx::Prismatic, agx::VirtualConstraintInertia, agx::OrientedBoxFrictionModel, agxModel::ThreeBodyTire, agxSDK::ConstraintMergeSplitThresholds, agx::RegularizationParameters, agxSDK::LinkedSegment, agxCollide::CollisionMeshData, agx::SphericalRelSlack, agx::SlackHingeJoint, agx::SlackLockJoint, agxDriveTrain::deprecated::HighLevelTorqueConverter, agxDriveTrain::GearBox, agxCollide::Plane, agxHydraulics::detail::GraphJoiningConnector, agxModel::Deformable1DBoxGeometryFactory, agx::CylindricalJoint, agxCable::CableDamageState, agxHydraulics::CheckValve, agxPowerLine::RotationalUnit, agx::BallJoint, agx::SlackPrismaticJoint, agx::Interaction, agx::DistanceJoint, agxPowerLine::SlotMapper, agxSDK::EventListener, agx::JournalCustomDataRecorder, agxControl::SensorEvent, agxSDK::StepEventListener, agxControl::TagOperation, agx::PrismaticUniversalJoint, agx::UniversalJoint, agxCollide::Convex, agx::SlackCylindricalJoint, agxCable::IdentityRoute, agxHydraulics::deprecated::PumpUnit, agxDriveTrain::Clutch, agxHydraulics::deprecated::MotorUnit, agxModel::HeightController, agxSDK::WireMergeSplitThresholds, agxModel::WindAndWaterController::WaterFlowGenerator, agxVehicle::TrackNode, agx::ContactTangent, agxDriveTrain::ElectricMotorConstraint, agx::LockJoint, agx::SwingTwistLock, agxCollide::WireShape, agxHydraulics::detail::SpoolValveConnector, agx::SleepThreshold, agxSDK::ConstraintMergeSplitAlgorithm, agxSDK::GeometryContactMergeSplitAlgorithm, agx::Dot2Slack, agxDriveTrain::Gear, agxPowerLine::RotationalTranslationalConnector, agxPowerLine::WireWinchActuator, agxSDK::WireMergeSplitAlgorithm, agxHydraulics::Accumulator, agxHydraulics::detail::GraphJoiningConstraintImplementation, agxModel::HeightFieldDeformer, agxDriveTrain::EnginePowerGenerator, agx::AngularLockJoint, agx::PointGravityField, agx::SplineJoint, agxControl::BaseRecordParticleJournalOperation, agx::Dot1Joint, agxPowerLine::detail::RigidBodyRotationalAttachmentSentry, agxControl::RemoveParticles, agxSDK::LinkedStructureComponent, agxDriveTrain::DifferentialLockConnector, agxDriveTrain::Shaft, agx::UniformGravityField, agxLua::LuaScriptOperation, agx::ParticleContactSensor, agxCollide::MeshData, agxDriveTrain::deprecated::TorqueConverterSpeedRatioLookup, agxSDK::Collection, agx::ContactNormal, agxHydraulics::detail::ElementaryGraphJoiningConstraint, agxPowerLine::detail::WireWinchConnectorConstraintImplementation, agx::MergeSplitBodyStorage, agx::StrongInteractionConstraint, agxSDK::EnergyManager, agx::PlaneJoint, agx::ParticleSink, agx::Dot1Slack, agxDriveTrain::ElectricMotorConstraintImplementation, agxSDK::GranularContactMergeSplitAlgorithm, agxControl::SplitSensorOperation, agxDriveTrain::EngineDampingUpdater, agxControl::RemoveRigidBody, agxPowerLine::detail::WireWinchConnector, agxPowerLine::detail::ElementaryWireWinchConnectorConstraint, agxPowerLine::detail::RigidBodyTranslationalAttachmentSentry, agxSDK::MergedBodyMergeSplitAlgorithm, agxCable::RoutingNode, agxCable::CablePlasticity, agxHydraulics::detail::SpoolValveStaticFlowUnit, agxModel::PlasticityComponent, and agxCable::GeometryFactory.

Referenced by agxStream::InputArchive::readRef().

agx::Real agx::ElementaryConstraint::getCompliance ( agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
compliance for row row (row < getNumRows())
virtual agx::Real agx::ElementaryConstraint::getCurrentForce ( const agx::UInt  row = 0) const
virtualinherited

Returns the force applied last time step by this elementary constraint.

Parameters
row- row < getNumRows()
Returns
the force (given row) this elementary constraint applied during the last solve
const agx::Real* agx::ElementaryConstraint::getCurrentForces ( ) const
inherited
Returns
array of current forces - length = getNumRows()
agx::Real agx::ElementaryConstraint::getDamping ( agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
damping for row row (row < getNumRows())
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::Real agx::ElementaryConstraint::getElasticity ( agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
elasticity for row row (row < getNumRows())
virtual agx::Bool agx::ElementaryConstraint::getEnable ( ) const
virtualinherited
Returns
true if this elementary constraint is enabled - otherwise false
bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object
agx::RangeReal& agx::ElementaryConstraint::getForceRange ( const agx::UInt  row = 0)
inherited
Parameters
row- row < getNumRows()
Returns
current force range at row row
const agx::RangeReal& agx::ElementaryConstraint::getForceRange ( const agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
current force range at row row
agx::UInt32 agxStream::Serializable::getIndex ( ) const
inherited

This index is given at creation of this object.

It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 247 of file Serializable.h.

agx::UInt agx::GenericElementaryConstraint::getJacobian ( agx::Jacobian6DOFElement *  G,
agx::UInt  numBlocks,
agx::UInt  row,
agx::GWriteState::Enum  writeState 
)
overridevirtual

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.

const ElementaryConstraint::NameType & agx::ElementaryConstraint::getName ( ) const
inherited
Returns
the name of this elementary constraint

Definition at line 1274 of file ElementaryConstraint.h.

References agx::ElementaryConstraint::m_name.

virtual agx::ConstraintNlmcpCallback* agx::ElementaryConstraint::getNlCallback ( ) const
virtualinherited
Returns
solver callback instance if supported by this elementary constraint

Reimplemented in agx::FrictionController.

UInt agx::ElementaryConstraint::getNumRows ( ) const
inherited
Returns
number of rows in this elementary constraint

Definition at line 1269 of file ElementaryConstraint.h.

References agx::ElementaryConstraint::m_numRows.

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
RegularizationParameters * agx::ElementaryConstraint::getRegularizationParameters ( const agx::UInt  row = 0)
inherited
Parameters
row- row < getNumRows()
Returns
regularization parameters (holding e.g., compliance and damping) for row row (default: 0)

Definition at line 1257 of file ElementaryConstraint.h.

References agxAssert.

const RegularizationParameters * agx::ElementaryConstraint::getRegularizationParameters ( const agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
regularization parameters (holding e.g., compliance and damping) for row row (default: 0)

Definition at line 1263 of file ElementaryConstraint.h.

References agxAssert.

virtual StorageAgent* agxStream::Serializable::getStorageAgent ( ) const
pure virtualinherited
Returns
the storage agent

Implemented in agxWire::StopNode, agxWire::ConnectingNode, agxWire::EyeNode, agxWire::BodyFixedNode, agx::RigidBody, agx::Twist, agxWire::FreeNode, agx::ScrewController, agx::LockController, agxModel::WaterWrapper, agx::MergedBody, agx::MergedBody, agxModel::ConstantWindGenerator, agx::RangeController, agxModel::ConstantWaterFlowGenerator, agx::MergedBody, agx::ElectricMotorController, agx::MergedBody, agx::FrictionController, agx::MergedBody, agx::TargetSpeedController, agxModel::WindAndWaterController, agxSDK::Assembly, agx::QuatLock, agx::SphericalRel, agx::Spherical, agxWire::WireSimpleDrumController, agx::Dot2, agxModel::FractureAlgorithmBreakOnStress, agx::Swing, agxModel::FractureAlgorithmBreakOnContactForce, agx::Dot1, agxModel::FractureAlgorithmBreakOnContact, agx::Frame, agxPowerLine::detail::DimensionState3Dof< DimensionType >, agxUtil::ConstraintHolder, agxDriveTrain::PidControlledEngine, agxCable::CableDamage, agxControl::TeleportToSensorOperation, agxCollide::Geometry, agxDriveTrain::deprecated::Clutch, agxModel::Terrain, agxModel::TerrainDataInterface, agx::ObserverFrame, agxControl::StoreParticlesOperation, agxModel::SlidingNodeAttachment, agxDriveTrain::deprecated::GearBox, agxControl::EventSensor, agxPowerLine::Connection, agxModel::FractureGenerator, agxControl::LoadParticleAGXFileOperation, agxPowerLine::TranslationalConstraintImplementation, agxModel::RotatingNodeAttachment, agxModel::TwoBodyTire, agxModel::Deformable1DNodeRoute, agxPowerLine::detail::DimensionState1Dof< DimensionType >, agxPowerLine::ElementaryTranslationalConstraint, agxControl::SetVelocityOperation, agx::AddedMassInteraction, agxPowerLine::TranslationalActuator, agxDriveTrain::RpmController, agx::RigidBodyAttachment, agxVehicle::Track, agxModel::RigidNodeAttachment, agxControl::WriteParticleDataToAGXOperation, agxModel::TerrainIterativeProjectedConeFrictionModel, agxModel::Deformable1DSphereGeometryFactory, agxModel::DeformableParticleCreator, agxPowerLine::GearConstraintImplementation, agxControl::MakeParticleKinematicOperation, agxModel::ConvexSoil, agx::IterativeProjectedConeFriction, agxSDK::SimulationStatisticsListener, agxSDK::LinkedStructure, agx::ConstantNormalForceOrientedBoxFrictionModel, agxDriveTrain::deprecated::FixedGear, agxVehicle::TrackProperties, agxHydraulics::HydraulicPumpActuator, agxPowerLine::ElementaryGearConstraint, agxModel::Deformable1DPointRoute, agxModel::PointNodeAttachment, agx::PropertyContainer, agxModel::SoilParticle, agxSDK::MaterialManager::MaterialManagerSerializer, agxModel::Deformable1DCylinderGeometryFactory, agxDriveTrain::deprecated::HighLevelDifferential, agxPowerLine::TorqueGenerator, agxPowerLine::PowerLine, agx::ScaleBoxFrictionModel, agxHydraulics::PistonActuator, agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation, agx::SeparationAngle, agxWire::ConvexAreaDefinition, agxCollide::Trimesh, agxControl::LoadParticleJournalOperation, agxControl::ReplaceParticleMaterialOperation, agxWire::ShapeContactNode, agxModel::Deformable1DCapsuleGeometryFactory, agx::CubicSplineLookupTable, agxHydraulics::HydraulicMotorActuator, agxSDK::GeometryContactMergeSplitThresholds, agxDriveTrain::deprecated::TorqueConverterTable, agxDriveTrain::HolonomicGear, agxModel::Deformable1DNode, agx::BoxFrictionModel, agxPowerLine::RotationalConnector, agxWire::CircularAreaDefinition, agxPowerLine::ActuatorBodyUnit, agxPowerLine::RotationalActuator, agxModel::Deformable1DBulkProperties, agx::Attachment, agxModel::Deformable1D, agx::GranularImpactDataWriter, agxPowerLine::PowerTimeIntegralLookupTable, agx::WheelJoint, agx::OrientedIterativeProjectedConeFrictionModel, agxControl::ParticleContactDumper, agxDriveTrain::deprecated::TorqueConverter, agxCable::Route, agx::Hinge, agx::RotationalAngle, agx::CubicFunction2D, agxControl::RecordParticleShapshotJournalOperation, agxDriveTrain::deprecated::HighLevelGearBox, agxTerrain::TerrainRasterizer, agxVehicle::Wheel, agxControl::SensorOperation, agxHydraulics::FlowDimension, agxModel::HeightFieldDeformerJournalRecorder, agxModel::ParticleAttributes, agxDriveTrain::Engine, agxWire::EyeNodeArea, agxModel::SurfaceVelocityConveyorBelt, agxCable::PathRoute, agx::WorldFrameBallJoint, agx::OrientedScaleBoxFrictionModel, agxPowerLine::LinearLookupTable, agxCollide::Line, agxDriveTrain::Differential, agxVehicle::TrackRoute, agxCollide::RenderMaterial, agxControl::MeasurementSensor, agxModel::DeformableMineFace, agx::AutoSleepThreshold, agxCollide::CollisionGroupManager, agxControl::ColorParticles, agxHydraulics::NeedleValve, agxModel::DeformableParticleMesh, agxDriveTrain::ElectricMotor, agxDriveTrain::SlipGear, agxModel::OneBodyTire, agxPowerLine::ActuatorRotationalDimension, agxCable::SegmentingRoute, agx::LinearLookupTable, agx::MergeSplit, agxCollide::RenderData, agxControl::RecordParticleJournalOperation, agxPowerLine::RotationalTranslationalHolonomicConnector, agxUtil::RawMesh, agxPowerLine::RotationalDimension, agxModel::WindAndWaterController::WindGenerator, agx::Physics::GranularBodySystem, agx::Prismatic, agx::VirtualConstraintInertia, agx::OrientedBoxFrictionModel, agxModel::ThreeBodyTire, agxSDK::ConstraintMergeSplitThresholds, agx::RegularizationParameters, agxSDK::LinkedSegment, agxCollide::CollisionMeshData, agx::SphericalRelSlack, agx::SlackHingeJoint, agx::SlackLockJoint, agxDriveTrain::deprecated::HighLevelTorqueConverter, agxDriveTrain::GearBox, agxCollide::Plane, agxHydraulics::detail::GraphJoiningConnector, agxModel::Deformable1DBoxGeometryFactory, agx::CylindricalJoint, agxCable::CableDamageState, agxHydraulics::CheckValve, agxPowerLine::RotationalUnit, agx::BallJoint, agx::SlackPrismaticJoint, agx::Interaction, agx::DistanceJoint, agxPowerLine::SlotMapper, agxSDK::EventListener, agx::JournalCustomDataRecorder, agxControl::SensorEvent, agxSDK::StepEventListener, agxControl::TagOperation, agx::PrismaticUniversalJoint, agx::UniversalJoint, agxCollide::Convex, agx::SlackCylindricalJoint, agxCable::IdentityRoute, agxHydraulics::deprecated::PumpUnit, agxDriveTrain::Clutch, agxHydraulics::deprecated::MotorUnit, agxModel::HeightController, agxSDK::WireMergeSplitThresholds, agxModel::WindAndWaterController::WaterFlowGenerator, agxVehicle::TrackNode, agx::ContactTangent, agxDriveTrain::ElectricMotorConstraint, agx::LockJoint, agx::SwingTwistLock, agxCollide::WireShape, agxHydraulics::detail::SpoolValveConnector, agx::SleepThreshold, agxSDK::ConstraintMergeSplitAlgorithm, agxSDK::GeometryContactMergeSplitAlgorithm, agx::Dot2Slack, agxDriveTrain::Gear, agxPowerLine::RotationalTranslationalConnector, agxPowerLine::WireWinchActuator, agxSDK::WireMergeSplitAlgorithm, agxHydraulics::Accumulator, agxHydraulics::detail::GraphJoiningConstraintImplementation, agxModel::HeightFieldDeformer, agxDriveTrain::EnginePowerGenerator, agx::AngularLockJoint, agx::PointGravityField, agx::SplineJoint, agxControl::BaseRecordParticleJournalOperation, agx::Dot1Joint, agxControl::RemoveParticles, agxSDK::LinkedStructureComponent, agxDriveTrain::DifferentialLockConnector, agxDriveTrain::Shaft, agxPowerLine::detail::RigidBodyRotationalAttachmentSentry, agx::UniformGravityField, agxLua::LuaScriptOperation, agx::ParticleContactSensor, agxCollide::MeshData, agxDriveTrain::deprecated::TorqueConverterSpeedRatioLookup, agxSDK::Collection, agx::ContactNormal, agxHydraulics::detail::ElementaryGraphJoiningConstraint, agxPowerLine::detail::WireWinchConnectorConstraintImplementation, agx::MergeSplitBodyStorage, agx::StrongInteractionConstraint, agxSDK::EnergyManager, agx::PlaneJoint, agx::ParticleSink, agx::Dot1Slack, agxDriveTrain::ElectricMotorConstraintImplementation, agxSDK::GranularContactMergeSplitAlgorithm, agxControl::SplitSensorOperation, agxDriveTrain::EngineDampingUpdater, agxControl::RemoveRigidBody, agxPowerLine::detail::WireWinchConnector, agxPowerLine::detail::ElementaryWireWinchConnectorConstraint, agxSDK::MergedBodyMergeSplitAlgorithm, agxCable::RoutingNode, agxCable::CablePlasticity, agxHydraulics::detail::SpoolValveStaticFlowUnit, agxPowerLine::detail::RigidBodyTranslationalAttachmentSentry, agxModel::PlasticityComponent, and agxCable::GeometryFactory.

agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

agx::UInt agx::GenericElementaryConstraint::getVelocity ( agx::Real *  v,
agx::UInt  row 
) const
overridevirtual

Returns the velocity of this elementary constraint (extra, driving term on the right hand side).

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

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

Reimplemented from agx::ElementaryConstraint.

agx::UInt agx::GenericElementaryConstraint::getViolation ( agx::Real *  g,
agx::UInt  row 
)
overridevirtual

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.

template<typename T >
bool agx::Referenced::is ( ) const
inherited
agx::Bool agx::GenericElementaryConstraint::isActive ( ) const
overridevirtual

An elementary constraint is defined to be active if enabled.

Yet constraints can be enabled but not active (e.g., RangeController when the range isn't exceeded).

Returns
true if this elementary constraint is active - otherwise false

Reimplemented from agx::ElementaryConstraint.

bool agxStream::Serializable::isFinished ( ) const
inherited
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 252 of file Serializable.h.

agx::Bool agx::GenericElementaryConstraint::isImpacting ( ) const
overridevirtual
Returns
true of this elementary constraint is impacting

Reimplemented from agx::ElementaryConstraint.

void agx::ElementaryConstraint::linearizeCompliance ( const agx::Real *  violations,
agx::Real *  epsilons,
agx::Real  minPerturbation 
) const
inlinevirtualinherited

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.

For most ElementaryConstraints this does nothing. For QuatLock the epsilon is modified to account for the nonlinear nature of quaternion's relation to the angle of rotation they represent.

This function is called by the engine during constraint preparation for solve.

Reimplemented in agx::QuatLock.

Definition at line 1279 of file ElementaryConstraint.h.

virtual agx::Bool agx::GenericElementaryConstraint::onPrepare ( )
virtual

Callback when the elementary constraints in the constraint receives the prepare call.

The return value defines if this elementary constraint is active or not (regardless of the enable flag). When this elementary constraint isn't active, onWriteData won't be called.

Returns
true if this elementary constraint is active, false if inactive
virtual void agx::GenericElementaryConstraint::onWriteData ( agx::GenericConstraintBodyData *  rb1Data,
agx::GenericConstraintBodyData *  rb2Data,
agx::GenericConstraintData *  constraintData 
)
virtual

Callback when to write Jacobian and constraint data if this elementary constraint is active.

Parameters
rb1Data- constraint body data (Jacobian) for the first rigid body in the constraint
rb2Data- constraint body data (Jacobian) for the second rigid body in the constraint
constraintData- constraint data for this elementary constraint
virtual agx::UInt agx::ElementaryConstraint::postSolveCallback ( const agx::Real *  solution,
agx::UInt  row,
agx::Real  h 
)
virtualinherited

Callback after solve, with the solution.

Parameters
solution- solution of the last solve
row- start row in solution for this elementary constraint
h- current time step length
Returns
number of rows read (= number of rows of this elementary constraint)

Reimplemented in agx::FrictionController.

void agx::GenericElementaryConstraint::prepare ( )
overridevirtual

Prepare call.

After this call the elementary constraint may be activated.

Reimplemented from agx::ElementaryConstraint.

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.

Referenced by agxData::Val< UInt >::Val().

void agx::ElementaryConstraint::reset ( )
inherited

Reset call.

Call this to zero the solution vector for the ElementaryConstraint.

virtual void agx::ElementaryConstraint::restoreLightData ( agxStream::StorageStream &  str)
overridevirtualinherited
void agx::GenericElementaryConstraint::setAttachmentPair ( const agx::AttachmentPair *  ap)
overridevirtual

Call for elementary constraints dependent on attachment pairs.

Ignored by this base class.

Reimplemented from agx::ElementaryConstraint.

void agx::ElementaryConstraint::setCompliance ( agx::Real  compliance,
int  row 
)
inherited

Assign compliance for a given row, or all rows if row = -1 (default).

Parameters
compliance- new compliance
row- row to assign compliance. If i < 0 to assign all rows.
void agx::ElementaryConstraint::setCompliance ( agx::Real  compliance)
inherited
void agx::ElementaryConstraint::setDamping ( agx::Real  damping,
int  row 
)
inherited

Assign damping for a given row, or all rows if row = -1 (default).

Note
Calling this method for non-holonomic rows (e.g. Motor1D) has no effect.
Parameters
damping- new damping
row- row to assign damping. If i < 0 to assign all rows.
void agx::ElementaryConstraint::setDamping ( agx::Real  damping)
inherited
static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

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

void agx::ElementaryConstraint::setElasticity ( agx::Real  elasticity,
int  row 
)
inherited

Assign elasticity for a given row, or all rows if row = -1 (default).

Parameters
elasticity- new elasticity
row- row to assign elasticity. If i < 0 to assign all rows.
void agx::ElementaryConstraint::setElasticity ( agx::Real  elasticity)
inherited
virtual void agx::ElementaryConstraint::setEnable ( agx::Bool  enable)
virtualinherited

Enable/disable this elementary constraint.

Parameters
enable- true to enable, false to disable
void agxStream::Serializable::setEnableSerialization ( bool  flag)
inherited

Set to false to disable serialization of this object.

It will just be ignored during serialization (writing). It is still possible to restore TO this object.

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
staticinherited

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

void agxStream::Serializable::setFinished ( )
inherited

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

void agx::ElementaryConstraint::setForceRange ( agx::RangeReal  forceRange,
const agx::UInt  row = 0 
)
inherited

Assign force range to a given row.

Note
row is default 0. I.e., it is not defined to assign forceRange to all rows in one call.
Parameters
forceRange- new force range
row- row < getNumRows()
void agx::ElementaryConstraint::setForceRange ( agx::Real  lower,
agx::Real  upper,
const agx::UInt  row = 0 
)
inherited

Assign force range to a given row.

Note
row is default 0. I.e., it is not defined to assign lower and upper to all rows in one call.
Parameters
lower- lower force range (typically <= 0)
upper- upper force range (typically >= 0)
row- row < getNumRows()
void agx::ElementaryConstraint::setName ( const agx::ElementaryConstraint::NameType &  name)
inherited

Name this elementary constraint.

Parameters
name- new name of this elementary constraint
void agxStream::Serializable::setUuid ( const agx::Uuid &  uuid)
inherited

Explicitly set a Uuid on a serializable object.

Use this method with great care, as it can result in non-unique identifiers in the system!

virtual void agx::ElementaryConstraint::storeLightData ( agxStream::StorageStream &  str) const
overridevirtualinherited
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.

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.

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

Member Data Documentation

agx::Bool agx::ElementaryConstraint::m_enable
protectedinherited

enabled

Definition at line 334 of file ElementaryConstraint.h.

agx::ref_ptr<agx::Referenced> agx::ElementaryConstraint::m_internalData
protectedinherited

custom, internal data

Definition at line 340 of file ElementaryConstraint.h.

agx::Real* agx::ElementaryConstraint::m_lfs
protectedinherited

last forces

Definition at line 338 of file ElementaryConstraint.h.

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

agx::ElementaryConstraint::NameType agx::ElementaryConstraint::m_name
protectedinherited

name

Definition at line 336 of file ElementaryConstraint.h.

Referenced by agx::ElementaryConstraint::getName().

agx::UInt agx::ElementaryConstraint::m_numRows
protectedinherited

number of rows

Definition at line 335 of file ElementaryConstraint.h.

Referenced by agx::ElementaryConstraint::getNumRows().

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

agx::RegularizationParameters* agx::ElementaryConstraint::m_rps
protectedinherited

regularization parameters

Definition at line 337 of file ElementaryConstraint.h.

agx::RangeReal* agx::ElementaryConstraint::m_ubs
protectedinherited

user bounds

Definition at line 339 of file ElementaryConstraint.h.


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