AGX Dynamics  2.37.2.0
FlowDimension.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 #ifndef AGXHYDRAULICS_FLOW_DIMENSION_H
19 #define AGXHYDRAULICS_FLOW_DIMENSION_H
20 
21 #include <agxHydraulics/export.h>
22 
25 
26 
27 #ifndef SWIG
28 namespace agxHydraulics
29 {
31  const agx::Real dampingScaling(1);
32 }
33 #endif
34 
35 
36 namespace agxHydraulics
37 {
38  class FlowUnit;
39  class FlowConnector;
40 }
41 
42 
43 
44 namespace agxHydraulics
45 {
48 
49 
54  {
55  public:
57 
59 
60 
65  agxHydraulics::FlowConnector* getFlowConnector(agxPowerLine::Side side);
66  const agxHydraulics::FlowConnector* getFlowConnector(agxPowerLine::Side side) const;
67 
72  agxHydraulics::FlowConnector* getInputFlowConnector();
73  const agxHydraulics::FlowConnector* getInputFlowConnector() const;
74 
79  agxHydraulics::FlowConnector* getOutputFlowConnector();
80  const agxHydraulics::FlowConnector* getOutputFlowConnector() const;
81 
82 
86  FlowUnit* getFlowUnit();
87  const FlowUnit* getFlowUnit() const;
88 
89 
96  virtual agx::Real getOutputLoad() const override;
97 
104  virtual agx::Real getInputLoad() const override;
105 
112  virtual agx::Real getPowerOut() const override;
113 
120  virtual agx::Real getPowerIn() const override;
121 
122 
123 
124 
125 
126 
127  // Methods called by the rest of the PowerLine/Hydraulics framework.
128  public:
132  static std::string getStaticTypeName();
133 
137  virtual std::string getTypeName() const override;
138 
146  static agxPowerLine::PhysicalDimension::Type getStaticType();
147 
149  const agxPowerLine::detail::Translational1DofState* getFlowState() const;
150 
151  agx::UInt8 getElementIndex() const;
152 
153 
155 
156 #ifndef SWIG
157 
161  virtual bool store(agxStream::StorageStream& out) const override;
162 
164 
168  virtual bool restore(agxStream::StorageStream& in) override;
169 
171 #endif
172 
173 
174  protected:
175  FlowDimension();
176  virtual ~FlowDimension() {}
177 
178  private:
180  typedef const agxPowerLine::Connection* (agxHydraulics::FlowDimension::*GetConnection)(size_t) const;
181  agx::Real sumPower(
182  const agxPowerLine::ConnectionRefVector& connections,
183  GetConstraint getConstraintFunction,
184  GetConnection getConnectionFunction) const;
185 
186  private:
188  };
189 }
190 #endif
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
A FlowConnector is a junction of a set of FlowUnits.
Definition: FlowConnector.h:39
virtual bool restore(agxStream::StorageStream &in)
Restores internal data from stream.
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...
A FlowDimension represents the flow of fluid through a FlowUnit.
Definition: FlowDimension.h:53
uint8_t UInt8
Definition: Integer.h:38
const agx::Real dampingScaling(1)
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Templated one dimensional dimension state.
#define AGXHYDRAULICS_EXPORT
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
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
#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
virtual bool store(agxStream::StorageStream &str) const
Stores internal data into stream.
double Real
Definition: Real.h:42
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
const agx::Real complianceScaling(1)
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:66