dune-pdelab  2.7-git
dginteriorpenaltyparameter.hh
Go to the documentation of this file.
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 
6 #include <dune/common/parametertreeparser.hh>
7 
8 namespace Dune {
9  namespace PDELab {
10 
21  template<typename RF>
23  {
24  private :
25  RF sigma;
26  public :
27  DefaultInteriorPenalty(const Dune::ParameterTree& config)
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 :
63  OverPenalizedInteriorPenalty(const Dune::ParameterTree& config)
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
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Default implementation of the interior penalty factor.
Definition: dginteriorpenaltyparameter.hh:23
RF getFaceIP(const GEO &geo, const IGEO &igeo) const
Definition: dginteriorpenaltyparameter.hh:41
DefaultInteriorPenalty(const Dune::ParameterTree &config)
Definition: dginteriorpenaltyparameter.hh:27
RF getFaceIP(const GEO &geo, const IGEO &igeo, const OGEO &ogeo) const
Definition: dginteriorpenaltyparameter.hh:33
Implementation of overpenalized interior penalty.
Definition: dginteriorpenaltyparameter.hh:58
RF getFaceIP(const GEO &geo, const IGEO &igeo) const
Definition: dginteriorpenaltyparameter.hh:79
RF getFaceIP(const GEO &geo, const IGEO &igeo, const OGEO &ogeo) const
Definition: dginteriorpenaltyparameter.hh:70
OverPenalizedInteriorPenalty(const Dune::ParameterTree &config)
Definition: dginteriorpenaltyparameter.hh:63