8#include "kernel/geometry/common_factories.hpp"
9#include "kernel/geometry/mesh_permutation.hpp"
10#include "kernel/shape.hpp"
11#include "kernel/util/string.hpp"
13#include <kernel/adjacency/permutation.hpp>
15#include <kernel/geometry/adaptive_mesh.hpp>
16#include <kernel/util/tiny_algebra.hpp>
35 template<
typename AdaptiveMeshType_>
43 static constexpr int num_coords = AdaptiveMeshType::world_dim;
46 using CoordType =
typename AdaptiveMeshType::CoordType;
49 using VertexType =
typename AdaptiveMeshType::VertexType;
53 std::shared_ptr<AdaptiveMeshType>
_mesh;
63 std::optional<Adjacency::Permutation> _perm;
88 std::size_t bytes()
const
107 return _mesh->get_num_entities(_layer, 0);
121 return _mesh->vertex(_layer, _perm.value().map(idx));
123 return _mesh->vertex(_layer, idx);
131 return _mesh->vertex(_layer, _perm.value().map(idx));
133 return _mesh->vertex(_layer, idx);
155 _perm = std::optional{invert ? perm.
inverse() : perm.
clone()};
165 _perm.value().concat(perm);
172 return "AdaptiveVertexSet<...>";
186 template<
typename AdaptiveMeshType_,
int cell_dim_,
int face_dim_>
195 std::shared_ptr<AdaptiveMeshType>
_mesh;
217 _mesh(std::move(mesh)),
277 template<
typename AdaptiveMeshType_,
int cell_dim_,
int face_dim_>
291 std::shared_ptr<AdaptiveMeshType> _mesh;
300 _mesh(std::move(mesh)),
302 _domain_node(domain_node),
309 return _domain_node ==
other._domain_node && _next ==
other._next && _layer ==
other._layer &&
310 _mesh ==
other._mesh;
315 return !(*
this ==
other);
324 Index operator*()
const
326 return _mesh->template get_face_index<cell_dim_, face_dim_>(_layer, _domain_node, _next);
338 std::shared_ptr<AdaptiveMeshType> _mesh;
341 std::optional<Adjacency::Permutation> _permutation;
342 std::optional<Adjacency::Permutation> _inverse_face_permutation;
386 return _mesh->template get_face_index<cell_dim_, face_dim_>(
388 _permutation.value().map(i),
389 _inverse_face_permutation.value().map(j)
392 return _mesh->template get_face_index<cell_dim_, face_dim_>(_layer, i, j);
400 return _mesh->template get_face_index<cell_dim_, face_dim_>(
402 _permutation.value().map(i),
403 _inverse_face_permutation.value().map(j)
406 return _mesh->template get_face_index<cell_dim_, face_dim_>(_layer, i, j);
421 auto tuple =
IndexTupleType(_mesh, _layer, _permutation.value().map(i));
422 tuple.permute_map(_inverse_face_permutation.value());
434 auto tuple =
IndexTupleType(_mesh, _layer, _permutation.value().map(i));
435 tuple.permute_map(_inverse_face_permutation.value());
446 return _mesh->get_num_entities(_layer, cell_dim_);
462 return _mesh->get_num_entities(_layer, face_dim_);
476 _permutation.value().concat(perm);
480 _permutation = perm.
clone();
484 if(_inverse_face_permutation)
486 _inverse_face_permutation.value().
concat(inv_perm_face);
490 _inverse_face_permutation = inv_perm_face.
clone();
496 return "AdaptiveIndexSet<" +
stringify(cell_dim_) +
", " +
stringify(face_dim_) +
">";
501 Index get_num_nodes_domain()
const
506 Index get_num_nodes_image()
const
508 return _mesh->get_num_entities(_layer, face_dim_);
511 AdaptiveIndexSetAdjactor image_begin(
Index domain_node)
const
513 return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node, 0);
516 AdaptiveIndexSetAdjactor image_end(
Index domain_node)
const
518 return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node,
num_indices);
523 typename AdaptiveMeshType_,
525 int face_dim_ = Shape_::dimension - 1>
529 static_assert(face_dim_ < Shape_::dimension,
"invalid face dimension");
530 static_assert(face_dim_ > 0,
"invalid face dimension");
533 using AdaptiveMeshType = AdaptiveMeshType_;
535 static constexpr int cell_dim = Shape_::dimension;
545 template<
int face_dim__>
549 std::shared_ptr<AdaptiveMeshType> _mesh;
559 _index_set(mesh, layer)
571 BaseClass::clone(
other);
572 _index_set =
other._index_set;
580 template<
int face_dim__>
583 static_assert(face_dim__ >= 0,
"invalid face dimension");
584 static_assert(face_dim__ < Shape_::dimension,
"invalid face dimension");
589 template<
int face_dim__>
592 static_assert(face_dim__ >= 0,
"invalid face dimension");
593 static_assert(face_dim__ < Shape_::dimension,
"invalid face dimension");
598 template<std::
size_t np_>
600 const std::array<Adjacency::Permutation, np_>& inv_perm)
602 BaseClass::permute(shape_perm, inv_perm);
603 _index_set.permute(shape_perm, inv_perm.at(face_dim_));
608 return "AdaptiveIndexSetWrapper<" + Shape_::name() +
", " +
stringify(face_dim_) +
">";
613 return BaseClass::bytes() + _index_set.
bytes();
617 template<
typename AdaptiveMeshType_,
typename Shape_>
620 static_assert(Shape_::dimension > 0,
"invalid shape dimension");
623 using AdaptiveMeshType = AdaptiveMeshType_;
625 static constexpr int cell_dim = Shape_::dimension;
632 template<
int face_dim__>
636 std::shared_ptr<AdaptiveMeshType> _mesh;
645 _index_set(mesh, layer)
657 _index_set =
other._index_set;
665 template<
int face_dim__>
668 static_assert(face_dim__ == 0,
"invalid face dimension");
673 template<
int face_dim__>
676 static_assert(face_dim__ == 0,
"invalid face dimension");
681 template<std::
size_t np_>
683 const std::array<Adjacency::Permutation, np_>& inv_perm)
685 _index_set.permute(shape_perm, inv_perm.at(0));
690 return "AdaptiveIndexSetWrapper<" + Shape_::name() +
",0>";
693 std::size_t bytes()
const
695 return _index_set.
bytes();
709 template<
typename AdaptiveMeshType_,
typename Shape_>
713 typename Shape::FaceTraits<Shape_, Shape_::dimension - 1>::ShapeType>
725 template<
int shape_dim_>
731 std::shared_ptr<AdaptiveMeshType> _mesh;
741 _index_set_wrapper(mesh, layer)
753 BaseClass::clone(
other);
754 _index_set_wrapper.clone(
other._index_set_wrapper);
757 AdaptiveIndexSetHolder clone()
const
759 return AdaptiveIndexSetHolder(_mesh, _layer);
762 template<
int shape_dim_>
763 AdaptiveIndexSetWrapperByShapeDim<shape_dim_>& get_index_set_wrapper()
765 static_assert(shape_dim_ > 0,
"invalid shape dimension");
766 static_assert(shape_dim_ <= Shape_::dimension,
"invalid shape dimension");
768 return AdaptiveIndexSetHolder<AdaptiveMeshType, ShapeType>::_index_set_wrapper;
771 template<
int shape_dim_>
772 const AdaptiveIndexSetWrapperByShapeDim<shape_dim_>& get_index_set_wrapper()
const
774 static_assert(shape_dim_ > 0,
"invalid shape dimension");
775 static_assert(shape_dim_ <= Shape_::dimension,
"invalid shape dimension");
777 return AdaptiveIndexSetHolder<AdaptiveMeshType, ShapeType>::_index_set_wrapper;
780 template<
int cell_dim_,
int face_dim_>
781 AdaptiveIndexSet<AdaptiveMeshType, cell_dim_, face_dim_>& get_index_set()
783 static_assert(cell_dim_ <= Shape_::dimension,
"invalid cell dimension");
784 static_assert(face_dim_ < cell_dim_,
"invalid face/cell dimension");
785 static_assert(face_dim_ >= 0,
"invalid face dimension");
786 return get_index_set_wrapper<cell_dim_>().template get_index_set<face_dim_>();
789 template<
int cell_dim_,
int face_dim_>
790 const AdaptiveIndexSet<AdaptiveMeshType, cell_dim_, face_dim_>& get_index_set()
const
792 static_assert(cell_dim_ <= Shape_::dimension,
"invalid cell dimension");
793 static_assert(face_dim_ < cell_dim_,
"invalid face/cell dimension");
794 static_assert(face_dim_ >= 0,
"invalid face dimension");
795 return get_index_set_wrapper<cell_dim_>().template get_index_set<face_dim_>();
798 template<std::
size_t np_>
799 void permute(
const std::array<Adjacency::Permutation, np_>& perms,
800 const std::array<Adjacency::Permutation, np_>& inv_perms)
802 BaseClass::permute(perms, inv_perms);
803 _index_set_wrapper.permute(perms.at(Shape_::dimension), inv_perms);
808 return "AdaptiveIndexSetHolder<" + Shape_::name() +
">";
811 std::size_t bytes()
const
813 return BaseClass::bytes() + _index_set_wrapper.bytes();
817 template<
typename AdaptiveMeshType_>
841 template<std::
size_t np_>
842 void permute(
const std::array<Adjacency::Permutation, np_>&,
843 const std::array<Adjacency::Permutation, np_>&)
849 return "AdaptiveIndexSetHolder<Vertex>";
852 std::size_t bytes()
const
854 return std::size_t(0);
861 template<
typename AdaptiveMeshType_>
865 using AdaptiveMeshType = AdaptiveMeshType_;
867 std::shared_ptr<AdaptiveMeshType> _mesh;
874 Shape::FaceTraits<
typename AdaptiveMeshType::ShapeType, AdaptiveMeshType_::shape_dim - 1>::count;
880 std::shared_ptr<AdaptiveMeshType> _mesh;
887 std::optional<Adjacency::Permutation> _inverse_face_permutation = std::nullopt;
891 _mesh(std::move(mesh)),
893 _domain_node(domain_node),
899 std::shared_ptr<AdaptiveMeshType> mesh,
904 _mesh(std::move(mesh)),
906 _domain_node(domain_node),
908 _inverse_face_permutation(std::move(inverse_face_permutation))
914 return _domain_node ==
other._domain_node && _next ==
other._next && _layer ==
other._layer &&
915 _mesh ==
other._mesh;
920 return !(*
this ==
other);
929 Index operator*()
const
931 if(_inverse_face_permutation)
933 return _mesh->get_neighbor(_layer, _domain_node, _inverse_face_permutation.value().map(_next));
935 return _mesh->get_neighbor(_layer, _domain_node, _next);
944 std::optional<Adjacency::Permutation> _permutation;
945 std::optional<Adjacency::Permutation> _inverse_face_permutation;
989 return _mesh->get_neighbor(
991 _permutation.value().map(i),
992 Index(_inverse_face_permutation.value().map(j))
995 return _mesh->get_neighbor(_layer, i,
Index(j));
1003 return _mesh->get_neighbor(
1005 _permutation.value().map(i),
1006 Index(_inverse_face_permutation.value().map(j))
1009 return _mesh->get_neighbor(_layer, i,
Index(j));
1017 result[j] = (*this)(i, j);
1027 return _mesh->get_num_entities(_layer, AdaptiveMeshType::ShapeType::dimension);
1043 return _mesh->get_num_entities(_layer, AdaptiveMeshType::ShapeType::dimension);
1057 _permutation.value().concat(perm);
1061 _permutation = perm.
clone();
1065 if(_inverse_face_permutation)
1067 _inverse_face_permutation.value().
concat(inv_perm_face);
1071 _inverse_face_permutation = inv_perm_face.
clone();
1075 static String name()
1077 return "AdaptiveNeighbors";
1082 Index get_num_nodes_domain()
const
1087 Index get_num_nodes_image()
const
1089 return _mesh->get_num_entities(_layer, AdaptiveMeshType::ShapeType::dimension);
1092 AdaptiveNeighborsAdjactor image_begin(
Index domain_node)
const
1096 return AdaptiveIndexSetAdjactor(_mesh, _layer, _permutation.value().map(domain_node), 0, _inverse_face_permutation.value());
1098 return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node, 0);
1101 AdaptiveNeighborsAdjactor image_end(
Index domain_node)
const
1105 return AdaptiveIndexSetAdjactor(_mesh, _layer, _permutation.value().map(domain_node),
num_indices, _inverse_face_permutation.value());
1107 return AdaptiveIndexSetAdjactor(_mesh, _layer, domain_node,
num_indices);
1121 template<
typename AdaptiveMeshType_>
1149 static constexpr int shape_dim = AdaptiveMeshType::shape_dim;
1152 static constexpr int world_dim = AdaptiveMeshType::world_dim;
1161 template<
int cell_dim_,
int face_dim_>
1168 std::shared_ptr<AdaptiveMeshType> _mesh;
1187 _index_set_holder(_mesh, layer),
1200 _mesh =
other._mesh;
1201 _layer =
other._layer;
1202 _vertex_set =
other._vertex_set;
1203 _index_set_holder =
other._index_set_holder;
1204 _permutation =
other._permutation.clone();
1207 AdaptiveMeshLayer clone()
const
1209 AdaptiveMeshLayer result(_mesh, _layer);
1210 result._vertex_set = _vertex_set;
1211 result._index_set_holder = _index_set_holder;
1212 result._permutation = _permutation;
1216 std::size_t bytes()
const
1218 return _vertex_set.bytes() + _index_set_holder.bytes() + _permutation.
bytes();
1228 return _mesh->get_num_entities(_layer, dim);
1254 return !_permutation.
empty();
1262 return _permutation;
1285 XASSERTM(this->_permutation.
empty(),
"mesh is already permuted!");
1288 this->_permutation.
create(strategy, this->_index_set_holder, this->_vertex_set);
1294 this->_index_set_holder.permute(this->_permutation.
get_perms(), this->_permutation.get_inv_perms());
1316 XASSERTM(this->_permutation.
empty(),
"mesh is already permuted!");
1319 const std::array<Index, 4> mesh_size {
1325 XASSERTM(mesh_perm.validate_sizes(mesh_size.data()) == 0,
"mesh permutation has invalid size!");
1328 this->_permutation = std::forward<MeshPermutationType>(mesh_perm);
1334 this->_index_set_holder.permute(this->_permutation.
get_perms(), this->_permutation.get_inv_perms());
1349 if(coloring.empty())
1353 const auto& verts_at_elem = this->
template get_index_set<shape_dim, 0>();
1359 for(std::size_t icol(0); icol+1u < coloring.size(); ++icol)
1362 const Index iel_beg = coloring[icol];
1363 const Index iel_end = coloring[icol+1u];
1366 for(
Index iel(iel_beg); iel < iel_end; ++iel)
1369 for(
int ivt(0); ivt < verts_at_elem.num_indices; ++ivt)
1372 const Index ivtx = verts_at_elem(iel, ivt);
1376 if((iel_beg <= *it) && (*it < iel_end) && (*it != iel))
1399 if(layering.empty())
1403 const auto& verts_at_elem = this->
template get_index_set<shape_dim, 0>();
1409 for(std::size_t ilay(0); ilay+1u < layering.size(); ++ilay)
1412 const Index iel_beg = layering[ilay];
1413 const Index iel_end = layering[ilay+1u];
1416 const Index iel_lower = layering[
Math::max(ilay, std::size_t(1)) - 1u];
1419 const Index iel_upper = layering[
Math::min(ilay+2u, layering.size()-1u)];
1422 for(
Index iel(iel_beg); iel < iel_end; ++iel)
1425 for(
int ivt(0); ivt < verts_at_elem.num_indices; ++ivt)
1428 const Index ivtx = verts_at_elem(iel, ivt);
1432 if(!((iel_lower <= *it) && (*it < iel_upper)))
1443 void fill_neighbours()
1445 _mesh->fill_neighbors();
1450 return AdaptiveNeighbors(_mesh, _layer);
1455 return AdaptiveNeighbors(_mesh, _layer);
1480 template<
int cell_dim_,
int face_dim_>
1483 return _index_set_holder.template get_index_set<cell_dim_, face_dim_>();
1492 template<
int cell_dim_,
int face_dim_>
1495 return _index_set_holder.template get_index_set<cell_dim_, face_dim_>();
1503 return _index_set_holder;
1511 return _index_set_holder;
1516 return _index_set_holder;
1521 return _index_set_holder;
1538 return _mesh->template get_child<ShapeType::dimension>(_layer, elem, child);
1548 return _mesh->template get_num_children<ShapeType::dimension>(_layer, elem);
1553 return "AdaptiveMeshLayer<...>";
1563 return _mesh->has_vertex_changed(_layer, vertex_idx);
1569 return _mesh->foundation_mesh();
1575 return _mesh->foundation_mesh();
1602 template<
typename AdaptiveMeshLayerType>
1628 return _coarse->get_child(_cell, _child).value_or(0);
1639 return _cell !=
other._cell || _child !=
other._child;
1643 static constexpr int dim = AdaptiveMeshLayerType::ShapeType::dimension;
1645 const AdaptiveMeshLayerType* _coarse;
1654 const AdaptiveMeshLayerType& _coarse;
1655 const AdaptiveMeshLayerType& _fine;
1658 AdaptiveChildMapping(
const AdaptiveMeshLayerType& coarse,
const AdaptiveMeshLayerType& fine) : _coarse(coarse), _fine(fine)
1662 Index get_num_nodes_domain()
const
1664 return _coarse.get_num_elements();
1667 Index get_num_nodes_image()
const
1669 return _fine.get_num_elements();
1672 ChildCellIterator image_begin(
Index domain_node)
const
1674 return ChildCellIterator(&_coarse, domain_node, 0);
1677 ChildCellIterator image_end(
Index domain_node)
const
1679 Index num_children = _coarse.get_num_children(domain_node);
1680 return ChildCellIterator(&_coarse, domain_node, num_children);
1687 template<
typename AdaptiveMeshType_,
int dim_ = AdaptiveMeshType_::ShapeType::dimension>
1690 const AdaptiveMeshType_& _amesh;
1699 using iterator_category = std::input_iterator_tag;
1700 using difference_type = std::size_t;
1701 using value_type =
Index;
1702 using pointer =
Index*;
1703 using reference =
Index&;
1747 return (a._done && b._done);
1762 Index get_num_nodes_domain()
const
1764 return _amesh.foundation_mesh().get_num_entities(dim_);
1767 Index get_num_nodes_image()
const
1772 ImageIterator image_begin(
Index domain_idx)
const
1774 if(
auto mapping = _amesh.template get_overlap_cell<dim_>(domain_idx))
1776 return OnceIterator(*mapping);
1780 return OnceIterator{};
1784 ImageIterator image_end(
Index )
const
1786 return OnceIterator{};
#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
Index get_num_children(Index elem) const
Returns the number of children of mesh a mesh element.
AdaptiveMeshLayer(std::shared_ptr< AdaptiveMeshType > mesh, Layer layer)
Constructor.
static constexpr int world_dim
World dimension.
const AdaptiveMeshType & adaptive_mesh() const
accessor for adaptive mesh
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.
const VertexSetType & get_vertex_set() const
Returns the vertex set of this mesh.
std::optional< Index > get_child(Index elem, Index child) const
Retrieve index of a child element.
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::shared_ptr< AdaptiveMeshType > adaptive_mesh_ptr() const
accessor for adaptive mesh
static constexpr bool is_structured
This is an unstructured mesh.
const AdaptiveMeshType::FoundationMeshType & foundation_mesh() const
accessor for foundation 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.
typename AdaptiveMeshType::CoordType CoordType
Coord type.
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.
Adjactor from elements of the foundation mesh to layer 0 of an adaptive mesh.
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.
Index Tuple class template.
Newtype wrapper for mesh layers.
Face traits tag struct template.
typedef ShapeType
Shape type of the face.