File: capabilities.hh

package info (click to toggle)
dune-grid 2.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,472 kB
  • sloc: cpp: 60,883; python: 1,438; perl: 191; makefile: 12; sh: 3
file content (73 lines) | stat: -rw-r--r-- 1,674 bytes parent folder | download | duplicates (2)
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
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_PYTHON_GRID_CAPABILITIES_HH
#define DUNE_PYTHON_GRID_CAPABILITIES_HH

#include <type_traits>

#include <dune/grid/common/capabilities.hh>
#include <dune/grid/common/gridfactory.hh>

namespace Dune
{

  // External Forward Declarations
  // -----------------------------

  template< int dim, class Coordinates >
  class YaspGrid;



  namespace Python
  {

    namespace Capabilities
    {

      using namespace Dune::Capabilities;



      // HasGridFactory
      // --------------

      template< class Grid >
      struct HasGridFactory
        : public std::integral_constant< bool, !isCartesian< Grid >::v >
      {};



      // HasStructuredGridFactory
      // ------------------------

      template< class Grid >
      struct HasStructuredGridFactory
        : public std::integral_constant< bool, HasGridFactory< Grid >::value && (Grid::dimension == Grid::dimensionworld) >
      {};

      template< int dim, class Coordinates >
      struct HasStructuredGridFactory< YaspGrid< dim, Coordinates > >
        : public std::true_type
      {};



      // canIterate
      // ----------

      template< class Grid, int codim >
      struct canIterate
        : public std::integral_constant< bool, hasEntityIterator< Grid, codim >::v >
      {};

    } // namespace Capabilities

  } // namespace Python

} // namespace Dune

#endif // #ifndef DUNE_PYTHON_GRID_CAPABILITIES_HH