capabilities.hh 3.05 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

#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>
14
#include <dune/curvedsurfacegrid/gridfunction/gridfunction.hh>
Stenger, Florian's avatar
v0.1.0  
Stenger, Florian committed
15
16
17
18
19
20
21
22
23
24
25
26
27

namespace Dune
{

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

  namespace Capabilities
  {

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

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


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


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


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


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

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

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

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

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



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

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

  } // namespace Capabilities

} // namespace Dune

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