AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
FlowConstraint.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXHYDRAULICS_DETAIL_FLOW_CONSTRAINT_H
18#define AGXHYDRAULICS_DETAIL_FLOW_CONSTRAINT_H
19
22
23namespace 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(
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
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXHYDRAULICS_EXPORT
Elementary constraint for constraining an arbitrary number of ONE specific PhysicalDimension::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...
Constraint implementation for constraining a number of physical dimensions of the same type.
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition Accumulator.h:28
bool Bool
Definition Integer.h:40
uint64_t UInt
Definition Integer.h:27
double Real
Definition Real.h:42