3#ifndef DUNE_MMESH_INTERFACE_COMMON_HH
4#define DUNE_MMESH_INTERFACE_COMMON_HH
12namespace MMeshInterfaceImpl {
15template <
typename HostEntity,
int dim>
17 std::array<std::pair<std::size_t, std::size_t>, dim + 1> pairs;
18 for (std::size_t i = 0; i < dim + 1; ++i) {
19 auto i0 = (hostEntity.second + i + 1) % (dim + 2);
21 pairs[i].second = hostEntity.first->vertex(i0)->info().id;
24 std::sort(pairs.begin(), pairs.end(),
25 [](
auto& a,
auto& b) { return a.second < b.second; });
27 std::array<std::size_t, dim + 1> indices;
28 for (std::size_t i = 0; i < dim + 1; ++i) indices[i] = pairs[i].first;
30 assert(hostEntity.first->vertex(indices[0])->info().id <
31 hostEntity.first->vertex(indices[1])->info().id);
33 if constexpr (dim == 2)
34 assert(hostEntity.first->vertex(indices[1])->info().id <
35 hostEntity.first->vertex(indices[2])->info().id);
static auto computeCGALIndices(const HostEntity &hostEntity)
Return list of indices sorted by id.
Definition: common.hh:16