8#include "kernel/geometry/mesh_permutation.hpp" 
    9#include "kernel/shape.hpp" 
   10#include "kernel/util/string.hpp" 
   11#include <kernel/adjacency/permutation.hpp> 
   13#include <kernel/geometry/adaptive_mesh.hpp> 
   14#include <kernel/util/tiny_algebra.hpp> 
   33  template<
typename AdaptiveMeshType_>
 
   41    static constexpr int num_coords = AdaptiveMeshType::world_dim;
 
   44    using CoordType = 
typename AdaptiveMeshType::CoordType;
 
   47    using VertexType = 
typename AdaptiveMeshType::VertexType;
 
   51    std::shared_ptr<AdaptiveMeshType> 
_mesh;
 
   61    std::optional<Adjacency::Permutation> _perm;
 
   86    std::size_t bytes()
 const 
  105      return _mesh->get_num_entities(_layer, 0);
 
  119        return _mesh->vertex(_layer, _perm.value().map(idx));
 
  121      return _mesh->vertex(_layer, idx);
 
  129        return _mesh->vertex(_layer, _perm.value().map(idx));
 
  131      return _mesh->vertex(_layer, idx);
 
  153        _perm = std::optional{invert ? perm.
inverse() : perm.
clone()};
 
  163          _perm.value().concat(perm);
 
  170      return "AdaptiveVertexSet<...>";
 
  184  template<
typename AdaptiveMeshType_, 
int cell_dim_, 
int face_dim_>
 
  193    std::shared_ptr<AdaptiveMeshType> 
_mesh;
 
  215      _mesh(std::move(mesh)),
 
  275  template<
typename AdaptiveMeshType_, 
int cell_dim_, 
int face_dim_>
 
  289      std::shared_ptr<AdaptiveMeshType> _mesh;
 
  298        _mesh(std::move(mesh)),
 
  300        _domain_node(domain_node),
 
  307        return _domain_node == 
other._domain_node && _next == 
other._next && _layer == 
other._layer &&
 
  308               _mesh == 
other._mesh;
 
  313        return !(*
this == 
other);
 
  322      Index operator*()
 const 
  324        return _mesh->template get_face_index<cell_dim_, face_dim_>(_layer, _domain_node, _next);
 
  336    std::shared_ptr<AdaptiveMeshType> _mesh;
 
  339    std::optional<Adjacency::Permutation> _permutation;
 
  340    std::optional<Adjacency::Permutation> _inverse_face_permutation;
 
  384        return _mesh->template get_face_index<cell_dim_, face_dim_>(
 
  386          _permutation.value().map(i),
 
  387          _inverse_face_permutation.value().map(j)
 
  390      return _mesh->template get_face_index<cell_dim_, face_dim_>(_layer, i, j);
 
  398        return _mesh->template get_face_index<cell_dim_, face_dim_>(
 
  400          _permutation.value().map(i),
 
  401          _inverse_face_permutation.value().map(j)
 
  404      return _mesh->template get_face_index<cell_dim_, face_dim_>(_layer, i, j);
 
  419        auto tuple = 
IndexTupleType(_mesh, _layer, _permutation.value().map(i));
 
  420        tuple.permute_map(_inverse_face_permutation.value());
 
  432        auto tuple = 
IndexTupleType(_mesh, _layer, _permutation.value().map(i));
 
  433        tuple.permute_map(_inverse_face_permutation.value());
 
  444      return _mesh->get_num_entities(_layer, cell_dim_);
 
  460      return _mesh->get_num_entities(_layer, face_dim_);
 
  474        _permutation.value().concat(perm);
 
  478        _permutation = perm.
clone();
 
  482      if(_inverse_face_permutation)
 
  484        _inverse_face_permutation.value().
concat(inv_perm_face);
 
  488        _inverse_face_permutation = inv_perm_face.
clone();
 
  494      return "AdaptiveIndexSet<" + 
stringify(cell_dim_) + 
", " + 
stringify(face_dim_) + 
">";
 
  499    Index get_num_nodes_domain()
 const 
  504    Index get_num_nodes_image()
 const 
  506      return _mesh->get_num_entities(_layer, face_dim_);
 
  509    AdaptiveIndexSetAdjactor image_begin(
Index domain_node)
 const 
  511      return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node, 0);
 
  514    AdaptiveIndexSetAdjactor image_end(
Index domain_node)
 const 
  516      return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node, 
num_indices);
 
  521    typename AdaptiveMeshType_,
 
  523    int face_dim_ = Shape_::dimension - 1>
 
  527    static_assert(face_dim_ < Shape_::dimension, 
"invalid face dimension");
 
  528    static_assert(face_dim_ > 0, 
"invalid face dimension");
 
  531    using AdaptiveMeshType = AdaptiveMeshType_;
 
  533    static constexpr int cell_dim = Shape_::dimension;
 
  543    template<
