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...
|
| | GenericElementaryConstraint (UInt numRows) |
| | Construct given the number of rows in this elementary constraint.
|
| |
| | GenericElementaryConstraint (UInt numRows, Bool enable) |
| | Construct given the number of rows in this elementary constraint and default enable flag.
|
| |
| void | fetchData (const ConstraintRigidBodyContainer &bodies) |
| | Performing callbacks and collecting data in serial.
|
| |
| const AttachmentPair * | getAttachmentPair () const |
| |
| GenericConstraintData * | getConstraintData () const |
| |
| Bool | getEnableMultiTangentNlCallback () const |
| |
| ConstraintNlmcpCallback * | getNlCallback () const override |
| |
| virtual Bool | isActive () const override |
| | An elementary constraint is defined to be active if enabled.
|
| |
| virtual Bool | onPrepare () |
| | Callback when the elementary constraints in the constraint receives the prepare call.
|
| |
| virtual void | onWriteData (GenericConstraintData *constraintData) |
| | Callback when to write Jacobian and constraint data if this elementary constraint is active.
|
| |
| void | setAttachmentPair (const AttachmentPair *ap) override |
| | Call for elementary constraints dependent on attachment pairs.
|
| |
| void | setEnableMultiTangentNlCallback (Bool enable, Real primaryFrictionCoefficient, Real secondaryFrictionCoefficient, const Vec3 &contactPointPosition, const Vec2 &tangentialCohesion=agx::Vec2()) |
| |
| | 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.
|
| |
| virtual agx::UInt | getBounds (agx::RangeReal *bounds, agx::UInt row, agx::Real h) const |
| | Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)).
|
| |
| 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.
|
| |
| 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 |
| |
| virtual agx::UInt | getJacobian (agx::Jacobian6DOFElement *G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState) |
| | Returns the Jacobian of this elementary constraint.
|
| |
| 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).
|
| |
| virtual agx::UInt | getViolation (agx::Real *g, agx::UInt row) |
| | Returns the violation of this elementary constraint.
|
| |
| virtual agx::Bool | isActive () const |
| | An elementary constraint is defined to be active if enabled.
|
| |
| 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.
|
| |
| virtual agx::UInt | postSolveCallback (const agx::Real *solution, agx::UInt row, agx::Real h) |
| | Callback after solve, with the solution.
|
| |
| virtual void | prepare () |
| | Prepare call.
|
| |
| void | reset () |
| | Reset call.
|
| |
| virtual void | restore (agxStream::InputArchive &in) override |
| | Restore this object from stream.
|
| |
| virtual void | restoreLightData (agxStream::StorageStream &str) override |
| | Restore structural independent data from stream.
|
| |
| virtual void | setAttachmentPair (const agx::AttachmentPair *ap) |
| | Call for elementary constraints dependent on attachment pairs.
|
| |
| void | setCompliance (agx::Real compliance) |
| |
| void | setCompliance (agx::Real compliance, int row) |
| | Assign compliance for a given row, or all rows if row = -1 (default).
|
| |
| void | setDamping (agx::Real damping) |
| |
| void | setDamping (agx::Real damping, int row) |
| | Assign damping for a given row, or all rows if row = -1 (default).
|
| |
| void | setElasticity (agx::Real elasticity) |
| |
| void | setElasticity (agx::Real elasticity, int row) |
| | Assign elasticity for a given row, or all rows if row = -1 (default).
|
| |
| virtual void | setEnable (agx::Bool enable) |
| | Enable/disable this elementary constraint.
|
| |
| void | setForceRange (agx::RangeReal forceRange, const agx::UInt row=0) |
| | Assign force range to a given row.
|
| |
| void | setForceRange (agx::Real lower, agx::Real upper, const agx::UInt row=0) |
| | Assign force range to a given row.
|
| |
| void | setName (const agx::ElementaryConstraint::NameType &name) |
| | Name this elementary constraint.
|
| |
| virtual void | store (agxStream::OutputArchive &out) const override |
| | Store this object to stream.
|
| |
| virtual void | storeLightData (agxStream::StorageStream &str) const override |
| | Store structural independent data to stream.
|
| |
| | 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.
|
| |
| 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.
|
| |
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, constraintData: agx.GenericConstraintData): a1: agx.Attachment = self.getAttachmentPair().getAttachment1() a2: agx.Attachment = self.getAttachmentPair().getAttachment2() v1: agx.Vec3 = a1.get(self.dir1) v2: agx.Vec3 = a2.get(self.dir2)
rb1_data: agx.GenericConstraintBodyData = constraintData.getBodyDataAt(index=0) rb2_data: agx.GenericConstraintBodyData = constraintData.getBodyDataAt(index=1)
Similar/identical if one has access to the rigid body instances:
rb1_data: agx.GenericConstraintBodyData = constraintData.getBodyData(rb=rb1)
rb2_data: agx.GenericConstraintBodyData = constraintData.getBodyData(rb=rb2)
rb1_data.setJacobian(0, agx.Vec3(), v1.cross(v2)) rb2_data.setJacobian(0, agx.Vec3(), v2.cross(v1))
constraintData.setViolation(0, v1 * v2)
my_hinge.addElementaryConstraint("D1_VN", MyDot1(agx.Attachment.V, agx.Attachment.N)) my_hinge.addElementaryConstraint("D1_UN", MyDot1(agx.Attachment.U, agx.Attachment.N))
Definition at line 58 of file GenericElementaryConstraint.h.