AGX Dynamics  2.37.3.2
ReliefValveConstraints.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_RELIEF_VALVE_CONSTRAINTS_H
19 #define AGXHYDRAULICS_RELIEF_VALVE_CONSTRAINTS_H
20 
21 
24 #include <agxHydraulics/export.h>
25 
26 
27 
28 namespace agxHydraulics
29 {
30  class FlowDimension;
31 
33  namespace detail
34  {
35  AGX_DECLARE_POINTER_TYPES(ElementaryLimitedFlowBlockConstraint);
36 
48  class AGXHYDRAULICS_EXPORT ElementaryLimitedFlowBlockConstraint : public agx::ElementaryConstraintN<1>
49  {
50  public:
55  ElementaryLimitedFlowBlockConstraint(agx::Real crackingPressure, agx::UInt8 elementIndex);
56 
57  void setCrackingPressure(agx::Real crackingPressure);
58  agx::Real getCrackingPressure() const;
59 
60  virtual agx::UInt getJacobian(
62  agx::UInt numBlocks,
63  agx::UInt row,
64  agx::GWriteState::Enum writeState ) override;
65 
66  virtual agx::UInt getViolation(agx::Real* g, agx::UInt row) override;
67 
68  void setElementIndex(agx::UInt8 elementIndex);
69 
70  AGXSTREAM_DECLARE_SERIALIZABLE(agxHydraulics::detail::ElementaryLimitedFlowBlockConstraint);
71 
72  protected:
73  ElementaryLimitedFlowBlockConstraint();
74  virtual ~ElementaryLimitedFlowBlockConstraint() {}
75 
76  private:
77  agx::UInt8 m_elementIndex;
78  };
79 
80 
84  class AGXHYDRAULICS_EXPORT LimitedFlowBlockConstraintImplementation : public agx::ConstraintImplementation, public agxStream::Serializable
85  {
86  public:
91  LimitedFlowBlockConstraintImplementation(agx::Real crackingPressure, agxHydraulics::FlowDimension* flowDimension);
92 
93  void setCrackingPressure(agx::Real crackingPressure);
94  agx::Real getCrackingPressure() const;
95 
96  void setFlowDimension(agxHydraulics::FlowDimension* flowDim);
97 
98  virtual void prepare() override;
99 
100  virtual void storeLightData(agxStream::StorageStream& str) const override;
101  virtual void restoreLightData(agxStream::StorageStream& str) override;
102 
103  AGXSTREAM_DECLARE_SERIALIZABLE(agxHydraulics::detail::LimitedFlowBlockConstraintImplementation);
104 
105  protected:
106  LimitedFlowBlockConstraintImplementation();
107 
108  protected:
109  ElementaryLimitedFlowBlockConstraintRef m_flowBlockConstraint;
110  agxHydraulics::FlowDimension* m_flowDimension;
111  };
112 
113 
114  AGX_DECLARE_POINTER_TYPES(LimitedFlowBlockConstraint);
115  AGX_DECLARE_VECTOR_TYPES(LimitedFlowBlockConstraint);
116 
117 
123  class AGXHYDRAULICS_EXPORT LimitedFlowBlockConstraint : public agx::Constraint
124  {
125  public:
130  LimitedFlowBlockConstraint(agx::Real crackingPressure, agxHydraulics::FlowDimension* flowDimension);
131 
135  void setCrackingPressure(agx::Real crackingPressure);
136  agx::Real getCrackingPressure() const;
137 
138  void setFlowDimension(agxHydraulics::FlowDimension* flowDim);
139 
140  virtual void render(agxRender::RenderManager* /*canvas*/, float /*scale*/) const override {}
141 
142  AGXSTREAM_DECLARE_SERIALIZABLE(agxHydraulics::detail::LimitedFlowBlockConstraint);
143 
144  protected:
145  LimitedFlowBlockConstraint();
146  virtual ~LimitedFlowBlockConstraint();
147  virtual int getNumDOF() const override;
148 
149  private:
150  LimitedFlowBlockConstraintImplementation* m_flowBlockConstraint;
151  };
152  }
154 }
155 
156 #endif
A FlowDimension represents the flow of fluid through a FlowUnit.
Definition: FlowDimension.h:53
uint8_t UInt8
Definition: Integer.h:38
Helper class to hold data that is general for elementary constraints.
The base class for a constraint.
Definition: Constraint.h:88
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
uint32_t UInt
Definition: Integer.h:34
#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
#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
double Real
Definition: Real.h:42
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34