5#ifndef DUNE_GRID_CONCEPTS_GRID_HH
6#define DUNE_GRID_CONCEPTS_GRID_HH
13#include <dune/common/indices.hh>
15#include <dune/grid/common/gridenums.hh>
17#include <dune/grid/concepts/entity.hh>
18#include <dune/grid/concepts/entityiterator.hh>
19#include <dune/grid/concepts/geometry.hh>
20#include <dune/grid/concepts/gridview.hh>
21#include <dune/grid/concepts/indexidset.hh>
22#include <dune/grid/concepts/intersection.hh>
23#include <dune/grid/concepts/intersectioniterator.hh>
24#include <dune/grid/concepts/archetypes/datahandle.hh>
38 template<
class G,
int codim, Dune::PartitionIteratorType partition>
39 concept GridCodimPartition =
40 EntityIterator<typename G::template Codim<codim>::template Partition<partition>::LevelIterator> &&
41 EntityIterator<typename G::template Codim<codim>::template Partition<partition>::LeafIterator>;
43 template<
class G,
int codim>
44 concept GridCodimAllPartitions =
45 GridCodimPartition<G,codim,Dune::PartitionIteratorType::Interior_Partition> &&
46 GridCodimPartition<G,codim,Dune::PartitionIteratorType::InteriorBorder_Partition> &&
47 GridCodimPartition<G,codim,Dune::PartitionIteratorType::Overlap_Partition> &&
48 GridCodimPartition<G,codim,Dune::PartitionIteratorType::OverlapFront_Partition> &&
49 GridCodimPartition<G,codim,Dune::PartitionIteratorType::All_Partition> &&
50 GridCodimPartition<G,codim,Dune::PartitionIteratorType::Ghost_Partition>;
52 template<
class G,
int codim>
55 Geometry<typename G::template Codim<codim>::LocalGeometry> &&
56 Entity<typename G::template Codim<codim>::Entity> &&
58 requires(
const G cg,
const typename G::template Codim<codim>::EntitySeed& seed)
60 { cg.entity(seed) } -> std::convertible_to<typename G::template Codim<codim>::Entity>;
63 requires(G g, Archetypes::CommDataHandle<std::byte>& handle)
65 { g.loadBalance(handle) } -> std::convertible_to<bool>;
67 } && GridCodimAllPartitions<G,codim>;
69 template<
class G, std::size_t... c>
70 void gridAllCodims(std::index_sequence<c...>)
71 requires (GridCodim<G,int(c)> &&...);
112 { G::dimension } -> std::convertible_to<int>;
113 { G::dimensionworld } -> std::convertible_to<int>;
116 requires std::same_as<G,typename G::LeafGridView::Grid>;
117 requires std::same_as<G,typename G::LevelGridView::Grid>;
119 typename G::HierarchicIterator;
122 { cg.maxLevel() } -> std::convertible_to<int>;
123 { cg.size(level, codim) } -> std::convertible_to<int>;
124 { cg.size(codim) } -> std::convertible_to<int>;
125 { cg.size(level, type) } -> std::convertible_to<int>;
126 { cg.size(type) } -> std::convertible_to<int>;
127 { cg.numBoundarySegments() } -> std::convertible_to<std::size_t>;
128 { cg.levelGridView(level) } -> std::same_as<typename G::LevelGridView>;
129 { cg.leafGridView() } -> std::same_as<typename G::LeafGridView>;
130 { cg.globalIdSet() } -> std::same_as<const typename G::GlobalIdSet&>;
131 { cg.localIdSet() } -> std::same_as<const typename G::LocalIdSet&>;
132 { cg.levelIndexSet(level) } -> std::same_as<const typename G::LevelIndexSet&>;
133 { cg.leafIndexSet() } -> std::same_as<const typename G::LeafIndexSet&>;
134 { cg.comm() } -> std::convertible_to<typename G::Communication>;
137 requires requires(G g,
int refCount,
const typename G::template Codim<0>::Entity& entity)
139 { g.mark(refCount,entity) } -> std::convertible_to<bool>;
140 { g.getMark(entity) } -> std::convertible_to<int>;
141 { g.preAdapt() } -> std::convertible_to<bool>;
142 { g.adapt() } -> std::convertible_to<bool>;
143 { g.loadBalance() } -> std::convertible_to<bool>;
144 g.globalRefine(refCount);
148Impl::GridCodim<G,0> &&
150 Impl::gridAllCodims<G>(range(from, to).to_integer_sequence());
EntitySeed()
Construct an empty (i.e. isValid() == false) seed.
Definition: entityseed.hh:40
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
Requirements for implementations of the Dune::Grid interface.
Definition: grid.hh:98
Model of an id set.
Definition: indexidset.hh:83
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 can communicate data on (default=false)
Definition: capabilities.hh:97
A unique label for each type of element that can occur in a grid.