DUNE PDELab (git)

dginteriorpenaltyparameter.hh
1// -*- tab-width: 2; indent-tabs-mode: nil -*-
2// vi: set et ts=2 sw=2 sts=2:
3#ifndef DUNE_PDELAB_LOCALOPERATOR_DGINTERIORPENALTYPARAMETER_HH
4#define DUNE_PDELAB_LOCALOPERATOR_DGINTERIORPENALTYPARAMETER_HH
5
7
8namespace Dune {
9 namespace PDELab {
10
21 template<typename RF>
23 {
24 private :
25 RF sigma;
26 public :
28 {
29 sigma = config.get<RF>("sigma");
30 }
31
32 template<typename GEO, typename IGEO, typename OGEO>
33 RF getFaceIP(const GEO& geo, const IGEO& igeo, const OGEO& ogeo) const
34 {
35 using std::min;
36 // volume of face divided by volume of element => 1/h_F
37 return sigma * geo.volume()/min(igeo.volume(), ogeo.volume());
38 }
39
40 template<typename GEO, typename IGEO>
41 RF getFaceIP(const GEO& geo, const IGEO& igeo) const
42 {
43 // volume of face divided by volume of element => 1/h_F
44 return sigma * geo.volume()/igeo.volume();
45 }
46 }; // end class DefaultInteriorPenalty
47
56 template<typename RF>
58 {
59 private :
60 RF sigma;
61 RF beta;
62 public :
64 {
65 sigma = config.get<RF>("sigma");
66 beta = config.get<RF>("beta");
67 }
68
69 template<typename GEO, typename IGEO, typename OGEO>
70 RF getFaceIP(const GEO& geo, const IGEO& igeo, const OGEO& ogeo) const
71 {
72 using std::pow;
73 using std::min;
74 // volume of face divided by volume of element => 1/h_F
75 return sigma * pow(geo.volume()/min(igeo.volume(),ogeo.volume()), beta);
76 }
77
78 template<typename GEO, typename IGEO>
79 RF getFaceIP(const GEO& geo, const IGEO& igeo) const
80 {
81 using std::pow;
82 // volume of face divided by volume of element => 1/h_F
83 return sigma * pow(geo.volume()/igeo.volume(), beta);
84 }
85 }; // end class OverPenalizedInteriorPenalty
86
87 } // end namespace PDELab
88} // end namespace Dune
89#endif
Default implementation of the interior penalty factor.
Definition: dginteriorpenaltyparameter.hh:23
Implementation of overpenalized interior penalty.
Definition: dginteriorpenaltyparameter.hh:58
Hierarchical structure of string parameters.
Definition: parametertree.hh:37
std::string get(const std::string &key, const std::string &defaultValue) const
get value as string
Definition: parametertree.cc:188
constexpr auto min
Function object that returns the smaller of the given values.
Definition: hybridutilities.hh:506
Dune namespace.
Definition: alignedallocator.hh:13
Various parser methods to get data into a ParameterTree object.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)