Dune Core Modules (2.9.0)

gridviewfunction.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
5
6#include <memory>
7
9
10#include <dune/functions/gridfunctions/gridfunction.hh>
11#include <dune/functions/gridfunctions/gridviewentityset.hh>
12#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
13
14
15namespace Dune {
16namespace Functions {
17
18
19
20template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
21class GridViewFunction
22{};
23
24
25
40template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
41class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
42 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
43{
44 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
45public:
46 using GridView = GV;
47
48 using Base::Base;
49};
50
51
52
64template<class F, class GridView,
65 typename std::enable_if<
66 models< Imp::HasFreeLocalFunction, F>() , int>::type = 0>
67typename std::decay<F>::type
68 makeGridViewFunction(F&& f, const GridView& gridView)
69{
70 return std::forward<F>(f);
71}
72
73
74
90template<class F, class GridView,
91 typename std::enable_if<
92 not(models< Imp::HasFreeLocalFunction, F>()) , int>::type = 0>
93auto makeGridViewFunction(F&& f, const GridView& gridView)
94 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
95{
96 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
97}
98
99
100
101} // end of namespace Dune::Functions
102} // end of namespace Dune
103
104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
An entity set for all entities of given codim in a grid view.
Definition: gridviewentityset.hh:23
Grid view abstract base class.
Definition: gridview.hh:66
Infrastructure for concepts.
AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition: analyticgridviewfunction.hh:230
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)