5#ifndef DUNE_GRID_CONCEPTS_INDEX_SET_HH
6#define DUNE_GRID_CONCEPTS_INDEX_SET_HH
11#include <dune/common/indices.hh>
12#include <dune/common/concepts/container.hh>
13#include <dune/common/concepts/hashable.hh>
14#include <dune/geometry/type.hh>
21 template<
class IS,
int codim>
22 concept IndexSetEntityCodim =
26 typename IS::template Codim<codim>::Entity;
29 Entity<
typename IS::template Codim<codim>::Entity> &&
30 requires(
const IS is,
int i,
unsigned int cc,
const typename IS::template Codim<codim>::Entity& entity)
32 { is.template index<codim>(entity) } -> std::same_as<typename IS::IndexType>;
33 { is.index(entity) } -> std::same_as<typename IS::IndexType>;
34 { is.template subIndex<codim>(entity,i,cc) } -> std::same_as<typename IS::IndexType>;
35 { is.subIndex(entity,i,cc) } -> std::same_as<typename IS::IndexType>;
36 { is.contains(entity) } -> std::convertible_to<bool>;
40 template<
class IS, std::size_t... c>
41 void indexSetEntityAllCodims(std::integer_sequence<std::size_t,c...>)
42 requires (IndexSetEntityCodim<IS,int(c)> &&...);
55concept IndexSet =
requires(
const IS is, Dune::GeometryType type,
int codim)
57 { IS::dimension } -> std::convertible_to<int>;
59 requires RandomAccessContainer<typename IS::Types>;
60 { is.types(codim) } -> std::convertible_to<typename IS::Types>;
62 requires std::integral<typename IS::IndexType>;
63 { is.size(type) } -> std::convertible_to<typename IS::IndexType>;
64 { is.size(codim) } -> std::convertible_to<typename IS::IndexType>;
66Impl::IndexSetEntityCodim<IS,0> &&
67requires (index_constant<1> from, index_constant<IS::dimension+1> to) {
68 Impl::indexSetEntityAllCodims<IS>(range(from, to).to_integer_sequence());
74 template<
class IS,
int codim>
75 concept IdSetEntityCodim =
79 typename IS::template Codim<codim>::Entity;
82 Entity<
typename IS::template Codim<codim>::Entity> &&
83 requires(
const IS is,
const typename IS::template Codim<codim>::Entity& entity)
85 { is.template id<codim>(entity) } -> std::same_as<typename IS::IdType>;
86 { is.id(entity) } -> std::same_as<typename IS::IdType>;
90 template<
class IS, std::size_t... c>
91 void idSetEntityAllCodims(std::integer_sequence<std::size_t,c...>)
92 requires (IdSetEntityCodim<IS,int(c)> &&...);
105concept IdSet =
requires(
const IS is,
const typename IS::template Codim<0>::Entity& entity,
int i,
unsigned int cc)
107 requires Hashable<typename IS::IdType>;
108 requires std::totally_ordered<typename IS::IdType>;
109 { is.subId(entity,i,cc) } -> std::same_as<typename IS::IdType>;
111Impl::IdSetEntityCodim<IS,0> &&
112requires (index_constant<1> from, index_constant<IS::dimension+1> to) {
113 Impl::idSetEntityAllCodims<IS>(range(from, to).to_integer_sequence());
Definition concepts/datahandle.hh:14
Model of an index set.
Definition concepts/indexidset.hh:55
Model of an id set.
Definition concepts/indexidset.hh:105