All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
elastic_line_variational.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 _ELASTIC_LINE_VARIATIONAL_H_
21 #define _ELASTIC_LINE_VARIATIONAL_H_
22 
23 #include "hline.h"
24 
25 namespace MBSimHydraulics {
26 
33  class ElasticLineVariational : public HLine {
34 
35  public:
36 
37  enum WindowFunction {
38  None,
39  Hann,
40  Hamming,
41  Riemann,
42  BlackmanHarris
43  };
44 
46  ElasticLineVariational(const std::string &name="");
47  virtual std::string getType() const { return "ElasticLineVariational"; }
48 
50  void setp0(double p0_) {p0=p0_; }
52  void setFracAir(double fracAir_) {fracAir=fracAir_; }
54  void setDiameter(double d_) {r=d_/2.; }
56  void setLength(double l_) {l=l_; }
58  void setRelativePlotPoints(const fmatvec::Vec &rPP) {relPlotPoints=rPP; }
60  void setWindowFunction(WindowFunction w) {window_function_type=w; }
62  void setNumberOfAnsatzFunctions(unsigned int n_=4) {n=2*n_+1; }
64  void printLineStateSpace(bool print=true) {printStateSpace=print; }
65 
66  fmatvec::Vec getQIn() {return QIn; }
67  fmatvec::Vec getQOut() {return QOut; }
68  fmatvec::Vec getInflowFactor() {return wI; }
69  fmatvec::Vec getOutflowFactor() {return wO; }
70 
71  void init(InitStage stage);
72  void calcqSize() {qSize=n-1; }
73  void calcuSize(int j) {uSize[j]=n; }
74 
75  void updateStateDependentVariables(double t);
76  void updateh(double t, int j=0);
77  void updateT(double t) {T=Tlocal; }
78  void updateM(double t, int j=0) {M[j]=Mlocal; }
79 
80  void plot(double t, double dt);
81  void plotParameters();
82 
83  void initializeUsingXML(xercesc::DOMElement * element);
84 
85  protected:
86  double p0, fracAir, r, l;
87  fmatvec::Vec relPlotPoints;
88  WindowFunction window_function_type;
89  int n;
90  bool printStateSpace;
91 
92  private:
93  fmatvec::Vec QIn, QOut, wO, wI;
94  fmatvec::Vec hq, hu, hp0, cu, y;
95  fmatvec::Mat Tlocal, relPlot;
96  fmatvec::SymMat Mlocal;
97 
98  void doPrintStateSpace();
99  };
100 
101 }
102 
103 
104 #endif
105 
void setFracAir(double fracAir_)
Definition: elastic_line_variational.h:52
void setRelativePlotPoints(const fmatvec::Vec &rPP)
Definition: elastic_line_variational.h:58
Definition: hline.h:41
void setDiameter(double d_)
Definition: elastic_line_variational.h:54
void setLength(double l_)
Definition: elastic_line_variational.h:56
void setWindowFunction(WindowFunction w)
Definition: elastic_line_variational.h:60
ElasticLineVariational(const std::string &name="")
Definition: elastic_line_variational.cc:40
void setp0(double p0_)
Definition: elastic_line_variational.h:50
void printLineStateSpace(bool print=true)
Definition: elastic_line_variational.h:64
Definition: elastic_line_variational.h:33
void setNumberOfAnsatzFunctions(unsigned int n_=4)
Definition: elastic_line_variational.h:62

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML