concepts.hh 1.31 KB
Newer Older
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
#pragma once

#include <type_traits>
#include <dune/geometry/type.hh>

namespace Dune
{
  namespace Vtk
  {
    template <class...> struct CheckTypes {};

    template <class DataCollector, class DC = std::decay_t<DataCollector>>
    using IsDataCollector = decltype((
      std::declval<DC&>().update(),
      std::declval<DC>().numPoints(),
      std::declval<DC>().numCells(),
      CheckTypes<typename DC::GridView>{},
    true));

    template <class GridView, class GV = std::decay_t<GridView>>
    using IsGridView = 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));

29
30
31
32
33
34
35
36
37
38
39
40
    template <class GridFunction, class GF = std::decay_t<GridFunction>>
    using IsGridFunction = decltype((
      localFunction(std::declval<GF const&>()),
    true));

    template <class LocalFunction, class LocalContext, class LF = std::decay_t<LocalFunction>>
    using IsLocalFunction = decltype((
      std::declval<LF&>().bind(std::declval<LocalContext>()),
      std::declval<LF&>().unbind(),
      std::declval<LF>()(std::declval<typename LocalContext::Geometry::LocalCoordinate>()),
    true));

41
42
  } // end namespace Vtk
} // end namespace Dune