Commit e50f64ae authored by Martin Nolte's avatar Martin Nolte

Merge branch 'feature/add-has-entity-iterator-capability' into 'master'

add capability hasEntityIterator

Closes #38

See merge request !230
parents 9d77c363 8f3bb0d1
Pipeline #5606 passed with stage
in 55 minutes and 44 seconds
......@@ -46,6 +46,17 @@ namespace Dune
static const bool v = true;
};
/**
* \brief AlbertaGrid can iterate over all codimensions
*
* \ingroup AlbertaGrid
**/
template< int dim, int dimworld, int codim >
struct hasEntityIterator< AlbertaGrid< dim, dimworld >, codim >
{
static const bool v = true;
};
/** \brief AlbertaGrid is not levelwise conforming
* (since it uses bisection)
* \ingroup AlbertaGrid
......
......@@ -57,6 +57,22 @@ namespace Dune
static const bool v = false;
};
/**
* \brief specialize with 'true' for all codims that a grid provides an iterator for (default=false)
*
* \note Being able to iterate over a codimension implies that the grid
* provides entities for that codimension.
* \note Any fully conforming DUNE grid implementation must be able to
* iterate over all codim 0 entities (i.e., elements).
*
* \ingroup GICapabilities
**/
template< class Grid, int codim >
struct hasEntityIterator
{
static const bool v = false;
};
/** \brief Specialize with 'false' for all codims that a grid does not
implement geometries for. (default=true)
\ingroup GICapabilities
......@@ -179,6 +195,12 @@ namespace Dune
static const bool v = Dune::Capabilities::hasEntity<Grid,codim>::v;
};
template< class Grid, int codim >
struct hasEntityIterator< const Grid, codim >
{
static const bool v = Dune::Capabilities::hasEntityIterator< Grid, codim >::v;
};
template< class Grid, int codim >
struct canCommunicate< const Grid, codim >
{
......
......@@ -38,6 +38,13 @@ namespace Dune
};
template< class HostGrid, class CoordFunction, class Allocator, int codim >
struct hasEntityIterator< GeometryGrid< HostGrid, CoordFunction, Allocator >, codim >
{
static const bool v = true;
};
template< class HostGrid, class CoordFunction, class Allocator, int codim >
struct canCommunicate< GeometryGrid< HostGrid, CoordFunction, Allocator >, codim >
{
......
......@@ -491,6 +491,12 @@ namespace Dune
static const bool v = hasEntity<HostGrid,codim>::v;
};
template<class HostGrid, int codim>
struct hasEntityIterator<IdentityGrid<HostGrid>, codim>
{
static const bool v = hasEntityIterator<HostGrid, codim>::v;
};
/** \brief has conforming level grids when host grid has
* \ingroup IdentityGrid
*/
......
......@@ -435,6 +435,16 @@ namespace Dune {
static const bool v = true;
};
/**
* \brief OneDGrid can iterate over all codimensions
* \ingroup OneDGrid
**/
template<int codim>
struct hasEntityIterator<OneDGrid, codim>
{
static const bool v = false;
};
/** \brief OneDGrid is levelwise conforming
\ingroup OneDGrid
*/
......
......@@ -985,6 +985,26 @@ namespace Dune {
static const bool v = true;
};
/**
* \brief UGGrid can iterate over codim=0 entities (elements)
* \ingroup UGGrid
**/
template<int dim>
struct hasEntityIterator<UGGrid<dim>, 0>
{
static const bool v = true;
};
/**
* \brief UGGrid can iterate over codim=dim entities (vertices)
* \ingroup UGGrid
**/
template<int dim>
struct hasEntityIterator<UGGrid<dim>, dim>
{
static const bool v = true;
};
/** \brief UGGrid is levelwise conforming
\ingroup UGGrid
*/
......
......@@ -1824,6 +1824,16 @@ namespace Dune {
static const bool v = true;
};
/**
* \brief YaspGrid can iterate over all codimensions
* \ingroup YaspGrid
**/
template<int dim, class Coordinates, int codim>
struct hasEntityIterator<YaspGrid<dim, Coordinates>, codim>
{
static const bool v = true;
};
/** \brief YaspGrid can communicate on all codimensions
* \ingroup YaspGrid
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment