AGX Dynamics  2.35.0.1
FlowDimension.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 #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 {
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 
67 
74 
81 
82 
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 
147 
150 
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:
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
#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
A FlowDimension represents the flow of fluid through a FlowUnit.
Definition: FlowDimension.h:54
const agxHydraulics::FlowConnector * getInputFlowConnector() const
agxHydraulics::FlowConnector * getOutputFlowConnector()
virtual bool store(agxStream::StorageStream &out) const override
Stores internal data into stream.
const agxHydraulics::FlowConnector * getFlowConnector(agxPowerLine::Side side) const
virtual std::string getTypeName() const override
agx::UInt8 getElementIndex() const
const agxPowerLine::detail::Translational1DofState * getFlowState() const
const agxHydraulics::FlowConnector * getOutputFlowConnector() const
FlowDimension(agxHydraulics::FlowUnit *unit, agx::RigidBody *body, agx::UInt8 slot)
virtual bool restore(agxStream::StorageStream &in) override
Restores internal data from stream.
agxHydraulics::FlowConnector * getInputFlowConnector()
virtual agx::Real getPowerIn() const override
Compute the combined power, i.e., pressure * flow rate, generated at all input connections.
static agxPowerLine::PhysicalDimension::Type getStaticType()
The ID of a physical dimension type is always a number between zero and the total number of types of ...
static std::string getStaticTypeName()
agxHydraulics::FlowConnector * getFlowConnector(agxPowerLine::Side side)
FlowDimension(agxHydraulics::FlowUnit *unit)
agxPowerLine::detail::Translational1DofState * getFlowState()
virtual agx::Real getOutputLoad() const override
Returns the sum of the constraint forces of all constraints owned by Connectors connected to the outp...
virtual agx::Real getPowerOut() const override
Compute the combined power, i.e., pressure * flow rate, generated at all output connections.
const FlowUnit * getFlowUnit() const
virtual agx::Real getInputLoad() const override
Returns the sum of the constraint forces of all constraints owned by Connectors connected to the inpu...
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:67
Constraint implementation for constraining a number of physical dimensions of the same type.
virtual bool store(agxStream::StorageStream &str) const
Stores internal data into stream.
virtual bool restore(agxStream::StorageStream &in)
Restores internal data from stream.
Templated one dimensional dimension state.
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:28
const agx::Real complianceScaling(1)
const agx::Real dampingScaling(1)
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
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.
double Real
Definition: Real.h:42
uint8_t UInt8
Definition: Integer.h:38