All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
checkvalve.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: markus.ms.schneider@gmail.com
18  */
19 
20 #ifndef _CHECKVALVE_H_
21 #define _CHECKVALVE_H_
22 
23 #include "mbsim/group.h"
24 #include <mbsim/functions/function.h>
25 
26 namespace MBSim {
27  class Frame;
28  class RigidBody;
29  class Contact;
30  class DirectionalSpringDamper;
31  class GeneralizedImpactLaw;
32  class GeneralizedForceLaw;
33 }
34 
35 namespace MBSimControl {
36  class GeneralizedCoordinateSensor;
37 }
38 
39 namespace MBSimHydraulics {
40 
41  class ClosableRigidLine;
42  class CheckvalveClosablePressureLoss;
43 
45  class Checkvalve : public MBSim::Group {
46  public:
47  Checkvalve(const std::string &name="");
48 
49  void setFrameOfReference(MBSim::Frame * ref);
50  void setLineLength(double lLine);
51  void setLineDiameter(double lDiameter);
52  void setLinePressureLoss(CheckvalveClosablePressureLoss * ccpl);
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::Function<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() {openMBVFrames=true; }
65  void enableOpenMBVArrows() {openMBVArrows=true; }
66  void enableOpenMBVBodies() {openMBVBodies=true; }
67 #endif
68 
69  ClosableRigidLine * getLine() {return line; }
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::DirectionalSpringDamper * getSpring() {return spring; }
75  MBSimControl::GeneralizedCoordinateSensor * getXOpen() {return xOpen; }
76 
77  void init(InitStage stage);
78 
79  void initializeUsingXML(xercesc::DOMElement * element);
80 
81  private:
82  ClosableRigidLine * line;
83  MBSim::RigidBody * ballSeat;
84  MBSim::RigidBody * ball;
85  MBSim::Contact * seatContact;
86  MBSim::Contact * maxContact;
89  unsigned int fromNodeAreaIndex, toNodeAreaIndex;
90  double hMax, mBall;
91  std::string refFrameString;
92 #ifdef HAVE_OPENMBVCPPINTERFACE
93  bool openMBVBodies, openMBVArrows, openMBVFrames;
94 #endif
95  };
96 
97 }
98 
99 #endif /* ----- #ifndef _CHECKVALVE_H_ ----- */
Definition: checkvalve.h:45
Definition: rigid_line.h:59

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML