AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
PowerLineConstraints.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxModel/export.h>
21
23
24#include <agx/RigidBody.h>
27
28namespace agxPowerLine
29{
31
38 {
39 public:
40
45
49 virtual size_t getJacobian( agx::Jacobian6DOFElement* /*G*/,
50 const RigidBodyPtrIntHashVector& /*bodyToIndexTable*/,
51 const agx::ConstraintRigidBodyContainer& /*bodies*/,
52 const PhysicalDimensionPtrIntTable& /*dimensions*/,
53 const agx::Real /*dt*/ ) = 0;
54
55
56 virtual void getJacobian(const agxPowerLine::PhysicalDimension* dimension, agx::Jacobian6DOFElement& G) const = 0;
57
61 virtual agx::UInt getViolation( agx::Real* /*g*/, agx::UInt /*row*/ ) override;
62
66 void setConnector(Connector* connector);
68 const Connector* getConnector() const;
69
73 virtual bool isValid() const;
74
78 virtual void store( agxStream::OutputArchive& out ) const override;
79
83 virtual void restore( agxStream::InputArchive& in ) override;
84
85
87
88
89 protected:
94
95 protected:
97
98 using agx::ElementaryConstraintN<1>::getJacobian;
99
104 agx::UInt /*numBlocks*/,
105 agx::UInt /*row*/,
106 agx::GWriteState::Enum /*writeState*/ ) override;
107 };
108
109
114 {
115 public:
120
124 virtual size_t getJacobian(
126 const RigidBodyPtrIntHashVector& bodyToIndexTable,
128 const PhysicalDimensionPtrIntTable& dimensions,
129 const agx::Real dt ) override;
130
131
132 virtual void getJacobian(
133 const agxPowerLine::PhysicalDimension* dimension,
134 agx::Jacobian6DOFElement& G) const override;
135
136 protected:
138
140
141 protected:
142
143 };
144
145
150 {
151 public:
156
158
162 virtual bool updateValid() override;
163
164 virtual void prepareDimensions();
165
169 virtual size_t updateJacobian( agx::Jacobian6DOFElement* jacobians ) override;
170
172
176 virtual void preSystemCallback( agx::DynamicsSystem* system ) override;
177
181 virtual void postSystemCallback( agx::DynamicsSystem* system ) override;
182
188
193
197 void setCompliance( agx::Real compliance );
198
203
204
208 void add(PhysicalDimension* dimension);
209
210
211 virtual void storeLightData(agxStream::StorageStream& str) const override;
212 virtual void restoreLightData(agxStream::StorageStream& str) override;
213
215
216 protected:
217
219
221
222 protected:
228 };
229
230
231
236 {
237 public:
240
241 protected:
243 };
244
246
247
248
253 {
254 public:
257
258 protected:
260 };
261
262
263
268 {
269 public:
271
275 virtual bool isValid() const override;
276 };
277
279
280
285 {
286 public:
288 };
289
290
293 {
294 public:
297 protected:
299 };
300
301
302
304 {
305 public:
308
309 protected:
311 };
312
313
314}
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXMODEL_EXPORT
Links two connections together.
Definition: Connector.h:53
An elementary gear constraint constrains the velocity of the rotational dimensions of a number bodies...
An elementary gear constraint constrains the velocity of the rotational dimensions of a number bodies...
virtual bool isValid() const override
Check if the dimensions of the constraint are legit.
virtual bool isValid() const
Check if the dimensions of the constraint are legit.
ElementaryPhysicalDimensionConstraint()
Constructor for pure virtual function.
virtual size_t getJacobian(agx::Jacobian6DOFElement *, const RigidBodyPtrIntHashVector &, const agx::ConstraintRigidBodyContainer &, const PhysicalDimensionPtrIntTable &, const agx::Real)=0
getJacobian must be implemented for all classes that inherits from this.
virtual void getJacobian(const agxPowerLine::PhysicalDimension *dimension, agx::Jacobian6DOFElement &G) const =0
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxPowerLine::ElementaryPhysicalDimensionConstraint)
virtual agx::UInt getViolation(agx::Real *, agx::UInt) override
virtual agx::UInt getJacobian(agx::Jacobian6DOFElement *, agx::UInt, agx::UInt, agx::GWriteState::Enum) override
Forced inheritance from agx::ElementaryConstraint.
virtual void store(agxStream::OutputArchive &out) const override
Store this object to stream.
virtual void restore(agxStream::InputArchive &in) override
Restore this object from stream.
void setConnector(Connector *connector)
Set a pointer to the connector that will define this constraint.
Elementary constraint for constraining an arbitrary number of ONE specific PhysicalDimension::Type.
virtual void getJacobian(const agxPowerLine::PhysicalDimension *dimension, agx::Jacobian6DOFElement &G) const override
virtual size_t getJacobian(agx::Jacobian6DOFElement *G, const RigidBodyPtrIntHashVector &bodyToIndexTable, const agx::ConstraintRigidBodyContainer &bodies, const PhysicalDimensionPtrIntTable &dimensions, const agx::Real dt) override
Implementation of getJacobian for a multi body constraint for the power line, where all dimensions ha...
Constraint implementation that constrains the velocity of the rotational dimensions of a number bodie...
Constraint implementation that constrains the velocity of the rotational dimensions of a number bodie...
Constraint implementation for constraining a number of physical dimensions of the same type.
virtual void preSystemCallback(agx::DynamicsSystem *system) override
Prepare system before solve.
void setCompliance(agx::Real compliance)
Set the compliance of the constraint.
virtual size_t updateJacobian(agx::Jacobian6DOFElement *jacobians) override
Update the jacobians of the included dimensions.
virtual void postSystemCallback(agx::DynamicsSystem *system) override
Prepare system after solve.
PhysicalDimensionMultiBodyConstraintImplementation(ElementaryPhysicalDimensionConstraint *elementaryConstraint)
virtual bool updateValid() override
Test if the constraint is still valid.
virtual void restoreLightData(agxStream::StorageStream &str) override
virtual void storeLightData(agxStream::StorageStream &str) const override
void add(PhysicalDimension *dimension)
Add a physical dimension to the constraint.
void setConnector(agxPowerLine::Connector *connector)
ElementaryPhysicalDimensionConstraint * getElementaryConstraint() const
agx::Vector< agx::observer_ptr< agx::RigidBody > > m_observedBodies
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
virtual agx::ElementaryConstraint * getElementaryConstraint(const agx::UInt index) const
The complete physical system with bodies, interactions, data layout, time stepper,...
Helper class to hold data that is general for elementary constraints.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: HashVector.h:41
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
agx::ref_ptr< ElementaryGearConstraint > GearConstraintRef
agx::HashVector< PhysicalDimension *, int > PhysicalDimensionPtrIntTable
agx::ref_ptr< ElementaryHolonomicGearConstraint > HolonomicGearConstraintRef
uint64_t UInt
Definition: Integer.h:27
double Real
Definition: Real.h:41