mbsimhydraulics 4.0.0 MBSim Hydraulics Module

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
49 void setp0(double p0_) {p0=p0_; }
51 void setFracAir(double fracAir_) {fracAir=fracAir_; }
53 void setDiameter(double d_) {r=d_/2.; }
55 void setLength(double l_) {l=l_; }
57 void setRelativePlotPoints(const fmatvec::Vec &rPP) {relPlotPoints=rPP; }
59 void setWindowFunction(WindowFunction w) {window_function_type=w; }
61 void setNumberOfAnsatzFunctions(unsigned int n_=4) {n=2*n_+1; }
63 void printLineStateSpace(bool print=true) {printStateSpace=print; }
64
65 fmatvec::VecV getInflowFactor() override {return wI; }
66 fmatvec::VecV getOutflowFactor() override {return wO; }
67
68 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
69 void calcqSize() override {qSize=n-1; }
70 void calcuSize(int j) override {uSize[j]=n; }
71
72 void updateQ() override;
73 void updateh(int j=0) override;
74 void updateT() override {T=Tlocal; }
75 void updateM() override {M=Mlocal; }
76
77 void plot() override;
78 void plotParameters();
79
80 void initializeUsingXML(xercesc::DOMElement * element) override;
81
82 protected:
83 double p0, fracAir, r, l;
84 fmatvec::Vec relPlotPoints;
85 WindowFunction window_function_type;
86 int n;
87 bool printStateSpace;
88
89 private:
90 fmatvec::VecV wO, wI;
91 fmatvec::Vec hq, hu, hp0, cu;
92 fmatvec::Mat Tlocal, relPlot;
93 fmatvec::SymMat Mlocal;
94
95 void doPrintStateSpace();
96 };
97
98 }
99
100
101 #endif
102
MBSimHydraulics::ElasticLineVariational::setFracAir
void setFracAir(double fracAir_)
Definition: elastic_line_variational.h:51
MBSimHydraulics::ElasticLineVariational::setRelativePlotPoints
void setRelativePlotPoints(const fmatvec::Vec &rPP)
Definition: elastic_line_variational.h:57
MBSim::Object::T
fmatvec::Mat T
MBSimHydraulics::HLine
Definition: hline.h:40
MBSim::Object::qSize
int qSize
MBSimHydraulics::ElasticLineVariational::setDiameter
void setDiameter(double d_)
Definition: elastic_line_variational.h:53
MBSimHydraulics::ElasticLineVariational::setLength
void setLength(double l_)
Definition: elastic_line_variational.h:55
MBSimHydraulics::ElasticLineVariational::setWindowFunction
void setWindowFunction(WindowFunction w)
Definition: elastic_line_variational.h:59
MBSim::Element::InitStage
InitStage
MBSim::Element::name
std::string name
MBSimHydraulics::ElasticLineVariational::ElasticLineVariational
ElasticLineVariational(const std::string &name="")
Definition: elastic_line_variational.cc:40
MBSim::Object::uSize
int uSize[2]
MBSimHydraulics::ElasticLineVariational::setp0
void setp0(double p0_)
Definition: elastic_line_variational.h:49
MBSimHydraulics::ElasticLineVariational::printLineStateSpace
void printLineStateSpace(bool print=true)
Definition: elastic_line_variational.h:63
MBSimHydraulics::ElasticLineVariational
Definition: elastic_line_variational.h:33
MBSim::Object::M
fmatvec::SymMat M
MBSimHydraulics::ElasticLineVariational::setNumberOfAnsatzFunctions
void setNumberOfAnsatzFunctions(unsigned int n_=4)
Definition: elastic_line_variational.h:61