23 #include "mbsim/links/link.h" 24 #include <mbsim/functions/function.h> 26 #include <mbsim/utils/boost_parameters.h> 27 #include <mbsim/utils/openmbv_utils.h> 34 class GeneralizedForceLaw;
35 class GeneralizedImpactLaw;
38 namespace MBSimHydraulics {
40 BOOST_PARAMETER_NAME(size)
41 BOOST_PARAMETER_NAME(minimalPressure)
42 BOOST_PARAMETER_NAME(maximalPressure)
43 BOOST_PARAMETER_NAME(position)
45 class HydraulicEnvironment;
61 void calcSize()
override;
63 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVSphere, tag, (optional (size,(
double),1)(minimalPressure,(
double),0e5)(maximalPressure,(
double),10e5)(position,(
const fmatvec::Vec3&),fmatvec::Vec3()))) {
64 enableOpenMBV(size,minimalPressure,maximalPressure,position);
66 virtual void enableOpenMBV(
double size,
double pMin,
double pMax,
const fmatvec::Vec3 &WrON);
68 void addInFlow(
HLine * in);
69 void addOutFlow(
HLine * out);
71 void calcgdSize(
int j)
override {
gdSize=1; }
73 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
83 double evalQHyd() {
if(updQHyd) updateQHyd();
return QHyd; }
84 double getQHyd(
bool check=
true)
const { assert((not check) or (not updQHyd));
return QHyd; }
85 virtual void updateQHyd();
87 void updateh(
int j=0)
override;
89 void updategd()
override;
90 bool isActive()
const override {
return false; }
91 bool gActiveChanged()
override {
return false; }
95 void initializeUsingXML(xercesc::DOMElement *element)
override;
97 void resetUpToDate()
override { MBSim::Link::resetUpToDate(); updQHyd =
true; }
101 std::vector<connectedLinesStruct> connectedLines;
102 std::vector<connectedLinesStruct> connected0DOFLines;
103 std::vector<std::string> refInflowString;
104 std::vector<std::string> refOutflowString;
122 pFun->setParent(
this);
126 void updateGeneralizedForces()
override;
127 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
128 void initializeUsingXML(xercesc::DOMElement *element)
override;
129 bool isSingleValued()
const override {
return true;}
141 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
143 bool isSingleValued()
const override {
return true;}
153 void setVolume(
double V_) {V=V_; }
154 void setFracAir(
double fracAir_) {fracAir=fracAir_; }
155 void setp0(
double p0_) {p0=p0_; }
157 void calcxSize()
override {
xSize=1; }
159 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
160 void initializeUsingXML(xercesc::DOMElement *element)
override;
162 void updateGeneralizedForces()
override;
164 void updatexd()
override;
166 void plot()
override;
168 bool isSingleValued()
const override {
return true;}
184 bool isSetValued()
const override {
return true; }
185 bool isActive()
const override {
return true; }
187 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
189 void calclaSize(
int j)
override {
laSize=1; }
191 void calcrFactorSize(
int j)
override {
rFactorSize=1; }
193 void updateGeneralizedForces()
override;
195 void updategd()
override;
196 void updateW(
int j=0)
override;
198 void updaterFactors()
override;
199 void solveImpactsFixpointSingle()
override;
200 void solveConstraintsFixpointSingle()
override;
201 void solveImpactsGaussSeidel()
override;
202 void solveConstraintsGaussSeidel()
override;
203 void solveImpactsRootFinding()
override;
204 void solveConstraintsRootFinding()
override;
205 void jacobianImpacts()
override;
206 void jacobianConstraints()
override;
207 void checkImpactsForTermination()
override;
208 void checkConstraintsForTermination()
override;
209 const double& evalgdn();
210 const double& evalgdd();
224 void setCavitationPressure(
double pCav_) {pCav=pCav_; }
226 bool isSetValued()
const override {
return true; }
227 bool isSingleValued()
const override {
return true; }
228 bool isActive()
const override {
return active; }
230 void calcxSize()
override {
xSize=1; }
231 void calcgSize(
int j)
override {
gSize=1; }
233 void calclaSize(
int j)
override {
laSize=1; }
235 void calcrFactorSize(
int j)
override {
rFactorSize=1; }
236 void calcsvSize()
override {
svSize=1; }
238 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
239 void initializeUsingXML(xercesc::DOMElement *element)
override;
240 void plot()
override;
242 void checkActive(
int j)
override;
244 bool gActiveChanged()
override;
246 void updateGeneralizedForces()
override;
247 void updateg()
override;
248 void updateW(
int j=0)
override;
249 void updatexd()
override;
250 void updateStopVector()
override;
251 void checkRoot()
override;
253 void updaterFactors()
override;
254 void solveImpactsFixpointSingle()
override;
255 void solveConstraintsFixpointSingle()
override;
256 void solveImpactsGaussSeidel()
override;
257 void solveConstraintsGaussSeidel()
override;
258 void solveImpactsRootFinding()
override;
259 void solveConstraintsRootFinding()
override;
260 void jacobianImpacts()
override;
261 void jacobianConstraints()
override;
262 void checkImpactsForTermination()
override;
263 void checkConstraintsForTermination()
override;
264 const double& evalgdn();
265 const double& evalgdd();
270 bool active, active0;
282 void setpFunction(
MBSim::Function<
double(
double)> *pFunction_) { pFunction=pFunction_; }
284 void init(
InitStage stage,
const MBSim::InitConfigSet &config)
override;
286 void updateGeneralizedForces()
override;
287 void initializeUsingXML(xercesc::DOMElement *element)
override;
Definition: environment.h:95
void setName(const std::string &str)
Definition: environment.h:31