int face_dim__>
 
  547    std::shared_ptr<AdaptiveMeshType> _mesh;
 
  557      _index_set(mesh, layer)
 
  569      BaseClass::clone(
other);
 
  570      _index_set = 
other._index_set;
 
  578    template<
int face_dim__>
 
  581      static_assert(face_dim__ >= 0, 
"invalid face dimension");
 
  582      static_assert(face_dim__ < Shape_::dimension, 
"invalid face dimension");
 
  587    template<
int face_dim__>
 
  590      static_assert(face_dim__ >= 0, 
"invalid face dimension");
 
  591      static_assert(face_dim__ < Shape_::dimension, 
"invalid face dimension");
 
  596    template<std::
size_t np_>
 
  598      const std::array<Adjacency::Permutation, np_>& inv_perm)
 
  600      BaseClass::permute(shape_perm, inv_perm);
 
  601      _index_set.permute(shape_perm, inv_perm.at(face_dim_));
 
  606      return "AdaptiveIndexSetWrapper<" + Shape_::name() + 
", " + 
stringify(face_dim_) + 
">";
 
  611      return BaseClass::bytes() + _index_set.
bytes();
 
  615  template<
typename AdaptiveMeshType_, 
typename Shape_>
 
  618    static_assert(Shape_::dimension > 0, 
"invalid shape dimension");
 
  621    using AdaptiveMeshType = AdaptiveMeshType_;
 
  623    static constexpr int cell_dim = Shape_::dimension;
 
  630    template<
int face_dim__>
 
  634    std::shared_ptr<AdaptiveMeshType> _mesh;
 
  643      _index_set(mesh, layer)
 
  655      _index_set = 
other._index_set;
 
  663    template<
int face_dim__>
 
  666      static_assert(face_dim__ == 0, 
"invalid face dimension");
 
  671    template<
int face_dim__>
 
  674      static_assert(face_dim__ == 0, 
"invalid face dimension");
 
  679    template<std::
size_t np_>
 
  681      const std::array<Adjacency::Permutation, np_>& inv_perm)
 
  683      _index_set.permute(shape_perm, inv_perm.at(0));
 
  688      return "AdaptiveIndexSetWrapper<" + Shape_::name() + 
",0>";
 
  691    std::size_t bytes()
 const 
  693      return _index_set.
bytes();
 
  707  template<
typename AdaptiveMeshType_, 
typename Shape_>
 
  711      typename Shape::FaceTraits<Shape_, Shape_::dimension - 1>::ShapeType>
 
  723    template<
int shape_dim_>
 
  729    std::shared_ptr<AdaptiveMeshType> _mesh;
 
  739      _index_set_wrapper(mesh, layer)
 
  751      BaseClass::clone(
other);
 
  752      _index_set_wrapper.clone(
other._index_set_wrapper);
 
  755    AdaptiveIndexSetHolder clone()
 const 
  757      return AdaptiveIndexSetHolder(_mesh, _layer);
 
  760    template<
int shape_dim_>
 
  761    AdaptiveIndexSetWrapperByShapeDim<shape_dim_>& get_index_set_wrapper()
 
  763      static_assert(shape_dim_ > 0, 
"invalid shape dimension");
 
  764      static_assert(shape_dim_ <= Shape_::dimension, 
"invalid shape dimension");
 
  766      return AdaptiveIndexSetHolder<AdaptiveMeshType, ShapeType>::_index_set_wrapper;
 
  769    template<
int shape_dim_>
 
  770    const AdaptiveIndexSetWrapperByShapeDim<shape_dim_>& get_index_set_wrapper()
 const 
  772      static_assert(shape_dim_ > 0, 
"invalid shape dimension");
 
  773      static_assert(shape_dim_ <= Shape_::dimension, 
"invalid shape dimension");
 
  775      return AdaptiveIndexSetHolder<AdaptiveMeshType, ShapeType>::_index_set_wrapper;
 
  778    template<
int cell_dim_, 
int face_dim_>
 
  779    AdaptiveIndexSet<AdaptiveMeshType, cell_dim_, face_dim_>& get_index_set()
 
  781      static_assert(cell_dim_ <= Shape_::dimension, 
"invalid cell dimension");
 
  782      static_assert(face_dim_ < cell_dim_, 
"invalid face/cell dimension");
 
  783      static_assert(face_dim_ >= 0, 
"invalid face dimension");
 
  784      return get_index_set_wrapper<cell_dim_>().template get_index_set<face_dim_>();
 
  787    template<
int cell_dim_, 
int face_dim_>
 
  788    const AdaptiveIndexSet<AdaptiveMeshType, cell_dim_, face_dim_>& get_index_set()
 const 
  790      static_assert(cell_dim_ <= Shape_::dimension, 
"invalid cell dimension");
 
  791      static_assert(face_dim_ < cell_dim_, 
"invalid face/cell dimension");
 
  792      static_assert(face_dim_ >= 0, 
"invalid face dimension");
 
  793      return get_index_set_wrapper<cell_dim_>().template get_index_set<face_dim_>();
 
  796    template<std::
size_t np_>
 
  797    void permute(
const std::array<Adjacency::Permutation, np_>& perms,
 
  798      const std::array<Adjacency::Permutation, np_>& inv_perms)
 
  800      BaseClass::permute(perms, inv_perms);
 
  801      _index_set_wrapper.permute(perms.at(Shape_::dimension), inv_perms);
 
  806      return "AdaptiveIndexSetHolder<" + Shape_::name() + 
">";
 
  809    std::size_t bytes()
 const 
  811      return BaseClass::bytes() + _index_set_wrapper.bytes();
 
  815  template<
typename AdaptiveMeshType_>
 
  839    template<std::
size_t np_>
 
  840    void permute(
const std::array<Adjacency::Permutation, np_>&,
 
  841      const std::array<Adjacency::Permutation, np_>&)
 
  847      return "AdaptiveIndexSetHolder<Vertex>";
 
  850    std::size_t bytes()
 const 
  852      return std::size_t(0);
 
  859  template<
typename AdaptiveMeshType_>
 
  863    using AdaptiveMeshType = AdaptiveMeshType_;
 
  865    std::shared_ptr<AdaptiveMeshType> _mesh;
 
  878      std::shared_ptr<AdaptiveMeshType> _mesh;
 
  885      std::optional<Adjacency::Permutation> _inverse_face_permutation = std::nullopt;
 
  889        _mesh(std::move(mesh)),
 
  891        _domain_node(domain_node),
 
  897        std::shared_ptr<AdaptiveMeshType> mesh,
 
  902        _mesh(std::move(mesh)),
 
  904        _domain_node(domain_node),
 
  906        _inverse_face_permutation(std::move(inverse_face_permutation))
 
  912        return _domain_node == 
other._domain_node && _next == 
other._next && _layer == 
other._layer &&
 
  913               _mesh == 
