DUNE PDELab (git)

const.hh
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
6#include <dune/pdelab/common/function.hh>
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
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,
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
vector space out of a tensor product of fields.
Definition: fvector.hh:91
an analytic grid function
Definition: function.hh:660
leaf of a function tree
Definition: function.hh:329
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
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
ConstGridFunction(const GV &gv, const typename Traits::RangeType &val_=1)
Contruct a Const GridFunction.
Definition: const.hh:39
Default class for additional methods in instationary functions.
Definition: function.hh:93
Wrap intersection.
Definition: geometrywrapper.hh:57
Dune namespace.
Definition: alignedallocator.hh:13
function signature for analytic functions on a grid
Definition: function.hh:642
traits class holding function signature, same as in local function
Definition: function.hh:237
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)