AGX Dynamics  2.38.0.2
PowerLineConstraints.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agxModel/export.h>
20 #include <agxPowerLine/PowerLine.h>
21 
23 
24 #include <agx/RigidBody.h>
27 
28 namespace 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);
67  Connector* getConnector();
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 
99 
103  virtual agx::UInt getJacobian( agx::Jacobian6DOFElement* /*G*/,
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,
127  const agx::ConstraintRigidBodyContainer& bodies,
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 
171  void setConnector(agxPowerLine::Connector* connector);
172 
176  virtual void preSystemCallback( agx::DynamicsSystem* system ) override;
177 
181  virtual void postSystemCallback( agx::DynamicsSystem* system ) override;
182 
186  ElementaryPhysicalDimensionConstraint* getElementaryConstraint() const;
188 
192  agx::Real getCompliance() const;
193 
197  void setCompliance( agx::Real compliance );
198 
202  agx::Real getCurrentForce() const;
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 
220  void initialize();
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 }
agxPowerLine::TranslationalConstraintImplementation::~TranslationalConstraintImplementation
virtual ~TranslationalConstraintImplementation()
Definition: PowerLineConstraints.h:310
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxPowerLine::ElementaryPhysicalDimensionConstraint
Pure virtual function.
Definition: PowerLineConstraints.h:37
agx::ConstraintImplementation::getElementaryConstraint
virtual agx::ElementaryConstraint * getElementaryConstraint(const agx::UInt index) const
PowerLine.h
agx::Real
double Real
Definition: Real.h:42
agxPowerLine::GearConstraintImplementation
Constraint implementation that constrains the velocity of the rotational dimensions of a number bodie...
Definition: PowerLineConstraints.h:252
agx::Jacobian6DOFElementT
Definition: Jacobian.h:104
agxPowerLine::ElementaryPhysicalDimensionMultiBodyConstraint
Elementary constraint for constraining an arbitrary number of ONE specific PhysicalDimension::Type.
Definition: PowerLineConstraints.h:113
agx::Vector< RigidBody * >
agxStream::out
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
Definition: OutputArchive.h:412
agxPowerLine::ElementaryTranslationalConstraint
Definition: PowerLineConstraints.h:291
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
export.h
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation
Constraint implementation for constraining a number of physical dimensions of the same type.
Definition: PowerLineConstraints.h:149
agxFMI2::Export::Constraint::setCompliance
AGXFMI_EXPORT InputVariable_Real * setCompliance(agx::Constraint *constraint)
agx::ConstraintImplementation
Definition: ConstraintImplementation.h:100
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation::m_elementaryConstraint
ElementaryPhysicalDimensionConstraint * m_elementaryConstraint
Definition: PowerLineConstraints.h:223
ConstraintImplementation.h
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation::m_observedBodies
agx::Vector< agx::observer_ptr< agx::RigidBody > > m_observedBodies
Definition: PowerLineConstraints.h:225
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
StepEventListener.h
agxPowerLine::TranslationalConstraintImplementation
Definition: PowerLineConstraints.h:303
agxPowerLine::HolonomicGearConstraintImplementation
Constraint implementation that constrains the velocity of the rotational dimensions of a number bodie...
Definition: PowerLineConstraints.h:284
agxPowerLine::PhysicalDimension
Pure virtual class.
Definition: PhysicalDimension.h:92
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation::m_dimensionToIndexTable
PhysicalDimensionPtrIntTable m_dimensionToIndexTable
Definition: PowerLineConstraints.h:226
agxStream::in
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:399
agxPowerLine::PhysicalDimensionPtrIntTable
agx::HashVector< PhysicalDimension *, int > PhysicalDimensionPtrIntTable
Definition: PowerLineConstraints.h:30
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation::m_indexCounter
size_t m_indexCounter
Definition: PowerLineConstraints.h:227
agxPowerLine::ElementaryTranslationalConstraint::~ElementaryTranslationalConstraint
virtual ~ElementaryTranslationalConstraint()
Definition: PowerLineConstraints.h:298
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:50
agxPowerLine::GearConstraintRef
agx::ref_ptr< ElementaryGearConstraint > GearConstraintRef
Definition: PowerLineConstraints.h:245
RigidBody.h
agx::ElementaryConstraintN
Helper class to hold data that is general for elementary constraints.
Definition: ElementaryConstraint.h:368
agxPowerLine
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:23
ElementaryConstraint.h
agxPowerLine::Connector
Links two connections together.
Definition: Connector.h:52
agxPowerLine::ElementaryGearConstraint
An elementary gear constraint constrains the velocity of the rotational dimensions of a number bodies...
Definition: PowerLineConstraints.h:235
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxPowerLine::GearConstraintImplementation::~GearConstraintImplementation
virtual ~GearConstraintImplementation()
Definition: PowerLineConstraints.h:259
agxPowerLine::ElementaryHolonomicGearConstraint
An elementary gear constraint constrains the velocity of the rotational dimensions of a number bodies...
Definition: PowerLineConstraints.h:267
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation::m_bodyToIndexTable
RigidBodyPtrIntHashVector m_bodyToIndexTable
Definition: PowerLineConstraints.h:224
agxPowerLine::ElementaryPhysicalDimensionConstraint::getJacobian
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.
agx::DynamicsSystem
The complete physical system with bodies, interactions, data layout, time stepper,...
Definition: DynamicsSystem.h:63
agxPowerLine::ElementaryGearConstraint::~ElementaryGearConstraint
virtual ~ElementaryGearConstraint()
Definition: PowerLineConstraints.h:242
agxPowerLine::ElementaryPhysicalDimensionConstraint::m_connector
Connector * m_connector
Definition: PowerLineConstraints.h:96
agx::HashVector< PhysicalDimension *, int >
agxPowerLine::HolonomicGearConstraintRef
agx::ref_ptr< ElementaryHolonomicGearConstraint > HolonomicGearConstraintRef
Definition: PowerLineConstraints.h:278