All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
rigid_line.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 _RIGID_LINE_H_
21 #define _RIGID_LINE_H_
22 
23 #include "mbsimHydraulics/hline.h"
24 
25 namespace MBSimControl {
26  class Signal;
27 }
28 
29 namespace MBSimHydraulics {
30 
31  class LinePressureLoss;
32 
34  class RigidLine : public RigidHLine {
35  public:
36  RigidLine(const std::string &name="") : RigidHLine(name), diameter(0), pL(NULL), ReynoldsFactor(0) {}
37  ~RigidLine();
38  virtual std::string getType() const { return "RigidLine"; }
39 
40  void setDiameter(double diameter_) {diameter=diameter_; }
41  double getDiameter() const {return diameter; }
42  void setLinePressureLoss(LinePressureLoss * pL_) {pL=pL_; }
43 
44  void init(InitStage stage);
45 
46  void plot(double t, double dt);
47 
48  void initializeUsingXML(xercesc::DOMElement *element);
49  private:
50  double diameter;
51  LinePressureLoss * pL;
52  double ReynoldsFactor;
53  };
54 
55 
57 
59  class ClosableRigidLine : public RigidLine {
60  public:
61  ClosableRigidLine(const std::string &name="") : RigidLine(name), cpL(NULL), cpLSignal(NULL), cpLMinValue(0), cpLBilateral(false), refSignalString("") {}
63  virtual std::string getType() const { return "ClosableRigidLine"; }
64 
65  void setClosablePressureLoss(ClosablePressureLoss * cpL_) {cpL=cpL_; }
66  ClosablePressureLoss * getClosablePressureLoss() const {return cpL; }
67  void setSignal(MBSimControl::Signal * s) {cpLSignal = s; }
68  MBSimControl::Signal * getSignal() const {return cpLSignal; }
69  void setMinimalValue(double v) {cpLMinValue=v; }
70  double getMinimalValue() const {return cpLMinValue; }
71  void setBilateral(bool b=true) {cpLBilateral=b; }
72  bool isClosed() const;
73  double getRegularizedValue() const;
74 
75  void init(InitStage stage);
76 
77  void initializeUsingXML(xercesc::DOMElement *element);
78  private:
80  MBSimControl::Signal * cpLSignal;
81  double cpLMinValue;
82  bool cpLBilateral;
83  std::string refSignalString;
84  };
85 
86 
88 
91  public:
92  UnidirectionalRigidLine(const std::string &name="") : RigidLine(name), upL(NULL), dpMin(0) {}
93  virtual std::string getType() const { return "UnidirectionalRigidLine"; }
94 
95  void setUnidirectionalPressureLoss(UnidirectionalPressureLoss * upL_) {upL=upL_; }
96  UnidirectionalPressureLoss * getUnidirectionalPressureLoss() const {return upL; }
97  void setMinimalPressureDrop(double v) {dpMin=v; }
98  double getMinimalPressureDrop() const {return dpMin; }
99 
100  void init(InitStage stage);
101 
102  void initializeUsingXML(xercesc::DOMElement *element);
103  private:
105  double dpMin;
106  };
107 
108 }
109 
110 #endif /* ----- #ifndef _RIGID_LINE_H_ ----- */
111 
Definition: rigid_line.h:34
Definition: pressure_loss.h:322
Definition: pressure_loss.h:50
Definition: hline.h:88
Definition: pressure_loss.h:168
Definition: rigid_line.h:59
Definition: rigid_line.h:90

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML