dune-pdelab 2.7-git
Loading...
Searching...
No Matches
const.hh
Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=8 sw=2 sts=2:
3#ifndef DUNE_PDELAB_FUNCTION_CONST_HH
4#define DUNE_PDELAB_FUNCTION_CONST_HH
5
7
8namespace Dune {
9 namespace PDELab {
10
12
17 template<typename GV, typename RF, unsigned dimR = 1>
20 AnalyticGridFunctionTraits<GV,RF,dimR>,
21 ConstGridFunction<GV,RF,dimR>
22 >,
24 {
25 public:
28 Traits,
30
32
39 ConstGridFunction(const GV& gv,
40 const typename Traits::RangeType& val_ = 1)
41 : BaseT(gv)
42 , val(val_)
43 {}
44
46
50 inline void
51 evaluateGlobal(const typename Traits::DomainType& x,
52 typename Traits::RangeType& y) const
53 {
54 y = val;
55 }
56
57 private:
58 typename Traits::RangeType val;
59 };
60
62
67 template<typename GV, typename RF, unsigned dimR = 1>
70 BoundaryGridFunctionTraits<
71 GV,
72 RF,dimR,FieldVector<RF,dimR> >,
73 ConstBoundaryGridFunction<GV, RF, dimR> >
74 {
75 public:
78 GV,
79 RF,dimR,FieldVector<RF,dimR> > Traits;
80
81 private:
83 Traits,
85
86 public:
88
94 const typename Traits::RangeType& val_ = 1)
95 : gv(gv_)
96 , val(val_)
97 {}
98
100
107 template<typename I>
108 inline void
110 const typename Traits::DomainType& x,
111 typename Traits::RangeType& y) const
112 {
113 y = val;
114 }
115
117 inline const GV& getGridView () const
118 {
119 return gv;
120 }
121
122 private:
123 const GV gv;
124 const typename Traits::RangeType val;
125 };
126
127 } // namspace PDELab
128} // namspace Dune
129
130#endif // DUNE_PDELAB_FUNCTION_CONST_HH
const IG & ig
Definition constraints.hh:149
For backward compatibility – Do not use this!
Definition adaptivity.hh:28
Dune::FieldVector< GV::Grid::ctype, GV::dimension-1 > DomainType
domain type in dim-size coordinates
Definition function.hh:50
Default class for additional methods in instationary functions.
Definition function.hh:93
traits class holding function signature, same as in local function
Definition function.hh:237
leaf of a function tree
Definition function.hh:329
function signature for analytic functions on a grid
Definition function.hh:642
an analytic grid function
Definition function.hh:660
Wrap intersection.
Definition geometrywrapper.hh:57
GridFunction returning a constant value everywhere.
Definition const.hh:24
void evaluateGlobal(const typename Traits::DomainType &x, typename Traits::RangeType &y) const
evaluate the function globally
Definition const.hh:51
AnalyticGridFunctionTraits< GV, RF, dimR > Traits
Definition const.hh:26
ConstGridFunction(const GV &gv, const typename Traits::RangeType &val_=1)
Contruct a Const GridFunction.
Definition const.hh:39
AnalyticGridFunctionBase< Traits, ConstGridFunction< GV, RF, dimR > > BaseT
Definition const.hh:29
BoundaryGridFunction returning a constant value everywhere.
Definition const.hh:74
const GV & getGridView() const
get a reference to the GridView
Definition const.hh:117
BoundaryGridFunctionTraits< GV, RF, dimR, FieldVector< RF, dimR > > Traits
export Traits class
Definition const.hh:79
void evaluate(const IntersectionGeometry< I > &ig, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
evaluate the function
Definition const.hh:109
ConstBoundaryGridFunction(const GV &gv_, const typename Traits::RangeType &val_=1)
Contruct a ConstBoundaryGridFunction.
Definition const.hh:93