AGX Dynamics  2.37.3.2
FlowConstraint.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 #ifndef AGXHYDRAULICS_DETAIL_FLOW_CONSTRAINT_H
18 #define AGXHYDRAULICS_DETAIL_FLOW_CONSTRAINT_H
19 
21 #include <agxHydraulics/export.h>
22 
23 namespace agxHydraulics
24 {
26  namespace detail
27  {
47  {
48  public:
53  ElementaryFlowConstraint(bool holonomic);
54 
58  agx::Real getStoredFluid() const;
59 
67  void setStoredFluid(agx::Real storedFluid);
68 
69 
70 
71  // Methods called by the rest of the PowerLine/Hydraulics framework.
72  public:
73  virtual size_t getJacobian(
75  const agxPowerLine::RigidBodyPtrIntHashVector& bodyToIndexTable,
78  const agx::Real dt) override;
79 
80 
81  virtual void getJacobian(
82  const agxPowerLine::PhysicalDimension* dimension,
83  agx::Jacobian6DOFElement& G) const override;
84 
86 
87  virtual agx::UInt getViolation(agx::Real* g, agx::UInt row) override;
88 
89  void integrateStoredFluid(
90  const agx::Jacobian6DOFElement* G,
91  const agx::Real solution,
92  const agxPowerLine::RigidBodyPtrIntHashVector& bodyToIndexTable,
94  const agx::Real dt);
95 
96 
97 
98  virtual agx::Bool isImpacting() const override;
99  void setIsImpacting(bool impact);
100 
101  AGXSTREAM_DECLARE_SERIALIZABLE(agxHydraulics::detail::ElementaryFlowConstraint);
102 
103  protected:
104  ElementaryFlowConstraint();
105  virtual ~ElementaryFlowConstraint() {}
106 
107  private:
108  bool m_holonomic;
109  agx::Real m_storedFluid;
110  bool m_isImpacting;
111  };
112 
113  typedef agx::ref_ptr<ElementaryFlowConstraint> ElementaryFlowConstraintRef;
114 
115 
116 
121  {
122  public:
123  FlowConstraintImplementation(bool holonomic);
124 
129  explicit FlowConstraintImplementation(ElementaryFlowConstraint* elementaryConstraint);
130 
131  virtual void postSolveCallback(
132  const agx::Jacobian6DOFElement* jacobians, const agx::Real* solution, agx::Real dt) override;
133 
134  ElementaryFlowConstraint* getElementaryFlowConstraint();
135  const ElementaryFlowConstraint* getElementaryFlowConstraint() const;
136 
137  AGXSTREAM_DECLARE_SERIALIZABLE(agxHydraulics::detail::FlowConstraintImplementation);
138 
139  protected:
140  FlowConstraintImplementation();
141  virtual ~FlowConstraintImplementation() {}
142 
143  protected:
144  // Owned by the base class.
145  ElementaryFlowConstraint* m_flowConstraint;
146  };
147 
148  }
150 
151 }
152 
153 #endif
bool Bool
Definition: Integer.h:48
Constraint implementation for constraining a number of physical dimensions of the same type...
virtual size_t getJacobian(agx::Jacobian6DOFElement *G, const RigidBodyPtrIntHashVector &bodyToIndexTable, const agx::ConstraintRigidBodyContainer &bodies, const PhysicalDimensionPtrIntTable &dimensions, const agx::Real dt) override
Implementation of getJacobian for a multi body constraint for the power line, where all dimensions ha...
Templated vector class.
Definition: Vector.h:52
uint32_t UInt
Definition: Integer.h:34
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
#define AGXHYDRAULICS_EXPORT
Elementary constraint for constraining an arbitrary number of ONE specific PhysicalDimension::Type.
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:27
#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
double Real
Definition: Real.h:42