Skip to content
Snippets Groups Projects
capabilities.hh 3.26 KiB
Newer Older
Stenger, Florian's avatar
Stenger, Florian committed
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_CRVSRF_CAPABILITIES_HH
#define DUNE_CRVSRF_CAPABILITIES_HH

#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
    // ---------------------------

    template< class HostGrid, class CoordFunction, int order, class Allocator >
Stenger, Florian's avatar
Stenger, Florian committed
    struct hasSingleGeometryType< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator > >
    {
      static const bool v = hasSingleGeometryType< HostGrid > :: v;
      static const unsigned int topologyId = hasSingleGeometryType< HostGrid > :: topologyId;
    };


    template< class HostGrid, class CoordFunction, int order, class Allocator, int codim >
Stenger, Florian's avatar
Stenger, Florian committed
    struct hasEntity< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator >, codim >
    {
      static const bool v = true;
    };


    template< class HostGrid, class CoordFunction, int order, class Allocator, int codim >
Stenger, Florian's avatar
Stenger, Florian committed
    struct hasEntityIterator< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator >, codim >
    {
      static const bool v = true;
    };


    template< class HostGrid, class CoordFunction, int order, class Allocator, int codim >
Stenger, Florian's avatar
Stenger, Florian committed
    struct canCommunicate< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator >, codim >
    {
      static const bool v = canCommunicate< HostGrid, codim >::v && hasEntity< HostGrid, codim >::v;
    };


    template< class HostGrid, class CoordFunction, int order, class Allocator >
Stenger, Florian's avatar
Stenger, Florian committed
    struct hasBackupRestoreFacilities< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator > >
    {
      static const bool v = hasBackupRestoreFacilities< HostGrid >::v;
    };

    template< class HostGrid, class CoordFunction, int order, class Allocator >
Stenger, Florian's avatar
Stenger, Florian committed
    struct isLevelwiseConforming< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator > >
    {
      static const bool v = isLevelwiseConforming< HostGrid >::v;
    };

    template< class HostGrid, class CoordFunction, int order, class Allocator >
Stenger, Florian's avatar
Stenger, Florian committed
    struct isLeafwiseConforming< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator > >
    {
      static const bool v = isLeafwiseConforming< HostGrid >::v;
    };

    template< class HostGrid, class CoordFunction, int order, class Allocator >
Stenger, Florian's avatar
Stenger, Florian committed
    struct threadSafe< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator > >
    {
      static const bool v = false;
    };

    template< class HostGrid, class CoordFunction, int order, class Allocator >
Stenger, Florian's avatar
Stenger, Florian committed
    struct viewThreadSafe< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator > >
    {
      static const bool v = false;
    };



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

    template< class HostGrid, class CoordFunction, int order, class Allocator, int codim >
Stenger, Florian's avatar
Stenger, Florian committed
    struct hasHostEntity< CurvedSurfaceGrid< HostGrid, CoordFunction, order, Allocator >, codim >
    {
      static const bool v = hasEntity< HostGrid, codim >::v;
    };

  } // namespace Capabilities

} // namespace Dune

#endif // #ifndef DUNE_CRVSRF_CAPABILITIES_HH