8#include <kernel/geometry/intern/adaptive_refinement_utils.hpp> 
    9#include <kernel/geometry/intern/congruency_mapping.hpp> 
   10#include <kernel/geometry/intern/face_index_mapping.hpp> 
   11#include <kernel/geometry/intern/refinement_field.hpp> 
   12#include <kernel/geometry/subdivision_levels.hpp> 
   13#include <kernel/shape.hpp> 
   21    template<
typename Shape_>
 
   22    static std::bitset<Shape::FaceTraits<Shape_, 0>::count>
 
   23    orient_bitset(
const std::bitset<Shape::FaceTraits<Shape_, 0>::count>& bits, 
int orientation)
 
   25      using CongruencyMapping = CongruencyMapping<Shape_, 0>;
 
   26      static constexpr const int num_bits = Shape::FaceTraits<Shape_, 0>::count;
 
   28      std::bitset<num_bits> result = 0;
 
   30      for(
int current_bit = 0; current_bit < num_bits; current_bit++)
 
   34          int mapped_bit = CongruencyMapping::map(orientation, current_bit);
 
   35          result[mapped_bit] = 
true;
 
   42  template<
typename Shape_>
 
   47    std::bitset<num_vertices> bits;
 
   55    explicit VertexMarking(std::uint64_t markings) : bits(markings)
 
   59    explicit VertexMarking(std::bitset<num_vertices> markings) : bits(markings)
 
   65      for(
int i = 0; i < num_vertices; i++)
 
   67        bits[i] = (tuple[i] > 0);
 
   73      return VertexMarking((1ULL << (std::size_t)num_vertices) - 1ULL);
 
   79      return (bits | 
other.bits) == bits;
 
   82    bool is_vertex_marked(
int vertex)
 const 
   84      ASSERT(vertex < num_vertices);
 
   90      return (bits ^ 
other.bits).count();
 
   94  template<
typename Shape_>
 
   97    return lhs._markings == rhs._markings;
 
  100  template<
typename Shape_>
 
  101  bool operator!=(
const VertexMarking<Shape_>& lhs, 
const VertexMarking<Shape_>& rhs)
 
  103    return !(lhs == rhs);
 
  106  template<
typename Shape_>
 
  107  std::ostream& operator<<(std::ostream& stream, 
const VertexMarking<Shape_>& type)
 
  109    stream << 
"VertexMarkings<" << Shape_::name() << 
"> { markings: " << type.bits << 
" }";
 
  113  template<
typename Shape_>
 
  118    std::bitset<num_vertices> _type;
 
  120    template<
typename S_>
 
  123    template<
typename S_>
 
  126    template<
typename T_>
 
  127    friend struct std::hash;
 
  143      const Intern::template RefinementFieldTuple<std::uint64_t, num_vertices>& markings) :
 
  146      for(
int i = 0; i < num_vertices; i++)
 
  148        _type[i] = (markings[i] > 0);
 
  152    bool is_full_refinement()
 const 
  157    bool is_zero_refinement()
 const 
  166      using Mapping = Intern::FaceIndexMapping<Shape_, dim_, 0>;
 
  170      std::bitset<num_verts> result;
 
  171      for(
int i(0); i < num_verts; i++)
 
  173        auto vertex = 
static_cast<Index>(Mapping::map(face, i));
 
  174        result[i] = _type[vertex];
 
  210    Index to_number()
 const 
  212      return _type.to_ulong();
 
  216  template<
typename Shape_>
 
  219    return lhs._type == rhs._type;
 
  222  template<
typename Shape_>
 
  223  bool operator!=(
const StandardRefinementType<Shape_>& lhs, 
const StandardRefinementType<Shape_>& rhs)
 
  225    return !(lhs == rhs);
 
  228  template<
typename Shape_>
 
  229  std::ostream& operator<<(std::ostream& stream, 
const StandardRefinementType<Shape_>& type)
 
  231    stream << 
"StandardRefinementType<" << Shape_::name() << 
"> { type: " << type._type << 
" }";
 
  237    std::uint64_t level = 0;
 
  238    bool is_isolated = 
false;
 
  249    return a.level == b.level && a.is_isolated == b.is_isolated;
 
  252  inline bool operator!=(
const IsolatedPointVertexMarking& a, 
const IsolatedPointVertexMarking& b)
 
  257  inline std::ostream& operator<<(std::ostream& stream, 
const IsolatedPointVertexMarking& marking)
 
  259    stream << 
"IsolatedPointVertexMarking{ level: " << unsigned(marking.level) << 
", is_isolated: " << marking.is_isolated << 
" }";
 
  263  template<
typename Shape_>
 
  268    std::bitset<num_vertices> _type;
 
  271    template<
typename S_>
 
  274    template<
typename S_>
 
  277    template<
typename T_>
 
  278    friend struct std::hash;
 
  292      _type(markings.bits),
 
  298      const Intern::template RefinementFieldTuple<IsolatedPointVertexMarking, num_vertices>& markings) :
 
  302      for(
Index i = 0; i < num_vertices; i++)
 
  304        _type[i] = (markings[i].level > 0);
 
  305        _isolated = _isolated || markings[i].is_isolated;
 
  309    bool is_full_refinement()
 const 
  314    bool is_zero_refinement()
 const 
  323      using Mapping = Intern::FaceIndexMapping<Shape_, dim_, 0>;
 
  327      std::bitset<num_verts> result_bits;
 
  329      for(
int i(0); i < num_verts; i++)
 
  331        auto vertex = 
static_cast<Index>(Mapping::map(face, i));
 
  332        result_bits[i] = _type[vertex];
 
  369    Index to_number()
 const 
  371      return _type.to_ulong();
 
  375  template<
typename Shape_>
 
  378    return lhs._type == rhs._type && lhs._isolated == rhs._isolated;
 
  381  template<
typename Shape_>
 
  382  bool operator!=(
const IsolatedPointRefinementType<Shape_>& lhs, 
const IsolatedPointRefinementType<Shape_>& rhs)
 
  384    return !(lhs == rhs);
 
  387  template<
typename Shape_>
 
  388  std::ostream& operator<<(std::ostream& stream, 
const IsolatedPointRefinementType<Shape_>& type)
 
  390    stream << 
"IsolatedPointRefinementType<" << Shape_::name() << 
"> { type: " << type._type
 
  391           << 
", isolated: " << 
stringify(type._isolated) << 
" }";
 
  399  template<
typename Shape_>
 
  400  struct hash<
FEAT::Geometry::StandardRefinementType<Shape_>>
 
  402    static constexpr int num_vertices = FEAT::Shape::template FaceTraits<Shape_, 0>::count;
 
  406      return std::hash<std::bitset<num_vertices>>{}(type._type);
 
  410  template<
typename Shape_>
 
  411  struct hash<
FEAT::Geometry::IsolatedPointRefinementType<Shape_>>
 
  413    static constexpr int num_vertices = FEAT::Shape::template FaceTraits<Shape_, 0>::count;
 
  417      auto h1 = std::hash<std::bitset<num_vertices>>{}(type._type);
 
  418      auto h2 = std::hash<bool>{}(type._isolated);
 
  419      return h1 ^ (h2 << 1UL);
 
#define ASSERT(expr)
Debug-Assertion macro definition.
@ other
generic/other permutation strategy
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.
Tuple-type for SubdivisionLevels.
Face traits tag struct template.