5#ifndef DUNE_GRID_CONCEPTS_GRIDVIEW_HH
6#define DUNE_GRID_CONCEPTS_GRIDVIEW_HH
13#include <dune/grid/common/gridenums.hh>
14#include <dune/grid/concepts/entityiterator.hh>
15#include <dune/grid/concepts/geometry.hh>
16#include <dune/grid/concepts/indexidset.hh>
17#include <dune/grid/concepts/intersection.hh>
18#include <dune/grid/concepts/intersectioniterator.hh>
19#include <dune/grid/concepts/archetypes/datahandle.hh>
24 template<
class GV,
int codim, Dune::PartitionIteratorType partition>
25 concept GridViewPartition =
26 EntityIterator<typename GV::template Codim<codim>::template Partition<partition>::Iterator> &&
29 { gv.template begin<codim,partition>() } -> std::same_as<typename GV::template Codim<codim>::template Partition<partition>::Iterator>;
30 { gv.template end<codim,partition>() } -> std::same_as<typename GV::template Codim<codim>::template Partition<partition>::Iterator>;
33 template<
class GV,
int codim>
34 concept GridViewAllPartitions =
35 GridViewPartition<GV,codim,Dune::PartitionIteratorType::InteriorBorder_Partition> &&
36 GridViewPartition<GV,codim,Dune::PartitionIteratorType::Overlap_Partition> &&
37 GridViewPartition<GV,codim,Dune::PartitionIteratorType::OverlapFront_Partition> &&
38 GridViewPartition<GV,codim,Dune::PartitionIteratorType::All_Partition> &&
39 GridViewPartition<GV,codim,Dune::PartitionIteratorType::Ghost_Partition>;
41 template<
class GV,
int codim>
42 concept GridViewCodim =
44 Geometry<typename GV::template Codim<codim>::LocalGeometry> &&
45 EntityIterator<typename GV::template Codim<codim>::Iterator> &&
48 { gv.template begin<codim>() } -> std::same_as<typename GV::template Codim<codim>::Iterator>;
49 { gv.template end<codim>() } -> std::same_as<typename GV::template Codim<codim>::Iterator>;
51 requires (codim != 0) ||
requires(
const typename GV::template Codim<codim>::Entity& entity)
53 { gv.ibegin(entity) } -> std::same_as<typename GV::IntersectionIterator>;
54 { gv.iend(entity) } -> std::same_as<typename GV::IntersectionIterator>;
56 } && GridViewAllPartitions<GV,codim>;
58 template<
class GV,
class Gr
id,
int codim>
60 void requireGridViewCodim()
61 requires GridViewCodim<GV,codim> {}
63 template<
class GV,
class Gr
id,
int codim>
65 void requireGridViewCodim() {}
67 template <
class GV, std::size_t... c>
68 void gridViewAllCodims(std::index_sequence<c...>)
70 (requireGridViewCodim<GV,typename GV::Grid,int(c)>(),...);
89 { GV::conforming } -> std::convertible_to<bool>;
90 { GV::dimension } -> std::convertible_to<int>;
91 { GV::dimensionworld } -> std::convertible_to<int>;
92 { gv.grid() } -> std::same_as<const typename GV::Grid&>;
93 { gv.indexSet() } -> std::same_as<const typename GV::IndexSet&>;
94 { gv.size(codim) } -> std::convertible_to<int>;
95 { gv.size(type) } -> std::convertible_to<int>;
96 { gv.comm() } -> std::convertible_to<typename GV::Communication>;
97 { gv.overlapSize(codim) } -> std::convertible_to<int>;
98 { gv.ghostSize(codim) } -> std::convertible_to<int>;
100 requires requires(Archetypes::CommDataHandle<std::byte>& handle,
103 gv.communicate(handle, iface, dir);
106Impl::GridViewCodim<GV,0> &&
108 Impl::gridViewAllCodims<GV>(range(from, to).to_integer_sequence());
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Geometry(const Implementation &impl)
copy constructor from implementation
Definition: geometry.hh:384
Model of a grid view.
Definition: gridview.hh:81
Model of an index set.
Definition: indexidset.hh:44
Model of an intersection iterator.
Definition: intersectioniterator.hh:21
Model of an intersection.
Definition: intersection.hh:23
A set of traits classes to store static information about grid implementation.
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition: indices.hh:29
Namespace for concepts.
Definition: concept.hh:34
specialize with 'true' for all codims that a grid provides an iterator for (default=hasEntity<codim>:...
Definition: capabilities.hh:74