mbsimhydraulics  4.0.0
MBSim Hydraulics Module
elastic_line_galerkin.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_GALERKIN_H_
21#define _ELASTIC_LINE_GALERKIN_H_
22
23#include "hline.h"
24
25class ansatz_function;
26
27namespace MBSimHydraulics {
28
30 class ElasticLineGalerkin : public HLine {
31
32 public:
33
34 enum AnsatzTypes {
35 BSplineOrd4,
36 BSplineOrd3,
37 Polynom,
38 Harmonic
39 };
40
42 ElasticLineGalerkin(const std::string &name="");
43
44 void calcSize() override;
45
47 void setp0(double p0_) {p0=p0_; }
49 void setFracAir(double fracAir_) {fracAir=fracAir_; }
51 void setdh(double dh_) {delta_h=dh_; }
53 void setDLehr(double DLehr_) {DLehr=DLehr_; }
55 //void setAnsatzFunction(std::string method_, int nAnsatz_);
56 void setAnsatzFunction(AnsatzTypes method_, int nAnsatz_);
58 void setFlow2D(bool flow2d=true){Flow2D=flow2d; }
60 void setRelativePlotPoints(const fmatvec::Vec &rPP) {relPlotPoints <<= rPP; }
61 void setDiameter(double d_) {d=d_; }
62 void setLength(double l_) {l=l_; }
63
64 void setQ0(double Q0_) {Q0=Q0_; }
65
66 fmatvec::Vec getQIn() {return QIn; }
67 fmatvec::Vec getQOut() {return QOut; }
68 fmatvec::VecV getInflowFactor() override {return -Area*wE; }
69 fmatvec::VecV getOutflowFactor() override {return Area*wA; }
70
71 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
72 void calcqSize() override {qSize=mdim; }
73 void calcuSize(int j) override {uSize[j]=mdim; }
74
75 void updateQ() override;
76 void updateh(int j=0) override;
77 void updateT() override;
78 void updateM() override;
79
80 void plot() override;
81 void plotParameters();
82
83 void initializeUsingXML(xercesc::DOMElement * element) override;
84
85 private:
86 int mdim{0}, plotdim{0};
87 double nu, g{0}, E{0}, k{0};
88 fmatvec::Vec WInt, wA, wE, lambda;
89 fmatvec::SymMat MatIntWWT, MatIntWSWST, K, D, N, Omega, MFac;
90 fmatvec::SqrMat phi;
91 ansatz_function * ansatz;
92 fmatvec::Mat plotVecW, plotVecWS;
93 double l{0}, d{0}, Area{0};
94
95 protected:
96 AnsatzTypes ansatzType;
97 bool Flow2D{false};
98 int nAnsatz{0};
99 double p0{0}, Q0{0}, fracAir{0}, delta_h{0}, DLehr{0};
100 fmatvec::Vec relPlotPoints;
101 };
102}
103
104
105#endif /* ----- #ifndef _HYDLINEGALERKIN_H_ ----- */
106
Definition: elastic_line_galerkin.h:30
void setDLehr(double DLehr_)
Definition: elastic_line_galerkin.h:53
ElasticLineGalerkin(const std::string &name="")
Definition: elastic_line_galerkin.cc:39
void setFracAir(double fracAir_)
Definition: elastic_line_galerkin.h:49
void setAnsatzFunction(AnsatzTypes method_, int nAnsatz_)
Definition: elastic_line_galerkin.cc:48
void setp0(double p0_)
Definition: elastic_line_galerkin.h:47
void setdh(double dh_)
Definition: elastic_line_galerkin.h:51
void setRelativePlotPoints(const fmatvec::Vec &rPP)
Definition: elastic_line_galerkin.h:60
void setFlow2D(bool flow2d=true)
Definition: elastic_line_galerkin.h:58
Definition: hline.h:40
std::string name