DUNE PDELab (git)

dgnavierstokesparameter.hh
1// -*- tab-width: 2; indent-tabs-mode: nil -*-
2// vi: set et ts=2 sw=2 sts=2:
3
4#ifndef DUNE_PDELAB_LOCALOPERATOR_DGNAVIERSTOKESPARAMETER_HH
5#define DUNE_PDELAB_LOCALOPERATOR_DGNAVIERSTOKESPARAMETER_HH
6
8#include <dune/pdelab/common/geometrywrapper.hh>
9#include <dune/pdelab/localoperator/dginteriorpenaltyparameter.hh>
10#include <dune/pdelab/localoperator/stokesparameter.hh>
11
12namespace Dune {
13 namespace PDELab {
14
32 template<typename GV, typename RF, typename F, typename B, typename V, typename J,
33 bool navier = false, bool full_tensor = false, typename IP = DefaultInteriorPenalty<typename V::Traits::RangeFieldType> >
35 public NavierStokesDefaultParameters<GV,RF,F,B,V,J,navier,full_tensor>
36 {
37
40
41 void initFromString(const std::string & method)
42 {
43 std::string s = method;
44 std::transform(s.begin(), s.end(), s.begin(), tolower);
45
46 // nipg (epsilon=1) 2d p1 -> Klaus sagt sollte auch sigma 1 klappen
47 if (s.find("nipg") != std::string::npos)
48 {
49 _epsilon = 1;
50 return;
51 }
52 // sipg (epsilon=-1) 2d p1 -> Klaus sagt sigma=3.9irgendwas
53 if (s.find("sipg") != std::string::npos)
54 {
55 _epsilon = -1;
56 return;
57 }
58 // obb sigma = 0, epsilon =
59 if (s == "obb")
60 {
61 _epsilon = 1;
62 return;
63 }
64 // extract parameters
65 {
66 double sigma, beta;
67 if (3 == sscanf(s.c_str(), "%d %lg %lg", &_epsilon, &sigma, &beta))
68 return;
69 }
70 DUNE_THROW(Dune::Exception, "Unknown DG type " << method);
71 }
72
73 public :
74
76 typedef typename Base::Traits Traits;
77
99 F& f, B& b, V& v, J& j)
100 : Base(configuration,f,b,v,j)
101 , _ip(configuration.sub("dg"))
102 , _epsilon(configuration.sub("dg").get<int>("epsilon"))
103 {}
104
105
107 typename Traits::RangeField
109 {
110 typename Traits::RangeField y(1.0 / dt);
111 return y;
112 }
113
116 template<typename GEO, typename IGEO, typename OGEO>
117 typename Traits::RangeField
118 getFaceIP(const GEO& geo, const IGEO& igeo, const OGEO& ogeo)
119 {
120 return _ip.getFaceIP(geo,igeo,ogeo);
121 }
122
125 template<typename GEO, typename IGEO>
126 typename Traits::RangeField
127 getFaceIP(const GEO& geo, const IGEO& igeo)
128 {
129 return _ip.getFaceIP(geo,igeo);
130 }
131
134 int
136 {
137 return _epsilon;
138 }
139
140 private:
141
142 IP _ip; // Interior penalty
143 int _epsilon; // IP symmetry factor
144 }; // end class DGNavierStokesParameters
145
146
147 namespace NavierStokesDGImp{
164 template< typename PRM, typename Dummy = void>
166
167 template<typename IntersectionGeometry>
168 static typename PRM::Traits::RangeField
169 boundarySlip
170 (const PRM & ,
171 const IntersectionGeometry& ,
172 const typename PRM::Traits::IntersectionDomain& )
173 {
174 return 1.0;
175 }
176
177 };
178
179 template< typename PRM>
181 <PRM,typename std::enable_if<PRM::enable_variable_slip>::type>
182 {
183 template<typename IntersectionGeometry>
184 static typename PRM::Traits::RangeField
185 boundarySlip
186 (const PRM & prm,
187 const IntersectionGeometry& ig,
188 const typename PRM::Traits::IntersectionDomain& x)
189 {
190 return prm.boundarySlip(ig,x);
191 }
192
193 };
195 }
196
197 } // end namespace PDELab
198} // end namespace Dune
199#endif // DUNE_PDELAB_LOCALOPERATOR_DGNAVIERSTOKESPARAMETER_HH
Base class for Dune-Exceptions.
Definition: exceptions.hh:96
Parameter class for local operator DGNavierStokes.
Definition: dgnavierstokesparameter.hh:36
int epsilonIPSymmetryFactor()
Definition: dgnavierstokesparameter.hh:135
Traits::RangeField getFaceIP(const GEO &geo, const IGEO &igeo, const OGEO &ogeo)
Get interior penalty parameter from skeleton face.
Definition: dgnavierstokesparameter.hh:118
DGNavierStokesParameters(const Dune::ParameterTree &configuration, F &f, B &b, V &v, J &j)
Constructor that parses values from parameter tree.
Definition: dgnavierstokesparameter.hh:98
Base::Traits Traits
Traits class.
Definition: dgnavierstokesparameter.hh:76
Traits::RangeField getFaceIP(const GEO &geo, const IGEO &igeo)
Get interior penalty parameter from boundary face.
Definition: dgnavierstokesparameter.hh:127
Traits::RangeField incompressibilityScaling(typename Traits::RangeField dt) const
Rescaling factor for the incompressibility equation.
Definition: dgnavierstokesparameter.hh:108
Wrap intersection.
Definition: geometrywrapper.hh:57
Definition: stokesparameter.hh:144
Traits::VelocityRange j(const IG &ig, const typename Traits::IntersectionDomain &x, const typename Traits::Domain &normal) const
Neumann boundary condition (stress)
Traits::VelocityRange f(const EG &e, const typename Traits::Domain &x) const
source term
Definition: stokesparameter.hh:185
Hierarchical structure of string parameters.
Definition: parametertree.hh:37
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
Return the entry at position pos of the given sequence.
Definition: integersequence.hh:22
STL namespace.
Various parser methods to get data into a ParameterTree object.
Compile-time switch for the boundary slip factor.
Definition: dgnavierstokesparameter.hh:165
Definition: stokesparameter.hh:46
RF RangeField
Export type for range field.
Definition: stokesparameter.hh:66
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)