other._mesh;
 
  918        return !(*
this == 
other);
 
  927      Index operator*()
 const 
  929        if(_inverse_face_permutation)
 
  931          return _mesh->get_neighbor(_layer, _domain_node, _inverse_face_permutation.value().map(_next));
 
  933        return _mesh->get_neighbor(_layer, _domain_node, _next);
 
  942    std::optional<Adjacency::Permutation> _permutation;
 
  943    std::optional<Adjacency::Permutation> _inverse_face_permutation;
 
  987        return _mesh->get_neighbor(
 
  989          _permutation.value().map(i),
 
  990          _inverse_face_permutation.value().map(j)
 
  993      return _mesh->get_neighbor(_layer, i, j);
 
 1001        return _mesh->get_neighbor(
 
 1003          _permutation.value().map(i),
 
 1004          _inverse_face_permutation.value().map(j)
 
 1007      return _mesh->get_neighbor(_layer, i, j);
 
 1015      return _mesh->get_num_entities(_layer, AdaptiveMeshType::ShapeType::dimension);
 
 1031      return _mesh->get_num_entities(_layer, AdaptiveMeshType::ShapeType::dimension);
 
 1045        _permutation.value().concat(perm);
 
 1049        _permutation = perm.
clone();
 
 1053      if(_inverse_face_permutation)
 
 1055        _inverse_face_permutation.value().
concat(inv_perm_face);
 
 1059        _inverse_face_permutation = inv_perm_face.
clone();
 
 1063    static String name()
 
 1065      return "AdaptiveNeighbors";
 
 1070    Index get_num_nodes_domain()
 const 
 1075    Index get_num_nodes_image()
 const 
 1077      return _mesh->get_num_entities(_layer, AdaptiveMeshType::ShapeType::dimension);
 
 1080    AdaptiveNeighborsAdjactor image_begin(
Index domain_node)
 const 
 1084        return AdaptiveIndexSetAdjactor(_mesh, _layer, _permutation.value().map(domain_node), 0, _inverse_face_permutation.value());
 
 1086      return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node, 0);
 
 1089    AdaptiveNeighborsAdjactor image_end(
Index domain_node)
 const 
 1093        return AdaptiveIndexSetAdjactor(_mesh, _layer, _permutation.value().map(domain_node), 
num_indices, _inverse_face_permutation.value());
 
 1095      return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node, 
num_indices);
 
 1109  template<
typename AdaptiveMeshType_>
 
 1134    static constexpr int shape_dim = AdaptiveMeshType::shape_dim;
 
 1137    static constexpr int world_dim = AdaptiveMeshType::world_dim;
 
 1146    template<
int cell_dim_, 
int face_dim_>
 
 1153    std::shared_ptr<AdaptiveMeshType> _mesh;
 
 1172      _index_set_holder(_mesh, layer),
 
 1185      _mesh = 
other._mesh;
 
 1186      _layer = 
other._layer;
 
 1187      _vertex_set = 
other._vertex_set;
 
 1188      _index_set_holder = 
other._index_set_holder;
 
 1189      _permutation = 
other._permutation.clone();
 
 1192    AdaptiveMeshLayer clone()
 const 
 1194      AdaptiveMeshLayer result(_mesh, _layer);
 
 1195      result._vertex_set = _vertex_set;
 
 1196      result._index_set_holder = _index_set_holder;
 
 1197      result._permutation = _permutation;
 
 1201    std::size_t bytes()
 const 
 1203      return _vertex_set.bytes() + _index_set_holder.bytes() + _permutation.
bytes();
 
 1213      return _mesh->get_num_entities(_layer, dim);
 
 1239      return !_permutation.
empty();
 
 1247      return _permutation;
 
 1270      XASSERTM(this->_permutation.
empty(), 
"mesh is already permuted!");
 
 1273      this->_permutation.
