AGX Dynamics  2.37.3.2
FlowConnector.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 
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 
87  agx::Real getCompliance() const;
88 
93  void setDamping(agx::Real damping);
94 
98  agx::Real getDamping() const;
99 
101  void setVolumeExpansionPressureRatio(agx::Real ratio);
102 
104  agx::Real getVolumeExpansionPressureRatio() const;
105 
109  virtual agx::Real getPressure() const override;
110 
115  agx::Real getStoredFluid() const;
116 
117 
118 
119 
127  static void setDefaultCompliance(agx::Real compliance);
128 
132  static agx::Real getDefaultCompliance();
133 
141  static void setDefaultDamping(agx::Real damping);
142 
146  static agx::Real getDefaultDamping();
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
174 
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
A FlowConnector is a junction of a set of FlowUnits.
Definition: FlowConnector.h:39
AGXFMI_EXPORT InputVariable_Real * setCompliance(agx::Constraint *constraint)
Constraint implementation for constraining a number of physical dimensions of the same type...
Pure virtual class.
Definition: Unit.h:72
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
virtual bool connect(agxPowerLine::Unit *unit)
Connect a unit to this Connector.
#define AGXHYDRAULICS_EXPORT
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:27
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
AGXFMI_EXPORT InputVariable_Real * setDamping(agx::Constraint *constraint)
#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
The PressureConnector is an abstract base class for all Connectors that has a pressure.
double Real
Definition: Real.h:42
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97