20 #ifndef _CHECKVALVE_H_
21 #define _CHECKVALVE_H_
23 #include "mbsim/group.h"
24 #include "mbsim/utils/function.h"
31 class GeneralizedImpactLaw;
32 class GeneralizedForceLaw;
35 namespace MBSimControl {
36 class GeneralizedCoordinateSensor;
39 namespace MBSimHydraulics {
41 class ClosableRigidLine;
42 class CheckvalveClosablePressureLoss;
49 void setFrameOfReference(MBSim::Frame * ref);
50 void setLineLength(
double lLine);
51 void setLineDiameter(
double lDiameter);
53 void setLineMinimalXOpen(
double xMin);
54 void setLineSetValued(
bool setValued=
true);
55 void setBallMass(
double mBall_);
56 void setBallInitialPosition(
double x0Ball_);
57 void setSpringForceFunction(MBSim::Function2<double,double,double> *func);
58 void setSeatContactImpactLaw(MBSim::GeneralizedImpactLaw * seatGIL_);
59 void setSeatContactForceLaw(MBSim::GeneralizedForceLaw * seatGFL_);
60 void setMaximalOpening(
double hMax_) {hMax=hMax_; }
61 void setMaximalContactImpactLaw(MBSim::GeneralizedImpactLaw * seatGIL_);
62 void setMaximalContactForceLaw(MBSim::GeneralizedForceLaw * seatGFL_);
63 #ifdef HAVE_OPENMBVCPPINTERFACE
64 void enableOpenMBVFrames(
bool openMBVFrames_=
true) {openMBVFrames=openMBVFrames_; }
65 void enableOpenMBVArrows(
bool openMBVArrows_=
true) {openMBVArrows=openMBVArrows_; }
66 void enableOpenMBVBodies(
bool openMBVBodies_=
true) {openMBVBodies=openMBVBodies_; }
70 MBSim::RigidBody * getBallSeat() {
return ballSeat; }
71 MBSim::RigidBody * getBall() {
return ball; }
72 MBSim::Contact * getSeatContact() {
return seatContact; }
73 MBSim::Contact * getMaximalContact() {
return maxContact; }
74 MBSim::SpringDamper * getSpring() {
return spring; }
75 MBSimControl::GeneralizedCoordinateSensor * getXOpen() {
return xOpen; }
77 void init(MBSim::InitStage stage);
79 void initializeUsingXML(TiXmlElement * element);
83 MBSim::RigidBody * ballSeat;
84 MBSim::RigidBody * ball;
85 MBSim::Contact * seatContact;
86 MBSim::Contact * maxContact;
87 MBSim::SpringDamper * spring;
88 MBSimControl::GeneralizedCoordinateSensor * xOpen;
89 unsigned int fromNodeAreaIndex, toNodeAreaIndex;
91 std::string refFrameString;
92 #ifdef HAVE_OPENMBVCPPINTERFACE
93 bool openMBVBodies, openMBVArrows, openMBVFrames;