/usr/include/dune/functions/gridfunctions/gridviewfunction.hh is in libdune-functions-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
#include <memory>
#include <dune/common/concept.hh>
#include <dune/functions/gridfunctions/gridfunction.hh>
#include <dune/functions/gridfunctions/gridviewentityset.hh>
#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
namespace Dune {
namespace Functions {
template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
class GridViewFunction
{};
/**
* \brief Wrapper class for functions defined on a GridView
*
* \ingroup FunctionInterface
*
* Being defined on a grid view means in particular that you can evaluate the function
* in local coordinates of a given element of the grid view.
*
* This models the \ref Concept::GridViewFunction<Range(Domain), GridView, DerivativeTraits> concept.
*
* \tparam GV The GridView that the function is defined on
* \tparam Domain The domain type used for function arguments
* \tparam Range The range type used for function values
*/
template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
{
using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
public:
using GridView = GV;
using Base::Base;
};
/**
* \brief Construct a function modeling GridViewFunction from function and grid view
*
* This spezialization is used for functions that already
* support localFunction(). It will simply return a copy of f.
*
* \param f A function object supporting argument compatible with global coordinates
* \param gridView The GridView the function should act on.
*
* \returns A function that models the GridViewFunction interface.
*/
template<class F, class GridView,
typename std::enable_if<
models< Imp::HasFreeLocalFunction, F>() , int>::type = 0>
typename std::decay<F>::type
makeGridViewFunction(F&& f, const GridView& gridView)
{
return std::forward<F>(f);
}
/**
* \brief Construct a function modeling GridViewFunction from function and grid view
*
* This spezialization is used for functions that do not
* support localFunction() themselves. It will forward
* to makeAnalyticGridViewFunction.
* Notice that the returned function will store a copy of
* the original function and a pointer to the GridView.
* It can only be used as long as the latter exists.
* Hence you must take care to store the GridView yourself.
* \todo Should we store a copy of the GridView?
*
* \param f A function object supporting argument compatible with global coordinates
* \param gridView The GridView the function should act on.
*
* \returns A function that models the GridFunction interface.
*/
template<class F, class GridView,
typename std::enable_if<
not(models< Imp::HasFreeLocalFunction, F>()) , int>::type = 0>
auto makeGridViewFunction(F&& f, const GridView& gridView)
-> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
{
return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
}
} // end of namespace Dune::Functions
} // end of namespace Dune
#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
|