AGX Dynamics  2.37.3.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 #ifndef AGXPOWERLINE_POWER_LINE_CONSTRAINTS_H
18 #define AGXPOWERLINE_POWER_LINE_CONSTRAINTS_H
19 
20 #include <agxModel/export.h>
21 #include <agxPowerLine/PowerLine.h>
22 
24 
25 #include <agx/RigidBody.h>
28 
29 namespace agxPowerLine
30 {
32 
39  {
40  public:
41 
46 
50  virtual size_t getJacobian( agx::Jacobian6DOFElement* /*G*/,
51  const RigidBodyPtrIntHashVector& /*bodyToIndexTable*/,
52  const agx::ConstraintRigidBodyContainer& /*bodies*/,
53  const PhysicalDimensionPtrIntTable& /*dimensions*/,
54  const agx::Real /*dt*/ ) = 0;
55 
56 
57  virtual void getJacobian(const agxPowerLine::PhysicalDimension* dimension, agx::Jacobian6DOFElement& G) const = 0;
58 
62  virtual agx::UInt getViolation( agx::Real* /*g*/, agx::UInt /*row*/ ) override;
63 
67  void setConnector(Connector* connector);
68  Connector* getConnector();
69  const Connector* getConnector() const;
70 
74  virtual bool isValid() const;
75 
79  virtual void store( agxStream::OutputArchive& out ) const override;
80 
84  virtual void restore( agxStream::InputArchive& in ) override;
85 
86 
88 
89 
90  protected:
95 
96  protected:
98 
100 
104  virtual agx::UInt getJacobian( agx::Jacobian6DOFElement* /*G*/,
105  agx::UInt /*numBlocks*/,
106  agx::UInt /*row*/,
107  agx::GWriteState::Enum /*writeState*/ ) override;
108  };
109 
110 
115  {
116  public:
121 
125  virtual size_t getJacobian(
127  const RigidBodyPtrIntHashVector& bodyToIndexTable,
128  const agx::ConstraintRigidBodyContainer& bodies,
129  const PhysicalDimensionPtrIntTable& dimensions,
130  const agx::Real dt ) override;
131 
132 
133  virtual void getJacobian(
134  const agxPowerLine::PhysicalDimension* dimension,
135  agx::Jacobian6DOFElement& G) const override;
136 
137  protected:
139 
141 
142  protected:
143 
144  };
145 
146 
151  {
152  public:
157 
159 
163  virtual bool updateValid() override;
164 
165  virtual void prepareDimensions();
166 
170  virtual size_t updateJacobian( agx::Jacobian6DOFElement* jacobians ) override;
171 
172  void setConnector(agxPowerLine::Connector* connector);
173 
177  virtual void preSystemCallback( agx::DynamicsSystem* system ) override;
178 
182  virtual void postSystemCallback( agx::DynamicsSystem* system ) override;
183 
187  ElementaryPhysicalDimensionConstraint* getElementaryConstraint() const;
189 
193  agx::Real getCompliance() const;
194 
198  void setCompliance( agx::Real compliance );
199 
203  agx::Real getCurrentForce() const;
204 
205 
209  void add(PhysicalDimension* dimension);
210 
211 
212  virtual void storeLightData(agxStream::StorageStream& str) const override;
213  virtual void restoreLightData(agxStream::StorageStream& str) override;
214 
216 
217  protected:
218 
220 
221  void initialize();
222 
223  protected:
227  PhysicalDimensionPtrIntTable m_dimensionToIndexTable;
229  };
230 
231 
232 
237  {
238  public:
241 
242  protected:
244  };
245 
247 
248 
249 
254  {
255  public:
258 
259  protected:
261  };
262 
263 
264 
269  {
270  public:
272 
276  virtual bool isValid() const override;
277  };
278 
280 
281 
286  {
287  public:
289  };
290 
291 
294  {
295  public:
298  protected:
300  };
301 
302 
303 
305  {
306  public:
309 
310  protected:
312  };
313 
314 
315 }
316 
317 #endif // AGXMODEL_POWER_LINE_CONSTRAINTS_H
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:400
Links two connections together.
Definition: Connector.h:53
AGXFMI_EXPORT InputVariable_Real * setCompliance(agx::Constraint *constraint)
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...
Constraint implementation for constraining a number of physical dimensions of the same type...
virtual agx::ElementaryConstraint * getElementaryConstraint(const agx::UInt index) const
Constraint implementation that constrains the velocity of the rotational dimensions of a number bodie...
Helper class to hold data that is general for elementary constraints.
Constraint implementation that constrains the velocity of the rotational dimensions of a number bodie...
agxPowerLine contains a collection of connected components that transport power across a system...
Definition: MotorUnit.h:23
Templated vector class.
Definition: Vector.h:52
agx::HashVector< PhysicalDimension *, int > PhysicalDimensionPtrIntTable
uint32_t UInt
Definition: Integer.h:34
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...
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
Elementary constraint for constraining an arbitrary number of ONE specific PhysicalDimension::Type.
The complete physical system with bodies, interactions, data layout, time stepper, and solver.
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
#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
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
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::ref_ptr< ElementaryGearConstraint > GearConstraintRef
#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
agx::ref_ptr< ElementaryHolonomicGearConstraint > HolonomicGearConstraintRef
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
agx::Vector< agx::observer_ptr< agx::RigidBody > > m_observedBodies