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 MBSimHydraulics {
26 
27  class LinePressureLoss;
28 
30  class RigidLine : public RigidHLine {
31  public:
32  RigidLine(const std::string &name="") : RigidHLine(name), diameter(0), pL(NULL), ReynoldsFactor(0) {}
33  ~RigidLine();
34  virtual std::string getType() const { return "RigidLine"; }
35 
36  void setDiameter(double diameter_) {diameter=diameter_; }
37  double getDiameter() const {return diameter; }
38  void setLinePressureLoss(LinePressureLoss * pL_);
39 
40  void init(InitStage stage);
41 
42  void plot();
43 
44  void initializeUsingXML(xercesc::DOMElement *element);
45  private:
46  double diameter;
47  LinePressureLoss * pL;
48  double ReynoldsFactor;
49  };
50 
51 
53 
55  class ClosableRigidLine : public RigidLine {
56  public:
57  ClosableRigidLine(const std::string &name="") : RigidLine(name), cpL(NULL), cpLFunction(NULL), cpLMinValue(0), cpLBilateral(false) {}
59  virtual std::string getType() const { return "ClosableRigidLine"; }
60 
61  void setClosablePressureLoss(ClosablePressureLoss * cpL_);
62  ClosablePressureLoss * getClosablePressureLoss() const {return cpL; }
63  void setFunction(MBSim::Function<double(double)> * s) {
64  cpLFunction = s;
65  cpLFunction->setParent(this);
66  cpLFunction->setName("cpLFunction");
67  }
68  MBSim::Function<double(double)> * getFunction() const {return cpLFunction; }
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 evalRegularizedValue() const;
74 
75  void init(InitStage stage);
76 
77  void initializeUsingXML(xercesc::DOMElement *element);
78  private:
80  MBSim::Function<double(double)> * cpLFunction;
81  double cpLMinValue;
82  bool cpLBilateral;
83  };
84 
85 
87 
90  public:
91  UnidirectionalRigidLine(const std::string &name="") : RigidLine(name), upL(NULL), dpMin(0) {}
92  virtual std::string getType() const { return "UnidirectionalRigidLine"; }
93 
94  void setUnidirectionalPressureLoss(UnidirectionalPressureLoss * upL_) {upL=upL_; }
95  UnidirectionalPressureLoss * getUnidirectionalPressureLoss() const {return upL; }
96  void setMinimalPressureDrop(double v) {dpMin=v; }
97  double getMinimalPressureDrop() const {return dpMin; }
98 
99  void init(InitStage stage);
100 
101  void initializeUsingXML(xercesc::DOMElement *element);
102  private:
104  double dpMin;
105  };
106 
107 }
108 
109 #endif /* ----- #ifndef _RIGID_LINE_H_ ----- */
110 
Definition: rigid_line.h:30
Definition: pressure_loss.h:322
Definition: pressure_loss.h:47
Definition: hline.h:91
Definition: pressure_loss.h:168
Definition: rigid_line.h:55
Definition: rigid_line.h:89

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML