8#include "kernel/util/string.hpp" 
    9#include "kernel/util/tiny_algebra.hpp" 
   10#include <kernel/shape.hpp> 
   12#include <kernel/util/slotmap.hpp> 
   18namespace FEAT::Geometry::Intern
 
   49  inline bool operator<(Layer lhs, Layer rhs)
 
   51    return lhs.idx < rhs.idx;
 
   54  inline bool operator>(Layer lhs, Layer rhs)
 
   56    return lhs.idx > rhs.idx;
 
   59  inline bool operator<=(Layer lhs, Layer rhs)
 
   61    return lhs.idx <= rhs.idx;
 
   64  inline bool operator>=(Layer lhs, Layer rhs)
 
   66    return lhs.idx >= rhs.idx;
 
  125  inline bool operator!=(
const ElementKey<dim_>& lhs, 
const ElementKey<dim_>& rhs)
 
  127    return !(lhs == rhs);
 
  131  inline std::ostream& operator<<(std::ostream& stream, 
const ElementKey<dim_> key)
 
  136      << 
", generation = " << 
stringify(key.generation)
 
  137      << 
", layer = Layer {" << 
stringify(key.layer.idx)
 
  138      << 
"}, is_permanent = " << 
stringify(key.is_permanent) << 
" }";
 
  142  using VertexKey = ElementKey<0>;
 
  143  using EdgeKey = ElementKey<1>;
 
  144  using FaceKey = ElementKey<2>;
 
  145  using CellKey = ElementKey<3>;
 
  170    return lhs.key == rhs.key && lhs.orientation == rhs.orientation;
 
  174  inline bool operator!=(
const OrientedElement<dim_>& lhs, 
const OrientedElement<dim_>& rhs)
 
  176    return !(lhs == rhs);
 
  193  template<
typename TemplateSet_, 
typename Shape_, 
int dim_ = Shape_::dimension>
 
  197    static constexpr int max_children = TemplateSet_::template max_children<Shape_::dimension, dim_>();
 
  202    template<
int query_dim_>
 
  203    std::array<ElementKey<query_dim_>, TemplateSet_::template max_children<Shape_::dimension, query_dim_>()>& by_dim()
 
  205      static_assert(query_dim_ <= Shape_::dimension);
 
  210    template<
int query_dim_>
 
  211    const std::array<ElementKey<query_dim_>, TemplateSet_::template max_children<Shape_::dimension, query_dim_>()>& by_dim()
 const 
  213      static_assert(query_dim_ <= Shape_::dimension);
 
  235  template<
typename TemplateSet_, 
typename Shape_>
 
  239    static constexpr int max_children = TemplateSet_::template max_children<Shape_::dimension, 0>();
 
  244    template<
int query_dim_>
 
  245    std::array<ElementKey<query_dim_>, TemplateSet_::template max_children<Shape_::dimension, query_dim_>()>& by_dim()
 
  247      static_assert(query_dim_ == 0);
 
  252    template<
int query_dim_>
 
  253    const std::array<ElementKey<query_dim_>, TemplateSet_::template max_children<Shape_::dimension, query_dim_>()>& by_dim()
 const 
  255      static_assert(query_dim_ == 0);
 
  269  template<
typename Shape_, 
int dim_ = Shape_::dimension - 1>
 
  272    static_assert(dim_ >= 0);
 
  280    template<
int key_dim_>
 
  283      static_assert(key_dim_ < Shape_::dimension);
 
  289    template<
int query_dim_>
 
  292      static_assert(query_dim_ < Shape_::dimension);
 
  297    template<
int query_dim_>
 
  300      static_assert(query_dim_ < Shape_::dimension);
 
  305    template<
int query_dim_>
 
  308      static_assert(query_dim_ <= Shape_::dimension);
 
  314  template<
typename Shape_>
 
  323    template<
int key_dim_>
 
  326      static_assert(key_dim_ == 0);
 
  332    template<
int query_dim_>
 
  335      static_assert(query_dim_ == 0);
 
  340    template<
int query_dim_>
 
  343      static_assert(query_dim_ == 0);
 
  348    template<
int query_dim_>
 
  351      static_assert(query_dim_ == 0);
 
  364  template<
typename TemplateSet_, 
typename Shape_>
 
  367    static_assert(Shape_::dimension > 0);
 
  369    using TemplateSet = TemplateSet_;
 
  371    using RefinementType = 
typename TemplateSet::template RefinementTypeByDim<Shape_::dimension>;
 
  398    static constexpr int num_neighbors = 
Shape::FaceTraits<Shape_, Shape_::dimension - 1>::count;
 
  399    std::array<Intern::ElementKey<Shape_::dimension>, num_neighbors> neighbors;
 
  409  template<
typename VertexType>
 
  445  template<
typename TemplateSet_, 
typename MeshShape_, 
typename VertexType_, 
int element_dim_ = MeshShape_::dimension>
 
  474    template<
typename Shape_>
 
  478      key.is_permanent = 
true;
 
  491    template<
typename Shape_>
 
  495      key.is_permanent = 
false;
 
  507      if constexpr(dim_ == 0)
 
  533      if constexpr(dim_ == 0)
 
  552      if constexpr(dim_ == 0)
 
  612      static_assert(dim_ >= 1);
 
  633      static_assert(dim_ >= 1);
 
  657  template<
typename TemplateSet_, 
typename MeshShape_, 
typename VertexType_>
 
  658  class MeshLayer<TemplateSet_, MeshShape_, VertexType_, 0>
 
  672      return _vertices.
insert(vertex);
 
  682      _vertices.
erase(key);
 
  690      return _vertices.
size();
 
  710      return _vertices.bytes();
 
  718      return _vertices[key];
 
  726      return _vertices[key];
 
  749  template<
typename MeshShape_, 
typename TemplateSet_, 
typename VertexType_>
 
  756    using CoordType = 
typename VertexType_::ValueType;
 
  797    static constexpr int num_coords = VertexType::n;
 
  823      return (*
this)[key].type;
 
  846      std::array<Index, 4> num_erased = {};
 
  847      if constexpr(dim_ > 0)
 
  852        auto& entity = (*this)[key];
 
  854          _erase_children<typename Shape::FaceTraits<MeshShape_, dim_>::ShapeType, dim_>(entity.type, entity.children);
 
  859      num_erased[dim_] += 1;
 
  908    template<
typename Shape_>
 
  923      bool is_permanent = element.
type.is_zero_refinement();
 
  927        key = 
_layers[layer.
idx].insert_permanent(element);
 
  931        key = 
_layers[layer.
idx].insert_transient(element);
 
  970    template<
typename VisitorType_, 
int dim_>
 
  973      VisitorType_& visitor,
 
  977      auto& root = (*this)[root_key];
 
  980      if(root.layer > max_depth)
 
  986      if(order == IterationOrder::PreOrder)
 
  991      if constexpr(dim_ > 0)
 
  993        _walk_subtree_children<typename Shape::FaceTraits<MeshShape_, dim_>::ShapeType>(root, visitor, max_depth);
 
  997      if(order == IterationOrder::PostOrder)
 
 1018    template<
typename VisitorType_>
 
 1029      if constexpr(MeshShape_::dimension >= 0)
 
 1031        for(
auto entry : root_layer.vertices())
 
 1037      if constexpr(MeshShape_::dimension >= 1)
 
 1039        for(
auto entry : root_layer.template permanent_entities<1>())
 
 1043        for(
auto entry : root_layer.template transient_entities<1>())
 
 1049      if constexpr(MeshShape_::dimension >= 2)
 
 1051        for(
auto entry : root_layer.template permanent_entities<2>())
 
 1055        for(
auto entry : root_layer.template transient_entities<2>())
 
 1061      if constexpr(MeshShape_::dimension >= 3)
 
 1063        for(
auto entry : root_layer.template permanent_entities<3>())
 
 1067        for(
auto entry : root_layer.template transient_entities<3>())
 
 1086        return _num_entities<0>(layer);
 
 1090        return _num_entities<1>(layer);
 
 1094        return _num_entities<2>(layer);
 
 1098        return _num_entities<3>(layer);
 
 1100      XABORTM(
"unsupported dimension in MeshStorage::num_entities");
 
 1116        result += layer.template num_permanent_entities<dim_>();
 
 1117        result += layer.template num_transient_entities<dim_>();
 
 1128      static constexpr int shape_dim = MeshShape_::dimension;
 
 1129      static constexpr int num_facets = 
Shape::FaceTraits<MeshShape_, shape_dim - 1>::count;
 
 1160      auto determine_facet_neighbors = [&](
Layer layer, 
auto slotmap_entry)
 
 1163        for(
int facet_idx = 0; facet_idx < num_facets; facet_idx++)
 
 1166          auto key = slotmap_entry.value.topology.template key_by_dim<shape_dim - 1>(facet_idx).key;
 
 1169          if(!facet_neighbors.contains_key(key))
 
 1174          auto& neighbors = facet_neighbors[key];
 
 1185          element_key.
layer = layer;
 
 1186          element_key.
is_permanent = slotmap_entry.value.type.is_zero_refinement();
 
 1190            neighbors[0] = element_key;
 
 1194            neighbors[1] = element_key;
 
 1198            XABORTM(
"Facet has more than two neighbors!");
 
 1204      auto determine_neighbors = [&](
Layer layer, 
auto slotmap_entry)
 
 1206        auto& element = slotmap_entry.value;
 
 1209        for(
int facet_idx = 0; facet_idx < num_facets; facet_idx++)
 
 1212          auto key = slotmap_entry.value.topology.template key_by_dim<shape_dim - 1>(facet_idx).key;
 
 1223          element_key.
layer = layer;
 
 1224          element_key.is_permanent = slotmap_entry.value.type.is_zero_refinement();
 
 1227          auto& candidates = facet_neighbors[key];
 
 1228          if(candidates[0] == element_key)
 
 1230            element.neighbors[facet_idx] = candidates[1];
 
 1232          else if(candidates[1] == element_key)
 
 1234            element.neighbors[facet_idx] = candidates[0];
 
 1242        for(
auto entry : 
_layers[i].
template permanent_entities<shape_dim>())
 
 1244          determine_facet_neighbors(
Layer{i}, entry);
 
 1246        for(
auto entry : 
_layers[i].
template transient_entities<shape_dim>())
 
 1248          determine_facet_neighbors(
Layer{i}, entry);
 
 1254        for(
auto entry : 
_layers[i].
template permanent_entities<shape_dim>())
 
 1256          determine_neighbors(
Layer{i}, entry);
 
 1258        for(
auto entry : 
_layers[i].
template transient_entities<shape_dim>())
 
 1260          determine_neighbors(
Layer{i}, entry);
 
 1304        for(
auto entry : layer.vertices())
 
 1306          entry.value.set_mat_vec_mul(rot, entry.value - origin) += offset;
 
 1334      Index next_vertex_index = 0;
 
 1335      Index next_edge_index = 0;
 
 1336      Index next_face_index = 0;
 
 1337      Index next_cell_index = 0;
 
 1341        if constexpr(MeshShape_::dimension >= 0)
 
 1345          for(
auto entry : layer.vertices())
 
 1347            entry.value.index = next_vertex_index++;
 
 1351        if constexpr(MeshShape_::dimension >= 1)
 
 1353          _index_layer<1>(layer, next_edge_index);
 
 1356        if constexpr(MeshShape_::dimension >= 2)
 
 1358          _index_layer<2>(layer, next_face_index);
 
 1361        if constexpr(MeshShape_::dimension >= 3)
 
 1363          _index_layer<3>(layer, next_cell_index);
 
 1387      ASSERTM(layer.
idx < 
_layers.size(), 
"Trying to retrieve vertex of non-existing mesh layer!");
 
 1404      for(
Index layer_idx = 0; layer_idx <= layer.
idx; layer_idx++)
 
 1408        if(idx < current_layer.num_vertices())
 
 1410          return current_layer.vertices().data()[idx];
 
 1412        idx -= current_layer.num_vertices();
 
 1415      XABORTM(
"Tried retrieving non-existent vertex index from AdaptiveMeshStorage!");
 
 1433      return const_cast<AdaptiveVertexType&
>(std::as_const(*this).get_vertex_by_index(layer, idx));
 
 1450      ASSERTM(layer.
idx < 
_layers.size(), 
"Trying to retrieve entity of non-existing mesh layer!");
 
 1459      for(
Index layer_idx = 0; layer_idx <= layer.
idx; layer_idx++)
 
 1463        if(idx < current_layer.template num_permanent_entities<dim_>())
 
 1465          return current_layer.template permanent_entities<dim_>().data()[idx];
 
 1467        idx -= current_layer.template num_permanent_entities<dim_>();
 
 1471      if(idx < current_layer.template num_transient_entities<dim_>())
 
 1473        return current_layer.template transient_entities<dim_>().data()[idx];
 
 1476      XABORTM(
"Trying to retrieve non-exisiting element from AdaptiveMeshStorage");
 
 1506      static constexpr int shape_dim = MeshShape_::dimension;
 
 1510      auto& element = get_by_index<shape_dim>(layer, element_idx);
 
 1513        return get_index(element.neighbors[neighbor_idx]);
 
 1534      return (*
this)[key].index;
 
 1549      return (*
this)[oriented_key.key].index;
 
 1584      return (*
this)[ref.key];
 
 1589      return (*
this)[ref.key];
 
 1596      return (*
this)[ref.key];
 
 1602      return (*
this)[ref.key];
 
 1610      std::size_t total = 0;
 
 1613        total += layer.bytes();
 
 1630      if constexpr(dim_ > MeshShape_::dimension)
 
 1639        for(
Index layer_idx = 0; layer_idx <= layer.
idx; layer_idx++)
 
 1641          result += 
