AGX Dynamics  2.35.0.1
FlowConnector.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
18 
19 #ifndef AGXHYDRAULICS_FLOW_CONNECTOR_H
20 #define AGXHYDRAULICS_FLOW_CONNECTOR_H
21 
22 #include <agxHydraulics/export.h>
25 
26 
27 namespace agxHydraulics
28 {
31 
40  {
41  public:
49  FlowConnector(bool holonomic = true);
50 
57  virtual bool connect(
58  agxPowerLine::Side mySide,
59  agxPowerLine::Side unitSide,
60  agxPowerLine::Unit* unit) override;
61 
63 
81  void setCompliance(agx::Real volumePerPressure);
82 
88 
93  void setDamping(agx::Real damping);
94 
99 
102 
105 
109  virtual agx::Real getPressure() const override;
110 
116 
117 
118 
119 
127  static void setDefaultCompliance(agx::Real compliance);
128 
133 
141  static void setDefaultDamping(agx::Real damping);
142 
147 
148 
149  // Methods called by the rest of the PowerLine/Hydraulics frame work.
150  public:
151 
153  void setStoredFluid(agx::Real storedFluid);
154 
155 
159  virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
160 
161 
165  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(
166  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
167 
171  void setIsImpacting(bool impact);
172 
173 #ifndef SWIG
178  virtual bool postStore(agxStream::StorageStream& str) const override;
179 
184  virtual bool postRestore(agxStream::StorageStream& str) override;
185 
186 
190  virtual bool store(agxStream::StorageStream& str) const override;
191 
196  virtual bool restore(agxStream::StorageStream& str) override;
197 
198 
200 #endif
202 
203  protected:
204 
205 // Swig tries to generate bindings to this protected connect member function
206 // which leads to compiler errors since the function is protected.
207 #ifndef SWIG
208  virtual bool connect(
209  agxPowerLine::Unit* inputUnit, agxPowerLine::Side inputUnitSide,
210  agxPowerLine::Side outputUnitSide, agxPowerLine::Unit* outputUnit) override;
211 #endif
212 
213  virtual ~FlowConnector() {}
214 
215  private:
216  agx::Real m_volumeExpansionPressureRatio;
217  agx::Real m_damping;
218  bool m_holonomic;
219 
220  static agx::Real s_defaultCompliance;
221  static agx::Real s_defaultDamping;
222  };
223 
224 
225 }
226 
227 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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 AGXHYDRAULICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
A FlowConnector is a junction of a set of FlowUnits.
Definition: FlowConnector.h:40
static void setDefaultDamping(agx::Real damping)
Set the default damping for new flow connectors.
void setDamping(agx::Real damping)
Set the damping of the flow constraint.
virtual agx::Real getPressure() const override
agx::Real getStoredFluid() const
Only valid for holonomic FlowConnectors.
static agx::Real getDefaultCompliance()
void setCompliance(agx::Real volumePerPressure)
Set the compliance of the flow constraint.
FlowConnector(bool holonomic=true)
A flow connector can either be holonomic or nonholonomic.
static agx::Real getDefaultDamping()
agx::Real getVolumeExpansionPressureRatio() const
Alias for getCompliance().
virtual bool connect(agxPowerLine::Unit *inputUnit, agxPowerLine::Side inputUnitSide, agxPowerLine::Side outputUnitSide, agxPowerLine::Unit *outputUnit) override
virtual bool connect(agxPowerLine::Side mySide, agxPowerLine::Side unitSide, agxPowerLine::Unit *unit) override
Connect the given unit to this FlowConnector.
static void setDefaultCompliance(agx::Real compliance)
Set the default compliance for new flow connectors.
agx::Real getCompliance() const
void setVolumeExpansionPressureRatio(agx::Real ratio)
Alias for setCompliance(agx::Real).
agx::Real getDamping() const
The PressureConnector is an abstract base class for all Connectors that has a pressure.
virtual bool connect(agxPowerLine::Unit *unit)
Connect a unit to this Connector.
Pure virtual class.
Definition: Unit.h:73
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:28
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:42