|
AGX Dynamics 2.41.3.0
|
#include <ConstraintImplementation.h>
Inheritance diagram for agx::ConstraintImplementation:Classes | |
| class | BodyView |
| Interface to the bodies, either user or solver, since these bodies can differ when e.g., a body is merged. More... | |
| class | ConstrainedBodiesState |
| Object that holds the state seen from the user and from the solver. More... | |
| class | SolverBodyView |
Public Types | |
| enum | Tags { NONE = 0 , MANY_BODY = (1<<0) , DEFAULT_BINARY_TAG = NONE , DEFAULT_MANY_BODY_TAG = MANY_BODY } |
Public Member Functions | |
| ConstraintImplementation () | |
| Default constructor. | |
| virtual | ~ConstraintImplementation () |
| Destructor. | |
| virtual bool | addElementaryConstraint (const agx::String &name, agx::ElementaryConstraint *elementaryConstraint) |
| Add elementary constraint (like Spherical, Dot1, Dot2 etc) given name. | |
| virtual void | addNlCallbacks (agx::SparseRangeReal &sparseRangeReal, const NlmcpCallbackSolverData &solverData) const |
| Interface for non-linear callback from solver. | |
| virtual void | addNotification () |
| Callback when this constraint is added to Simulation. | |
| virtual bool | addSecondaryConstraint (const agx::String &name, agx::ElementaryConstraint *secondaryConstraint) |
| Add secondary constraint (like motor, range and/or lock etc) given name. | |
| RealVector | calculateCurrentViolation () const |
| Calculates the current violation of the ordinary degrees of freedom of this constraint, e.g., three translational and two rotational (total 5 elements) of a hinge, i.e., controllers DOF are not included. | |
| agx::UInt | calculateNumActiveRows () const |
| Calculates the current number of active rows, including both elementary and secondary constraints. | |
| agx::Real | calculateViolationVectorAverageSize () |
| Gets the average size of the elements in getViolation() by calculating the magnitude and dividing by the number of elements. | |
| template<typename T > | |
| T * | findSecondaryConstraintGivenType (const agx::UInt count=0) const |
| bool | getActive () const |
| virtual agx::Real | getAngle (agx::UInt=0) const |
| If the constraint supports angle calculations and 'dof' is in range, this method returns the angle of the given degree of freedom. | |
| virtual agx::AttachmentPair * | getAttachmentPair () const |
| agx::UInt | getBlockRowIndex () const |
| const BlockStructure & | getBlockStructure () const |
| virtual void | getBounds (agx::RangeReal *bounds, agx::Real dt) const |
| Calculates and pushes the bounds into a sparse range data structure. | |
| virtual int | getConstraintVelocity (agx::Real *v, int row) |
| Calculates and pushes the constraint velocities into array given current row. | |
| virtual agx::Real | getCurrentSpeed (agx::UInt=0) const |
| If this method is implemented, a call to this method will return the current speed of the angle. | |
| virtual agx::ElementaryConstraint * | getElementaryConstraint (const agx::String &name) const |
| virtual agx::ElementaryConstraint * | getElementaryConstraint (const agx::UInt index) const |
| agx::ElementaryConstraint::RefContainer & | getElementaryConstraints () |
| const agx::ElementaryConstraint::RefContainer & | getElementaryConstraints () const |
| virtual bool | getEnable () const |
| virtual agx::Bool | getEnableComputeForces () const |
| bool | getEnableLinearization () const |
| virtual void | getEpsilon (agx::Real *epsilon, agx::Real h) |
Writes regularization parameters for all active rows into epsilon. | |
| agx::FrictionController * | getFrictionController (agx::UInt number=0) const |
| agx::UInt | getJacobianRowUsage () const |
| virtual agx::Bool | getLastForce (agx::UInt bodyIndex, agx::Vec3 &retForce, agx::Vec3 &retTorque, agx::Bool giveForceAtCm=false) const |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body with bodyIndex. | |
| virtual agx::Bool | getLastForce (const agx::RigidBody *rb, agx::Vec3 &retForce, agx::Vec3 &retTorque, agx::Bool giveForceAtCm=false) const |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body rb. | |
| virtual agx::Bool | getLastLocalForce (agx::UInt bodyIndex, agx::Vec3 &retForce, agx::Vec3 &retTorque, agx::Bool giveForceAtCm=false) const |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body with bodyIndex. | |
| virtual agx::Bool | getLastLocalForce (const agx::RigidBody *rb, agx::Vec3 &retForce, agx::Vec3 &retTorque, agx::Bool giveForceAtCm=false) const |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body rb. | |
| agx::Lock1D * | getLock1D (agx::UInt number=0) const |
| agx::Motor1D * | getMotor1D (agx::UInt number=0) const |
| virtual void | getParameters (agx::Real *violation, agx::Real *epsilon, agx::Real *damping, bool *holonomic, agx::Real *velocity, agx::RangeReal *bounds, int8_t *indexSetState, agx::Real h, agx::Real minPerturbation=agx::Real(1E-10)) |
| Writes solver parameters such as damping and holonomic. | |
| agx::Range1D * | getRange1D (agx::UInt number=0) const |
| virtual agx::ElementaryConstraint * | getSecondaryConstraint (const agx::String &name) const |
| virtual agx::ElementaryConstraint * | getSecondaryConstraint (const agx::UInt index) const |
| agx::ElementaryConstraint::RefContainer & | getSecondaryConstraints () |
| const agx::ElementaryConstraint::RefContainer & | getSecondaryConstraints () const |
| bool | getSolveBoth () const |
| bool | getSolveIterative () const |
| SolverBodyView | getSolverView () const |
| Bodies as viewed from the solver. | |
| Constraint::SolveType | getSolveType () const |
| ConstraintImplPtrVector & | getSubConstraints () |
| const ConstraintImplPtrVector & | getSubConstraints () const |
| int | getTag () const |
| BodyView | getUserView () const |
| Bodies as viewed from the user. | |
| virtual int | getViolation (agx::Real *g, int row) |
| Calculates and pushes the constraint values into array given current row. | |
| void | incrementConstraintCount (RigidBody *rb) const |
Increment the number of constraints connection to rb. | |
| bool | isImpacting () const |
| bool | isValid () const |
| void | onDirectComplianceMatrix (Real *data, unsigned int ld) const |
| Internal callback from the direct solver with perturbation matrix data. | |
| virtual void | postSolveCallback (const agx::Jacobian6DOFElement *jacobians, const agx::Real *solution, agx::Real dt) |
| Peak at the solution after the solver is done. | |
| void | postSolveIndexSetCallback (const int8_t *state) |
| Callback after the solver is done about the state of each equation in the constraint. | |
| virtual void | postSystemCallback (DynamicsSystem *system) |
| Last in the dynamics system step forward loop, this constraint gets a call with the main system. | |
| virtual void | prepare () |
| Prepares this constraint. | |
| virtual void | preSystemCallback (DynamicsSystem *system) |
| Before prepare, and before the system writes to the data buffers, this constraint gets a call with the main system it's in. | |
| virtual bool | rebind () |
| The general version of rebind takes the first attachment frame and moves the other attachment frame so they have the exact same world transform. | |
| virtual bool | removeElementaryConstraint (agx::ElementaryConstraint *elementaryConstraint) |
| Remove elementary constraint. | |
| virtual bool | removeElementaryConstraint (const agx::String &name) |
| Remove elementary constraint. | |
| virtual void | removeNotification () |
| Callback when this constraint is removed from Simulation. | |
| virtual bool | removeSecondaryConstraint (agx::ElementaryConstraint *secondaryConstraint) |
| Remove secondary constraint. | |
| virtual bool | removeSecondaryConstraint (const agx::String &name) |
| Remove secondary constraint. | |
| void | reset () |
| Reset the solution vectors of the primary and secondary elementary constraints in the implementation. | |
| void | setBlockRowIndex (agx::UInt blockRowIndex) |
| Sets the global start index for this constraint in the global, non-permuted matrix. | |
| virtual void | setEnable (bool enable) |
| Sets the enable flag. | |
| virtual void | setEnableComputeForces (agx::Bool enable) |
| Enable (or disable) computation of the forces applied to the dynamic bodies in this constraint. | |
| void | setEnableLinearization (bool enable) |
| Control whether or not linearization should be performed on the ElementaryConstraints that require it, such as QuatLock. | |
| void | setSolveType (Constraint::SolveType type) |
| Set solve type, either DIRECT, ITERATIVE or DIRECT_AND_ITERATIVE. | |
| void | sort () |
| This method will sort this constraint by global indexing of the bodies. | |
| virtual CALLABLE_IGNORE void | updateComplianceMatrix (LSquareComplianceMatrix matrix) const |
| Callback with read/write access to the compliance matrix of this constraint in the direct solver. | |
| virtual size_t | updateJacobian (agx::Jacobian6DOFElement *jacobians) |
| Updated storing of Jacobian matrices. | |
| virtual bool | updateValid () |
| Updates the valid conditions for this constraint. | |
| virtual agx::Attachment * | userAPIgetAttachment (agx::UInt) const |
| virtual agx::Attachment * | userAPIgetAttachment (const agx::RigidBody *) const |
| agx::Real | userAPIgetCompliance (agx::UInt dof) const |
| agx::Real | userAPIgetCurrentForce (agx::UInt dof) const |
Consider using getLastForce instead. | |
| agx::Real | userAPIgetDamping (agx::UInt dof) const |
| agx::RangeReal | userAPIgetForceRange (agx::UInt dof) const |
Get the force range for DOF dof. | |
| agx::RegularizationParameters * | userAPIgetRegularizationParameters (agx::UInt i) |
| Get the regularization parameter i, i.e., the regularization parameter for equation i which is constraint dependent. | |
| const agx::RegularizationParameters * | userAPIgetRegularizationParameters (agx::UInt i) const |
| void | userAPIsetCompliance (agx::Real compliance, int dof) |
| Set the compliance for constraint row i of this constraint. | |
| void | userAPIsetDamping (agx::Real damping, int dof) |
| Set the damping for constraint row i of this constraint. | |
| void | userAPIsetForceRange (agx::RangeReal forceRange, agx::Int dof) |
| Assign force range, of an elementary constraint, for a given DOF. | |
Public Attributes | |
| void * | customData |
| Custom data for the solvers to store data into. | |
Protected Types | |
| using | LocalState = agx::BitState< State, Int32 > |
| enum | State : Int32 { VALID = 1 << 0 , IMPACTING = 1 << 1 , SUPPORTS_COMPLIANCE_MATRIX = 1 << 2 } |
Protected Member Functions | |
| void | setSimulation (agxSDK::Simulation *simulation) |
| Set the Simulation this constraint belongs to. | |
| void | setSupportsComplianceMatrix (Bool supportsComplianceMatrix) |
| Enable/disable compliance matrix callbacks from the direct solver where read/write access to the compliance matrix will be available in an implementation of updateComplianceMatrix. | |
Protected Attributes | |
| UInt | m_blockRowIndex |
| Start block row for this constraint in the global matrix. | |
| BlockStructure | m_blockStructure |
| The block structure; number of block, rows, dynamic blocks etc. | |
| ConstraintRigidBodyContainer | m_bodies |
| Vector with observer pointers to bodies. | |
| ConstrainedBodiesState | m_constrainedBodiesState |
| State of the included bodies, updated in updateValid. | |
| ElementaryConstraint::RefContainer | m_ec |
| Vector of elementary constraints. | |
| bool | m_enable |
| User controlled enable flag, constraint ignored by solver if false. | |
| bool | m_enableLinearization |
| When necessary, tweak the values sent to the solver to make violation depend linearly on force or torque. | |
| LocalState | m_localState |
| Current local state, updated all the time, not serialized. | |
| UInt | m_numRows |
| Number of rows used by this constraint. | |
| ElementaryConstraint::RefContainer | m_sc |
| Vector of secondary constraints. | |
| Constraint::SolveType | m_solveType |
| Only for supported solvers. | |
| ConstraintImplPtrVector | m_subConstraints |
| Vector with sub-constraints. | |
| int | m_tag |
| Tag for this constraint. | |
Definition at line 98 of file ConstraintImplementation.h.
|
protected |
Definition at line 992 of file ConstraintImplementation.h.
|
protected |
| Enumerator | |
|---|---|
| VALID | |
| IMPACTING | |
| SUPPORTS_COMPLIANCE_MATRIX | |
Definition at line 984 of file ConstraintImplementation.h.
| Enumerator | |
|---|---|
| NONE | |
| MANY_BODY | Default is binary, i.e., ~MANY_BODY. |
| DEFAULT_BINARY_TAG | |
| DEFAULT_MANY_BODY_TAG | |
Definition at line 101 of file ConstraintImplementation.h.
| agx::ConstraintImplementation::ConstraintImplementation | ( | ) |
Default constructor.
Defaults to binary (one or two body) constraint, solve type DIRECT, enabled and valid.
|
virtual |
Destructor.
Doesn't delete any user-added, non-ref-counted objects.
|
virtual |
Add elementary constraint (like Spherical, Dot1, Dot2 etc) given name.
General for elementary constraints is that their input is based on body relative data (far from general).
|
virtual |
Interface for non-linear callback from solver.
|
inlinevirtual |
Callback when this constraint is added to Simulation.
Definition at line 581 of file ConstraintImplementation.h.
|
virtual |
Add secondary constraint (like motor, range and/or lock etc) given name.
General for secondary constraints is that their input is based on the current constraint angle.
| RealVector agx::ConstraintImplementation::calculateCurrentViolation | ( | ) | const |
Calculates the current violation of the ordinary degrees of freedom of this constraint, e.g., three translational and two rotational (total 5 elements) of a hinge, i.e., controllers DOF are not included.
| agx::UInt agx::ConstraintImplementation::calculateNumActiveRows | ( | ) | const |
Calculates the current number of active rows, including both elementary and secondary constraints.
The result can be used to allocate temporary buffers for additional calls to solver related methods, e.g., getViolation.
| agx::Real agx::ConstraintImplementation::calculateViolationVectorAverageSize | ( | ) |
Gets the average size of the elements in getViolation() by calculating the magnitude and dividing by the number of elements.
|
inline |
count occurrences (of that type) Definition at line 1382 of file ConstraintImplementation.h.
References m_sc, and agx::Container::size().
|
inline |
Definition at line 640 of file ConstraintImplementation.h.
If the constraint supports angle calculations and 'dof' is in range, this method returns the angle of the given degree of freedom.
Reimplemented in agx::HighLevelConstraintImplementation.
Definition at line 872 of file ConstraintImplementation.h.
|
inlinevirtual |
Reimplemented in agx::HighLevelConstraintImplementation.
Definition at line 772 of file ConstraintImplementation.h.
|
inline |
Definition at line 529 of file ConstraintImplementation.h.
|
inline |
Definition at line 518 of file ConstraintImplementation.h.
|
virtual |
Calculates and pushes the bounds into a sparse range data structure.
Every equation in this constraint that has a bound must during this call push its bounds at its current global row (row + localRow). The bounds is not a force, rather an impulse (dimension force*time).
| bounds | - all bounds, use bounds.push_back( IndexedRangeReal( std::make_pair( row + localRow, RangeReal( myLowerBound, myUpperBound ) ) ) ) |
| dt | - time step, often used to scale forces to impulses |
|
virtual |
Calculates and pushes the constraint velocities into array given current row.
Constraint velocity is mainly used for non-holonomic constraint such as hinge- and prismatic motors.
| v | - array of constraint velocity values, must at least be of size row + numRowsThisConstraintUses |
| row | - row to start push values (v[row] = firstConstraintValue) |
|
inlinevirtual |
If this method is implemented, a call to this method will return the current speed of the angle.
This is only valid for 1DOF and 2DOF constraints (such as hinge, prismatic, distance and cylindrical).
Definition at line 879 of file ConstraintImplementation.h.
|
virtual |
| name | - name of the elementary constraint |
|
virtual |
| index | - index of the elementary constraint |
|
inline |
Definition at line 597 of file ConstraintImplementation.h.
|
inline |
Definition at line 598 of file ConstraintImplementation.h.
|
inlinevirtual |
Definition at line 629 of file ConstraintImplementation.h.
|
virtual |
Reimplemented in agx::HighLevelConstraintImplementation.
| bool agx::ConstraintImplementation::getEnableLinearization | ( | ) | const |
Writes regularization parameters for all active rows into epsilon.
| epsilon | - array to write into (number of active rows allocated) |
| h | - current time step |
| agx::FrictionController * agx::ConstraintImplementation::getFrictionController | ( | agx::UInt | number = 0 | ) | const |
|
inline |
Definition at line 513 of file ConstraintImplementation.h.
|
virtual |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body with bodyIndex.
The force is given in world coordinates and is the one applied at the anchor position of this constraint.
The result includes force and torque from this constraint including all enabled controllers (e.g., motors, locks, ranges).
| bodyIndex | - index of body, if number of bodies = 1 and bodyIndex = 1, the force and torque applied to "the world body" is returned |
| retForce | - the force applied by this constraint on body at bodyIndex last solve |
| retTorque | - the torque applied by this constraint on body at bodyIndex last solve |
| giveForceAtCm | - this parameter affects the resulting torque. The default behavior (giveForceAtCm = false) calculates the force applied by this constraint at the anchor position. Letting giveForceAtCm = true, the force will be applied at center of mass, affecting the torque as \(T_{new} = T - r \times F\) where r is the vector from the anchor point to the center of mass of the body. |
retForce and retTorque - otherwise false Reimplemented in agx::HighLevelConstraintImplementation.
|
virtual |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body rb.
The force is given in world coordinates and is the one applied at the anchor position of this constraint.
The result includes force and torque from this constraint including all enabled controllers (e.g., motors, locks, ranges).
| rb | - body in this constraint. If this constraint is attached in world, nullptr can be used. |
| retForce | - the force applied by this constraint on body rb at the last solve |
| retTorque | - the torque applied by this constraint on body rb at the last solve |
| giveForceAtCm | - this parameter affects the resulting torque. The default behavior (giveForceAtCm = false) calculates the force applied by this constraint at the anchor position. Letting giveForceAtCm = true, the force will be applied at center of mass, affecting the torque as \(T_{new} = T - r \times F\) where r is the vector from the anchor point to the center of mass of the body. |
retForce and retTorque - otherwise false Reimplemented in agx::HighLevelConstraintImplementation.
|
virtual |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body with bodyIndex.
The force is given in the frame of the constraint.
The result includes force and torque from this constraint including all enabled controllers (e.g., motors, locks, ranges).
| bodyIndex | - index of body, if number of bodies = 1 and bodyIndex = 1, the force and torque applied to "the world body" is returned |
| retForce | - the force applied by this constraint on body at bodyIndex last solve |
| retTorque | - the torque applied by this constraint on body at bodyIndex last solve |
| giveForceAtCm | - this parameter affects the resulting torque. The default behavior (giveForceAtCm = false) calculates the force applied by this constraint at the anchor position. Letting giveForceAtCm = true, the force will be applied at center of mass, affecting the torque as \(T_{new} = T - r \times F\) where r is the vector from the anchor point to the center of mass of the body. |
retForce and retTorque - otherwise false Reimplemented in agx::HighLevelConstraintImplementation.
|
virtual |
If 'compute forces' is enabled, returns the last force and torque applied by this constraint on the body rb.
The force is given in the frame of the constraint.
The result includes force and torque from this constraint including all enabled controllers (e.g., motors, locks, ranges).
| rb | - body in this constraint. If this constraint is attached in world, nullptr can be used. |
| retForce | - the force applied by this constraint on body rb at the last solve |
| retTorque | - the torque applied by this constraint on body rb at the last solve |
| giveForceAtCm | - this parameter affects the resulting torque. The default behavior (giveForceAtCm = false) calculates the force applied by this constraint at the anchor position. Letting giveForceAtCm = true, the force will be applied at center of mass, affecting the torque as \(T_{new} = T - r \times F\) where r is the vector from the anchor point to the center of mass of the body. |
retForce and retTorque - otherwise false Reimplemented in agx::HighLevelConstraintImplementation.
| agx::Lock1D * agx::ConstraintImplementation::getLock1D | ( | agx::UInt | number = 0 | ) | const |
| agx::Motor1D * agx::ConstraintImplementation::getMotor1D | ( | agx::UInt | number = 0 | ) | const |
|
virtual |
Writes solver parameters such as damping and holonomic.
This should be deprecated.
| agx::Range1D * agx::ConstraintImplementation::getRange1D | ( | agx::UInt | number = 0 | ) | const |
|
virtual |
| name | - name of the elementary constraint |
|
virtual |
| index | - index of the secondary constraint |
|
inline |
Definition at line 603 of file ConstraintImplementation.h.
|
inline |
Definition at line 604 of file ConstraintImplementation.h.
|
inline |
Definition at line 540 of file ConstraintImplementation.h.
|
inline |
Definition at line 535 of file ConstraintImplementation.h.
| SolverBodyView agx::ConstraintImplementation::getSolverView | ( | ) | const |
Bodies as viewed from the solver.
It's only valid to use this interface if you're a solver.
|
inline |
Definition at line 550 of file ConstraintImplementation.h.
|
inline |
Definition at line 609 of file ConstraintImplementation.h.
|
inline |
Definition at line 610 of file ConstraintImplementation.h.
|
inline |
Definition at line 566 of file ConstraintImplementation.h.
| BodyView agx::ConstraintImplementation::getUserView | ( | ) | const |
Bodies as viewed from the user.
This is the default way to look at the bodies.
|
virtual |
Calculates and pushes the constraint values into array given current row.
| g | - array of constraint values, must at least be of size row + numRowsThisConstraintUses |
| row | - row to start push values (g[row] = firstConstraintValue) |
|
inline |
Increment the number of constraints connection to rb.
| rb | - rigid body to increment the constraint count |
Definition at line 561 of file ConstraintImplementation.h.
References agxAssert.
|
inline |
Definition at line 555 of file ConstraintImplementation.h.
|
inline |
Definition at line 645 of file ConstraintImplementation.h.
| void agx::ConstraintImplementation::onDirectComplianceMatrix | ( | Real * | data, |
| unsigned int | ld | ||
| ) | const |
Internal callback from the direct solver with perturbation matrix data.
|
virtual |
Peak at the solution after the solver is done.
| jacobians | - Jacobian rows for this constraint (index 0 is first dynamic body first row) |
| solution | - solution (impulse - divide by dt to get force) |
| dt | - time step size used to get solution |
Reimplemented in agx::HighLevelConstraintImplementation.
| void agx::ConstraintImplementation::postSolveIndexSetCallback | ( | const int8_t * | state | ) |
Callback after the solver is done about the state of each equation in the constraint.
The information is if an equation was at a upper or lower bound or free.
|
inlinevirtual |
Last in the dynamics system step forward loop, this constraint gets a call with the main system.
This call is made after the data buffers have been written back to the bodies.
| system | - the main dynamics system |
Reimplemented in agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation.
Definition at line 1397 of file ConstraintImplementation.h.
|
virtual |
Prepares this constraint.
Update attachment transforms given the current transforms of the bodies (in most cases equivalent to calculate the Jacobian), compute the joint angles (if this constraint supports that) and calculates the amount of data needed.
Reimplemented in agx::HighLevelConstraintImplementation, and agxPowerLine::ActuatorConstraintImplementation.
|
inlinevirtual |
Before prepare, and before the system writes to the data buffers, this constraint gets a call with the main system it's in.
During this call it's possible to add or remove bodies from the system, bodies this constraint are responsible of.
| system | - the main dynamics system |
Reimplemented in agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation.
Definition at line 1395 of file ConstraintImplementation.h.
|
inlinevirtual |
The general version of rebind takes the first attachment frame and moves the other attachment frame so they have the exact same world transform.
This means that the first rigid body is the reference (other is another rigid body or world). E.g., Prismatic and Hinge axis will be preserved seen from the reference body.
Reimplemented in agx::HighLevelConstraintImplementation.
Definition at line 623 of file ConstraintImplementation.h.
|
virtual |
Remove elementary constraint.
| elementaryConstraint | - elementary constraint to remove |
|
virtual |
Remove elementary constraint.
| name | - name of the elementary constraint to remove |
|
inlinevirtual |
Callback when this constraint is removed from Simulation.
Definition at line 586 of file ConstraintImplementation.h.
|
virtual |
Remove secondary constraint.
| secondaryConstraint | - secondary constraint to remove |
|
virtual |
Remove secondary constraint.
| name | - name of the secondary constraint to remove |
| void agx::ConstraintImplementation::reset | ( | ) |
Reset the solution vectors of the primary and secondary elementary constraints in the implementation.
|
inline |
Sets the global start index for this constraint in the global, non-permuted matrix.
| blockRowIndex | - global start row for this constraint in the global, non-permuted matrix |
Definition at line 524 of file ConstraintImplementation.h.
|
virtual |
Sets the enable flag.
If this flags sets to false the solver will ignore this constraint.
| enable | - set to true if this constraint should be enabled, false to disable it |
|
virtual |
Enable (or disable) computation of the forces applied to the dynamic bodies in this constraint.
Matrix-vector operation to compute the forces after solve.
| enable | - true to enable, false to disable |
Reimplemented in agx::HighLevelConstraintImplementation.
| void agx::ConstraintImplementation::setEnableLinearization | ( | bool | enable | ) |
Control whether or not linearization should be performed on the ElementaryConstraints that require it, such as QuatLock.
|
protected |
Set the Simulation this constraint belongs to.
| simulation | - the Simulation this constraint belongs to |
|
inline |
Set solve type, either DIRECT, ITERATIVE or DIRECT_AND_ITERATIVE.
Definition at line 545 of file ConstraintImplementation.h.
|
protected |
Enable/disable compliance matrix callbacks from the direct solver where read/write access to the compliance matrix will be available in an implementation of updateComplianceMatrix.
| supportsComplianceMatrix | - true to enable access, false to disable (Default: Disabled). |
| void agx::ConstraintImplementation::sort | ( | ) |
This method will sort this constraint by global indexing of the bodies.
It creates a permutation vector (i.e., it doesn't reorder the bodies nor the indices) so that one can index m_bodies and m_indices via the permutation.
|
virtual |
Callback with read/write access to the compliance matrix of this constraint in the direct solver.
The lower triangle is accessible and will be used, all entries must be less than or equal to zero. The diagonal has already been written with (negative) regularization parameters of each row of this constraint.
| matrix | - compliance matrix |
|
virtual |
Updated storing of Jacobian matrices.
Row based, each Jacobian6DOFElement is 1x6 separated into spatial and rotational part. The number of used rows should be: number_of_non_static_bodies * number_of_active_rows Start the indexing at 0.
Reimplemented in agx::HighLevelConstraintImplementation, and agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation.
|
virtual |
Updates the valid conditions for this constraint.
This constraint is not valid if for example; one or more bodies are removed (either from simulation or deallocated), one or more bodies are disabled or the number of dynamic bodies in this constraint is zero.
Reimplemented in agx::HighLevelConstraintImplementation, agxPowerLine::ActuatorConstraintImplementation, and agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation.
|
inlinevirtual |
Reimplemented in agx::HighLevelConstraintImplementation.
Definition at line 767 of file ConstraintImplementation.h.
|
inlinevirtual |
Reimplemented in agx::HighLevelConstraintImplementation.
Definition at line 762 of file ConstraintImplementation.h.
Consider using getLastForce instead.
This method returns the magnitude of the force in a given degree of freedom (DOF). Enabled controllers in the given DOF will NOT be included, agx::ElementaryConstraint::getCurrentForce has to be used for that.
| agx::RangeReal agx::ConstraintImplementation::userAPIgetForceRange | ( | agx::UInt | dof | ) | const |
Get the force range for DOF dof.
| dof | - index of the requested DOF |
| agx::RegularizationParameters * agx::ConstraintImplementation::userAPIgetRegularizationParameters | ( | agx::UInt | i | ) |
Get the regularization parameter i, i.e., the regularization parameter for equation i which is constraint dependent.
| i | - corresponds to the i'th constraint row of this constraint |
| const agx::RegularizationParameters * agx::ConstraintImplementation::userAPIgetRegularizationParameters | ( | agx::UInt | i | ) | const |
| void agx::ConstraintImplementation::userAPIsetCompliance | ( | agx::Real | compliance, |
| int | dof | ||
| ) |
Set the compliance for constraint row i of this constraint.
| compliance | - compliance |
| dof | - corresponds to the i'th constraint row of this constraint |
| void agx::ConstraintImplementation::userAPIsetDamping | ( | agx::Real | damping, |
| int | dof | ||
| ) |
Set the damping for constraint row i of this constraint.
| damping | - damping |
| dof | - corresponds to the i'th constraint row of this constraint |
| void agx::ConstraintImplementation::userAPIsetForceRange | ( | agx::RangeReal | forceRange, |
| agx::Int | dof | ||
| ) |
Assign force range, of an elementary constraint, for a given DOF.
| forceRange | - value of force range for the given DOF |
| dof | - index of the DOF (-1 indicates all) |
| void* agx::ConstraintImplementation::customData |
Custom data for the solvers to store data into.
Definition at line 569 of file ConstraintImplementation.h.
|
protected |
Start block row for this constraint in the global matrix.
Definition at line 1019 of file ConstraintImplementation.h.
|
protected |
The block structure; number of block, rows, dynamic blocks etc.
Definition at line 1018 of file ConstraintImplementation.h.
|
protected |
Vector with observer pointers to bodies.
Definition at line 1014 of file ConstraintImplementation.h.
Referenced by agx::ConstraintImplementation::BodyView::getBodies(), agx::ConstraintImplementation::BodyView::getBodyAt(), and agx::ConstraintImplementation::BodyView::getNumBodies().
|
protected |
State of the included bodies, updated in updateValid.
Definition at line 1015 of file ConstraintImplementation.h.
|
protected |
Vector of elementary constraints.
Definition at line 1011 of file ConstraintImplementation.h.
|
protected |
User controlled enable flag, constraint ignored by solver if false.
Definition at line 1029 of file ConstraintImplementation.h.
|
protected |
When necessary, tweak the values sent to the solver to make violation depend linearly on force or torque.
Definition at line 1030 of file ConstraintImplementation.h.
|
protected |
Current local state, updated all the time, not serialized.
Definition at line 1031 of file ConstraintImplementation.h.
|
protected |
Number of rows used by this constraint.
Definition at line 1017 of file ConstraintImplementation.h.
|
protected |
Vector of secondary constraints.
Definition at line 1012 of file ConstraintImplementation.h.
Referenced by findSecondaryConstraintGivenType().
|
protected |
Only for supported solvers.
Default: DIRECT. agxData::Values: DIRECT, ITERATIVE or DIRECT_AND_ITERATIVE.
Definition at line 1028 of file ConstraintImplementation.h.
|
mutableprotected |
Vector with sub-constraints.
Definition at line 1016 of file ConstraintImplementation.h.
|
protected |
Tag for this constraint.
Default tag is either BINARY or MANY_BODY.
Definition at line 1020 of file ConstraintImplementation.h.