capabilities.hh 3.08 KB
Newer Older
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
1
2
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
Praetorius, Simon's avatar
Praetorius, Simon committed
3
4
#ifndef DUNE_CURVED_SURFACE_GRID_CAPABILITIES_HH
#define DUNE_CURVED_SURFACE_GRID_CAPABILITIES_HH
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include <cassert>

#include <dune/common/hybridutilities.hh>
#include <dune/common/std/utility.hh>

#include <dune/grid/common/capabilities.hh>
#include <dune/grid/geometrygrid/capabilities.hh>
#include <dune/curvedsurfacegrid/declaration.hh>

namespace Dune
{

  // Capabilities
  // ------------

  namespace Capabilities
  {

    // Capabilities from dune-grid
    // ---------------------------

27
28
    template< class GridFunction, int order >
    struct hasSingleGeometryType< CurvedSurfaceGrid<GridFunction,order> >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
29
    {
30
      using HostGrid = typename GridFunction::GridView::Grid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
31
32
33
34
35
      static const bool v = hasSingleGeometryType< HostGrid > :: v;
      static const unsigned int topologyId = hasSingleGeometryType< HostGrid > :: topologyId;
    };


36
37
    template< class GridFunction, int order, int codim >
    struct hasEntity< CurvedSurfaceGrid<GridFunction,order>, codim >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
38
39
40
41
42
    {
      static const bool v = true;
    };


43
44
    template< class GridFunction, int order, int codim >
    struct hasEntityIterator< CurvedSurfaceGrid<GridFunction,order>, codim >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
45
46
47
48
49
    {
      static const bool v = true;
    };


50
51
    template< class GridFunction, int order, int codim >
    struct canCommunicate< CurvedSurfaceGrid<GridFunction,order>, codim >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
52
    {
53
      using HostGrid = typename GridFunction::GridView::Grid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
54
55
56
57
      static const bool v = canCommunicate< HostGrid, codim >::v && hasEntity< HostGrid, codim >::v;
    };


58
59
    template< class GridFunction, int order >
    struct hasBackupRestoreFacilities< CurvedSurfaceGrid<GridFunction,order> >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
60
    {
61
      using HostGrid = typename GridFunction::GridView::Grid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
62
63
64
      static const bool v = hasBackupRestoreFacilities< HostGrid >::v;
    };

65
66
    template< class GridFunction, int order >
    struct isLevelwiseConforming< CurvedSurfaceGrid<GridFunction,order> >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
67
    {
68
      using HostGrid = typename GridFunction::GridView::Grid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
69
70
71
      static const bool v = isLevelwiseConforming< HostGrid >::v;
    };

72
73
    template< class GridFunction, int order >
    struct isLeafwiseConforming< CurvedSurfaceGrid<GridFunction,order> >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
74
    {
75
      using HostGrid = typename GridFunction::GridView::Grid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
76
77
78
      static const bool v = isLeafwiseConforming< HostGrid >::v;
    };

79
80
    template< class GridFunction, int order >
    struct threadSafe< CurvedSurfaceGrid<GridFunction,order> >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
81
82
83
84
    {
      static const bool v = false;
    };

85
86
    template< class GridFunction, int order >
    struct viewThreadSafe< CurvedSurfaceGrid<GridFunction,order> >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
87
88
89
90
91
92
93
94
95
    {
      static const bool v = false;
    };



    // hasHostEntity
    // -------------

96
97
    template< class GridFunction, int order, int codim >
    struct hasHostEntity< CurvedSurfaceGrid<GridFunction,order>, codim >
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
98
    {
99
      using HostGrid = typename GridFunction::GridView::Grid;
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
100
101
102
103
104
105
106
      static const bool v = hasEntity< HostGrid, codim >::v;
    };

  } // namespace Capabilities

} // namespace Dune

Praetorius, Simon's avatar
Praetorius, Simon committed
107
#endif // DUNE_CURVED_SURFACE_GRID_CAPABILITIES_HH