dune-vtk 2.8
Loading...
Searching...
No Matches
concepts.hh
Go to the documentation of this file.
1#pragma once
2
3#include <type_traits>
4#include <dune/geometry/type.hh>
5
6namespace Dune
7{
8 namespace Vtk
9 {
10 template <class...> struct CheckTypes {};
11
12 template <class DataCollector, class DC = std::decay_t<DataCollector>>
13 using IsDataCollector = decltype((
14 std::declval<DC&>().update(),
15 std::declval<DC>().numPoints(),
16 std::declval<DC>().numCells(),
18 true));
19
20 template <class GridView, class GV = std::decay_t<GridView>>
21 using IsGridView = decltype((
22 std::declval<GV>().grid(),
23 std::declval<GV>().indexSet(),
24 std::declval<GV>().size(0),
25 std::declval<GV>().size(std::declval<Dune::GeometryType>()),
27 true));
28
29 template <class GridFunction, class GF = std::decay_t<GridFunction>>
30 using IsGridFunction = decltype((
31 localFunction(std::declval<GF const&>()),
32 true));
33
34 template <class LocalFunction, class LocalContext, class LF = std::decay_t<LocalFunction>>
35 using IsLocalFunction = decltype((
36 std::declval<LF&>().bind(std::declval<LocalContext>()),
37 std::declval<LF&>().unbind(),
38 std::declval<LF>()(std::declval<typename LocalContext::Geometry::LocalCoordinate>()),
39 true));
40
41 } // end namespace Vtk
42} // end namespace Dune
Definition: writer.hh:13
decltype((std::declval< LF & >().bind(std::declval< LocalContext >()), std::declval< LF & >().unbind(), std::declval< LF >()(std::declval< typename LocalContext::Geometry::LocalCoordinate >()), true)) IsLocalFunction
Definition: concepts.hh:39
decltype((std::declval< GV >().grid(), std::declval< GV >().indexSet(), std::declval< GV >().size(0), std::declval< GV >().size(std::declval< Dune::GeometryType >()), CheckTypes< typename GV::Grid, typename GV::IndexSet >{}, true)) IsGridView
Definition: concepts.hh:27
decltype((localFunction(std::declval< GF const & >()), true)) IsGridFunction
Definition: concepts.hh:32
decltype((std::declval< DC & >().update(), std::declval< DC >().numPoints(), std::declval< DC >().numCells(), CheckTypes< typename DC::GridView >{}, true)) IsDataCollector
Definition: concepts.hh:18
Definition: concepts.hh:10