_layers[layer_idx].template num_permanent_entities<dim_>();
 
 1643        result += 
_layers[layer.
idx].template num_transient_entities<dim_>();
 
 1649    template<
typename Shape_, 
int dim_ = Shape_::dimension>
 
 1650    std::array<Index, 4> _erase_children(
 
 1651        typename TemplateSet::template RefinementTypeByDim<Shape_::dimension> 
type,
 
 1654      if constexpr(dim_ >= 0)
 
 1656        auto result = _erase_children<Shape_, dim_ - 1>(
type, children);
 
 1658        auto& array = children.template by_dim<dim_>();
 
 1659        for(
Index i(0); i < TemplateSet::template num_children<Shape_::dimension, dim_>(
type); i++)
 
 1661          std::array<Index, 4> num_erased = 
erase(array[i]);
 
 1663          result[0] += num_erased[0];
 
 1664          result[1] += num_erased[1];
 
 1665          result[2] += num_erased[2];
 
 1666          result[3] += num_erased[3];
 
 1677    template<
typename Shape_, 
int dim_ = Shape_::dimension, 
typename VisitorType>
 
 1678    void _walk_subtree_children(
const AdaptiveElement<TemplateSet, Shape_>& root, VisitorType& visitor, Layer max_depth)
 const 
 1680      if constexpr(dim_ >= 0)
 
 1682        _walk_subtree_children<Shape_, dim_ - 1>(root, visitor, max_depth);
 
 1684        const auto& children = root.
children.template by_dim<dim_>();
 
 1685        for(
Index i = 0; i < TemplateSet::template num_children<Shape_::dimension, dim_>(root.type); i++)
 
 1701      while(
_layers.size() <= new_top_layer)
 
 1719      for(
auto entry : layer.template permanent_entities<dim_>())
 
 1721        entry.value.index = next_permanent_index++;
 
 1725      Index next_transient_index = next_permanent_index;
 
 1731      for(
auto entry : layer.template transient_entities<dim_>())
 
 1733        entry.value.index = next_transient_index++;
 
 1740    template<
int sm_, 
int sn_, 
int sv_>
 
 1751    template<
int sm_, 
int sn_, 
int sv_>
 
 1762    template<
int sm_, 
int sn_, 
int sv_>
 
#define ASSERT(expr)
Debug-Assertion macro definition.
#define XABORTM(msg)
Abortion macro definition with custom message.
#define ASSERTM(expr, msg)
Debug-Assertion macro definition with custom message.
Storage class for AdaptiveMeshes.
VertexKey insert(const AdaptiveVertexType &vertex)
Insert a vertex into the storage.
void fill_neighbors()
Determines neighboring elements for all mesh elements.
void _index_layer(MeshLayerType &layer, Index &next_permanent_index)
Assigns indexes to all elemens of a layer.
ElementKey< Shape_::dimension > insert(const AdaptiveElement< TemplateSet, Shape_ > &element)
Insert an adaptive element into the storage.
AdaptiveElementByDim< dim_ > & operator[](ElementKey< dim_ > key)
Retrieve element by key.
VertexKey insert(VertexType vertex, Layer layer)
Insert a vertex into the storage.
VertexType_ VertexType
Type of vertices in this mesh.
Index num_total_entities() const
Returns the total number of all mesh elements in the storage.
static void _aux_rot_mat(Tiny::Matrix< CoordType, 3, 3, sm_, sn_ > &r, const Tiny::Vector< CoordType, 3, sv_ > &a)
Helper for transform method.
void transform(const VertexType &origin, const VertexType &angles, const VertexType &offset)
Applies a "proper rigid" transformation onto the mesh vertices.
AdaptiveElementByDim< dim_ > & operator[](OrientedElement< dim_ > ref)
Retrieve element by oriented reference.
AdaptiveElementByDim< dim_ > & get_by_index(Layer layer, Index idx)
Retrieves an element of the mesh by its layer and index.
const AdaptiveVertexType & get_vertex_by_index(Layer layer, Index idx) const
Retrieves a vertex of the mesh by its layer and index.
static void _aux_rot_mat(Tiny::Matrix< CoordType, 2, 2, sm_, sn_ > &r, const Tiny::Vector< CoordType, 2, sv_ > &a)
Helper for transform method.
Index num_entities(Layer layer, int dim) const
Returns the number of mesh elements of the given dimension on the given layer.
std::size_t bytes() const
Returns the number of bytes used by this class.
AdaptiveVertexType & operator[](VertexKey key)
Retrieve vertex by key.
static void _aux_rot_mat(Tiny::Matrix< CoordType, 1, 1, sm_, sn_ > &r, const Tiny::Vector< CoordType, 1, sv_ > &)
Helper for transform method.
Index get_neighbor(Layer layer, Index element_idx, Index neighbor_idx) const
Returns the index of the n-th neighbor of the given element.
void walk_tree(VisitorType_ &visitor, Layer max_depth, IterationOrder order=IterationOrder::PreOrder) const
Index get_index(OrientedElement< dim_ > oriented_key) const
Get the numeric mesh index of the element pointed to by key.
void _add_mesh_layers(Index new_top_layer)
Adds additional mesh layers, such that.
void reindex()
Re-indexes the storage.
const AdaptiveElementByDim< dim_ > & operator[](ElementKey< dim_ > key) const
Retrieve element by key.
static const constexpr ElementKey< MeshShape_::dimension > neighbor_sentinel
Sentinel key for non-existing neighbors, e.g. for boundary elements.
const AdaptiveElementByDim< dim_ > & get_by_index(Layer layer, Index idx) const
Retrieves an element of the mesh by its layer and index.
Index _num_entities(Layer layer) const
Returns the number of mesh elements of the given dimension on the given layer.
Index num_layers() const
Return the number of layers in this mesh.
bool _is_indexed
Indicates whether this mesh has been indexed since the last modification.
TemplateSet_ TemplateSet
Template set to be used for refinement.
std::vector< MeshLayerType > _layers
List of MeshLayers for this mesh.
bool _has_neighbors
Indicates whether neighbors have been calculated for this mesh.
AdaptiveVertex< VertexType > AdaptiveVertexType
Adaptive vertex type.
TemplateSet::template RefinementTypeByDim< dim > type(ElementKey< dim > key)
Get refinement type of element.
void walk_subtree(ElementKey< dim_ > root_key, VisitorType_ &visitor, Layer max_depth, IterationOrder order=IterationOrder::PreOrder) const
const AdaptiveVertexType & operator[](VertexKey key) const
Retrieve vertex by key.
AdaptiveVertexType & get_vertex_by_index(Layer layer, Index idx)
Retrieves a vertex of the mesh by its layer and index.
std::array< Index, 4 > erase(ElementKey< dim_ > key)
Erases an element and all its children from the storage.
Index get_index(ElementKey< dim_ > key) const
Get the numeric mesh index of the element pointed to by key.
void erase(ElementKey< 0 > key)
Erase a vertex from this layer.
Util::SlotMap< AdaptiveVertex< VertexType_ >, ElementKey< 0 > > _vertices
SlotMap for this layers vertices.
ElementKey< 0 > insert_vertex(const AdaptiveVertex< VertexType_ > &vertex)
Insert a vertex into this layer.
AdaptiveVertex< VertexType_ > & get_vertex(ElementKey< 0 > key)
Retrieve a reference to the AdaptiveVertex pointed to by key.
Util::SlotMap< AdaptiveVertex< VertexType_ >, ElementKey< 0 > > & vertices()
Vertex SlotMap accessor.
const Util::SlotMap< AdaptiveVertex< VertexType_ >, ElementKey< 0 > > & vertices() const
Vertex SlotMap accessor.
const AdaptiveVertex< VertexType_ > & get_vertex(ElementKey< 0 > key) const
Retrieve a reference to the AdaptiveVertex pointed to by key.
Index num_vertices() const
Returns the number of vertices in this layer.
std::size_t bytes() const
Returns the number of bytes used by this layer.
Storage class for a single layer of the adaptive mesh.
Util::SlotMap< AdaptiveElementType, ElementKeyType > _permanent_entities
Slotmap for permanent mesh elements.
Index num_permanent_entities() const
Get number of permanent entities of dimension dim_ in this layer.
Index num_transient_entities() const
Get number of transient entities of dimension dim_ in this layer.
ElementKey< Shape_::dimension > insert_transient(const AdaptiveElement< TemplateSet_, Shape_ > &element)
Insert a transient element into this layer.
std::size_t bytes() const
Returns number of bytes used by this layer.
AdaptiveElement< TemplateSet_, typename Shape::FaceTraits< MeshShape_, dim_ >::ShapeType > & get(ElementKey< dim_ > key)
Retrieve the AdaptiveElement belonging to the given key.
const AdaptiveElement< TemplateSet_, typename Shape::FaceTraits< MeshShape_, dim_ >::ShapeType > & get(ElementKey< dim_ > key) const
Retrieve the AdaptiveElement belonging to the given key.
typename Shape::FaceTraits< MeshShape_, element_dim_ >::ShapeType ShapeType
Shape type of entities stored in this layer of dimension element_dim_.
const Util::SlotMap< AdaptiveElement< TemplateSet_, typename Shape::FaceTraits< MeshShape_, dim_ >::ShapeType >, ElementKey< dim_ > > & transient_entities() const
Transient element SlotMap accessor.
void erase(ElementKey< dim_ > key)
Erase an element from this layer.
Util::SlotMap< AdaptiveElement< TemplateSet_, typename Shape::FaceTraits< MeshShape_, dim_ >::ShapeType >, ElementKey< dim_ > > & permanent_entities()
Permanent element SlotMap accessor.
Util::SlotMap< AdaptiveElementType, ElementKeyType > _transient_entities
Slotmap for transient mesh elements.
ElementKey< Shape_::dimension > insert_permanent(const AdaptiveElement< TemplateSet_, Shape_ > &element)
Insert a permanent element into this layer.
const Util::SlotMap< AdaptiveElement< TemplateSet_, typename Shape::FaceTraits< MeshShape_, dim_ >::ShapeType >, ElementKey< dim_ > > & permanent_entities() const
Permanent element SlotMap accessor.
Util::SlotMap< AdaptiveElement< TemplateSet_, typename Shape::FaceTraits< MeshShape_, dim_ >::ShapeType >, ElementKey< dim_ > > & transient_entities()
Transient element SlotMap accessor.
Tiny Matrix class template.
CUDA_HOST_DEVICE Matrix & set_rotation_3d(T_ yaw, T_ pitch, T_ roll)
Sets this matrix to a 3D yaw-pitch-roll rotation matrix.
CUDA_HOST_DEVICE Matrix & set_rotation_2d(T_ angle)
Sets this matrix to a 2D rotation matrix.
CUDA_HOST_DEVICE Matrix & set_identity()
Sets this matrix to the identity matrix.
Tiny Vector class template.
High-performance associative container.
Key insert(V &&value)
Insert value into the SlotMap.
void erase(const Key &key)
Remove a key from the SlotMap.
Index size() const
Retrieve current size of the SlotMap.
@ other
generic/other permutation strategy
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.
Layer layer
The elements layer.
Index index
The elements mesh index.
ElementChildren< TemplateSet_, Shape_ > children
Child element references.
RefinementType type
The elements refinement type.
ElementTopology< Shape_ > topology
Surrounding element references.
VertexType vertex
Vertex coordinates.
Layer last_changed
Depth the vertex was last used as a parent vertex.
Index index
This elements index in the mesh layers it is a part of.
Layer layer
This elements depth in the refinement tree.
std::array< Intern::ElementKey< 0 >, max_children > children
Children of dimension 0.
Children of a mesh element.
static constexpr int max_children
Maximum number of children of dimension dim_.
std::array< Intern::ElementKey< dim_ >, max_children > children
Children of dimension dim_.
SlotMap key for use by the AdaptiveMeshStorage class.
Layer layer
Element Layer.
std::uint32_t index
Index into the SlotMaps' slots. See SlotMapKey for details.
std::uint32_t generation
Generation of this key. See SlotMapKey for details.
bool is_permanent
Element Kind.
std::array< OrientedElement< 0 >, num_entities > entities
Surrounding entities at dimension dim_.
Surrounding elements of a mesh element.
static constexpr int num_entities
Number of surrounding elements at dimension dim_.
std::array< OrientedElement< dim_ >, num_entities > entities
Surrounding entities at dimension dim_.
Newtype wrapper for mesh layers.
Index idx
Index of the layer.
Orientation-aware reference to another mesh element.
Face traits tag struct template.