create(strategy, this->_index_set_holder, this->_vertex_set);
 
 1279      this->_index_set_holder.permute(this->_permutation.
get_perms(), this->_permutation.get_inv_perms());
 
 1301      XASSERTM(this->_permutation.
empty(), 
"mesh is already permuted!");
 
 1304      const std::array<Index, 4> mesh_size {
 
 1310      XASSERTM(mesh_perm.validate_sizes(mesh_size.data()) == 0, 
"mesh permutation has invalid size!");
 
 1313      this->_permutation = std::forward<MeshPermutationType>(mesh_perm);
 
 1319      this->_index_set_holder.permute(this->_permutation.
get_perms(), this->_permutation.get_inv_perms());
 
 1334      if(coloring.empty())
 
 1338      const auto& verts_at_elem = this->
template get_index_set<shape_dim, 0>();
 
 1344      for(std::size_t icol(0); icol+1u < coloring.size(); ++icol)
 
 1347        const Index iel_beg = coloring[icol];
 
 1348        const Index iel_end = coloring[icol+1u];
 
 1351        for(
Index iel(iel_beg); iel < iel_end; ++iel)
 
 1354          for(
int ivt(0); ivt < verts_at_elem.num_indices; ++ivt)
 
 1357            const Index ivtx = verts_at_elem(iel, ivt);
 
 1361              if((iel_beg <= *it) && (*it < iel_end) && (*it != iel))
 
 1384      if(layering.empty())
 
 1388      const auto& verts_at_elem = this->
template get_index_set<shape_dim, 0>();
 
 1394      for(std::size_t ilay(0); ilay+1u < layering.size(); ++ilay)
 
 1397        const Index iel_beg = layering[ilay];
 
 1398        const Index iel_end = layering[ilay+1u];
 
 1401        const Index iel_lower = layering[
Math::max(ilay, std::size_t(1)) - 1u];
 
 1404        const Index iel_upper = layering[
Math::min(ilay+2u, layering.size()-1u)];
 
 1407        for(
Index iel(iel_beg); iel < iel_end; ++iel)
 
 1410          for(
int ivt(0); ivt < verts_at_elem.num_indices; ++ivt)
 
 1413            const Index ivtx = verts_at_elem(iel, ivt);
 
 1417              if(!((iel_lower <= *it) && (*it < iel_upper)))
 
 1428    void fill_neighbours()
 
 1430      _mesh->fill_neighbors();
 
 1435      return AdaptiveNeighbors(_mesh, _layer);
 
 1440      return AdaptiveNeighbors(_mesh, _layer);
 
 1465    template<
int cell_dim_, 
int face_dim_>
 
 1468      return _index_set_holder.template get_index_set<cell_dim_, face_dim_>();
 
 1477    template<
int cell_dim_, 
int face_dim_>
 
 1480      return _index_set_holder.template get_index_set<cell_dim_, face_dim_>();
 
 1488      return _index_set_holder;
 
 1496      return _index_set_holder;
 
 1501      return _index_set_holder;
 
 1506      return _index_set_holder;
 
 1523      return _mesh->template get_child<ShapeType::dimension>(_layer, elem, child);
 
 1533      return _mesh->template get_num_children<ShapeType::dimension>(_layer, elem);
 
 1538      return "AdaptiveMeshLayer<...>";
 
 1548      return _mesh->has_vertex_changed(_layer, vertex_idx);
 
 1554      return _mesh->foundation_mesh();
 
 1569  template<
typename AdaptiveMeshLayerType>
 
 1585        return _coarse.get_child(_cell, _child).value_or(0);
 
 1596        return _cell != 
other._cell || _child != 
other._child;
 
 1600      static constexpr int dim = AdaptiveMeshLayerType::ShapeType::dimension;
 
 1602      AdaptiveMeshLayerType& _coarse;
 
 1611    AdaptiveMeshLayerType& _coarse;
 
 1612    AdaptiveMeshLayerType& _fine;
 
 1615    AdaptiveChildMapping(AdaptiveMeshLayerType& coarse, AdaptiveMeshLayerType& fine) : _coarse(coarse), _fine(fine)
 
 1619    Index get_num_nodes_domain()
 const 
 1621      return _coarse.get_num_elements();
 
 1624    Index get_num_nodes_image()
 const 
 1626      return _fine.get_num_elements();
 
 1629    ChildCellIterator image_begin(
Index domain_node)
 const 
 1631      return ChildCellIterator(_coarse, domain_node, 0);
 
 1634    ChildCellIterator image_end(
Index domain_node)
 const 
 1636      Index num_children = _coarse.get_num_children(domain_node);
 
 1637      return ChildCellIterator(_coarse, domain_node, num_children);
 
#define ASSERT(expr)
Debug-Assertion macro definition.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Adjacency Graph implementation.
ImageIterator image_begin(Index domain_node) const
Returns an iterator for the first adjacent image node.
ImageIterator image_end(Index domain_node) const
Returns an iterator for the first position past the last adjacent image node.
void concat(const Permutation &p)
concatenates two permutations
Permutation inverse() const
Computes the inverse permutation.
Permutation clone() const
Clones this permutation.
Adjactor for iterating over children of adaptive mesh elements.
Adjactor for AdaptiveIndexSet.
IndexSetHolder interface for adaptive meshes.
AdaptiveMeshType_ AdaptiveMeshType
Type of underlying mesh.
IndexSet interface for adaptive meshes.
std::size_t bytes() const
Returns the size of dynamically allocated memory in bytes.
Index operator()(Index i, int j) const
access operator
Index operator()(Index i, int j)
access operator
AdaptiveIndexSet clone() const
Returns a clone of this index set.
IndexTupleType operator[](Index i)
Returns an adaptive index tuple.
Index get_num_entities() const
Returns the number of entities.
int get_num_indices() const
Returns the number of indices per entity.
AdaptiveIndexSet(std::shared_ptr< AdaptiveMeshType > mesh, Layer layer)
Constructor.
AdaptiveIndexTuple< AdaptiveMeshType, cell_dim_, face_dim_ > IndexTupleType
Tuple type.
Index get_index_bound() const
Returns the maximum index of any face returned by this index set.
IndexTupleType operator[](Index i) const
Returns an adaptive index tuple.
static constexpr int num_indices
Number of indices per entry.
AdaptiveMeshType_ AdaptiveMeshType
Type of underlying mesh.
IndexTuple interface for adaptive meshes.
Index operator[](int idx) const
access operator
AdaptiveMeshType_ AdaptiveMeshType
Type of underlying adaptive mesh.
static constexpr int num_indices
Number of indices per tuple.
AdaptiveIndexTuple(std::shared_ptr< AdaptiveMeshType > mesh, Layer layer, Index entity_idx)
Constructor.
void permute_map(const Adjacency::Permutation &inv_perm)
Permute this index tuple.
std::shared_ptr< AdaptiveMeshType > _mesh
Pointer to underlying mesh.
std::optional< Adjacency::Permutation > _inv_perm
Permutation of this tuple.
Layer _layer
Layer this tuple refers to.
Index _entity_idx
Index of entity this tuple refers to.
ConformalMesh interface for adaptive meshes.
const MeshPermutation< ShapeType > & get_mesh_permutation() const
Returns the permutation applied to the mesh.
auto & get_index_set()
Returns a reference to an index set of this mesh.
AdaptiveMeshType::FoundationMeshType & foundation_mesh()
accessor for foundation mesh
AdaptiveMeshLayer(std::shared_ptr< AdaptiveMeshType > mesh, Layer layer)
Constructor.
static constexpr int world_dim
World dimension.
bool validate_element_layering() const
Validates the element layering.
AdaptiveMeshType & adaptive_mesh()
accessor for adaptive mesh
typename AdaptiveMeshType::ShapeType ShapeType
Shape type.
VertexSetType & get_vertex_set()
Returns the vertex set of this mesh.
typename AdaptiveMeshType::VertexType VertexType
Vertex type.
Index get_num_children(Index elem)
Returns the number of children of mesh a mesh element.
const VertexSetType & get_vertex_set() const
Returns the vertex set of this mesh.
bool validate_element_coloring() const
Validates the element coloring.
Index get_num_elements() const
Returns the number of elements (highest dimension entities) in the mesh.
Index get_num_vertices() const
Returns the number of vertices in the mesh.
const auto & get_index_set() const
Returns a reference to an index set of this mesh.
bool has_vertex_changed(Index vertex_idx) const
Indicates whether any mesh element adjacent to the given vertex has changed on the given layer.
std::optional< Index > get_child(Index elem, Index child)
Retrieve index of a child element.
static constexpr bool is_structured
This is an unstructured mesh.
AdaptiveMeshType_ AdaptiveMeshType
Type of underlying mesh.
void set_permutation(MeshPermutationType &&mesh_perm)
Sets a custom mesh permutation for this mesh.
static constexpr int shape_dim
Shape dimension.
IndexSetHolderType & get_index_set_holder()
Returns a reference to the index set holder of this mesh.
const IndexSetHolderType & get_index_set_holder() const
Returns a reference to the index set holder of this mesh.
AdaptiveIndexSetHolder< AdaptiveMeshType, ShapeType > IndexSetHolderType
IndexSetHolder type.
Index get_num_entities(int dim) const
Returns the number of entities of dimension dim in the mesh.
AdaptiveNeighbors< AdaptiveMeshType > AdaptiveNeighborsType
Type of neighbors wrapper.
bool is_permuted() const
Checks whether the mesh is permuted.
void create_permutation(PermutationStrategy strategy)
Creates a mesh permutation based on one of the standard permutation strategies.
Adjactor for AdaptiveIndexSet.
Gives access to neighbor information on a mesh layer.
Index operator()(Index i, int j)
access operator
static constexpr int num_indices
Number of indices per entry.
Index get_index_bound() const
Returns the maximum index of any face returned by this index set.
std::size_t bytes() const
Returns the size of dynamically allocated memory in bytes.
AdaptiveNeighbors clone() const
Returns a clone of this index set.
int get_num_indices() const
Returns the number of indices per entity.
AdaptiveNeighbors(std::shared_ptr< AdaptiveMeshType > mesh, Layer layer)
Constructor.
Index operator()(Index i, int j) const
access operator
Index get_num_entities() const
Returns the number of entities.
VertexSet interface for adaptive meshes.
void permute(const Adjacency::Permutation &perm, bool invert=false)
Permutes this vertex set.
AdaptiveMeshType_ AdaptiveMeshType
Type of underlying adaptive mesh.
AdaptiveVertexSet(std::shared_ptr< AdaptiveMeshType > mesh, Layer layer)
Constructor.
int get_num_coords() const
Returns the number of coordinates per vertex.
VertexType & operator[](Index idx)
Returns a reference to a vertex.
typename AdaptiveMeshType::VertexType VertexType
Vertex type.
typename AdaptiveMeshType::CoordType CoordType
Type of single vertex coordinate.
Index get_num_vertices() const
Returns the number of vertices in the vertex set.
AdaptiveVertexSet clone() const
Returns a clone of this vertex set.
std::shared_ptr< AdaptiveMeshType > _mesh
Underlying adaptive mesh.
static constexpr int num_coords
Number of coordinates per vertex.
const VertexType & operator[](Index idx) const
Returns a reference to a vertex.
std::size_t bytes() const
const std::vector< Index > & get_element_layering() const
Returns a const reference to the element layering vector.
const PermArray & get_perms() const
bool empty() const
Checks whether this permutation is empty.
const std::vector< Index > & get_element_coloring() const
Returns a const reference to the element coloring vector.
void create(PermutationStrategy strategy, const IndexSetHolder< Shape_ > &ish, const VertexSet< num_coords_, Coord_ > &vtx)
Creates a mesh permutation for a conformal mesh.
const Adjacency::Permutation & get_perm(int dim=shape_dim) const
Returns a const reference to a (forward) permutation.
String class implementation.
@ transpose
Render-Transpose mode.
PermutationStrategy
Mesh permutation strategy enumeration.
@ other
generic/other permutation strategy
T_ min(T_ a, T_ b)
Returns the minimum of two values.
T_ max(T_ a, T_ b)
Returns the maximum of two values.
static constexpr bool operator*(TrafoTags a)
bool conversion operator
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.
Used for return type of get_index_set.
Newtype wrapper for mesh layers.
Face traits tag struct template.
typedef ShapeType
Shape type of the face.