Go to the documentation of this file.
3#ifndef DUNE_MMESH_INTERFACE_COMMON_HH
4#define DUNE_MMESH_INTERFACE_COMMON_HH
13 namespace MMeshInterfaceImpl
17 template <
typename HostEntity,
int dim >
20 std::array< std::pair< std::size_t, std::size_t >, dim+1 > pairs;
21 for ( std::size_t i = 0; i < dim+1; ++i )
23 auto i0 = (hostEntity.second+i+1)%(dim+2);
25 pairs[i].second = hostEntity.first->vertex( i0 )->info().id;
28 std::sort(pairs.begin(), pairs.end(), [](
auto& a,
auto& b){ return a.second < b.second; });
30 std::array< std::size_t, dim+1 > indices;
31 for ( std::size_t i = 0; i < dim+1; ++i )
32 indices[i] = pairs[i].first;
34 assert( hostEntity.first->vertex(indices[0])->info().id < hostEntity.first->vertex(indices[1])->info().id );
36 if constexpr (dim == 2)
37 assert( hostEntity.first->vertex(indices[1])->info().id < hostEntity.first->vertex(indices[2])->info().id );
static auto computeCGALIndices(const HostEntity &hostEntity)
Return list of indices sorted by id.
Definition: common.hh:18