12 #ifndef BEMBEL_SRC_CLUSTERTREE_ELEMENTTREENODE_HPP_
13 #define BEMBEL_SRC_CLUSTERTREE_ELEMENTTREENODE_HPP_
29 using iterator_category = std::forward_iterator_tag;
30 using difference_type = std::ptrdiff_t;
70 return a.m_ptr == b.m_ptr;
76 return a.m_ptr != b.m_ptr;
94 radius_(std::numeric_limits<
double>::infinity()) {
103 llc_.swap(other.llc_);
105 radius_ = other.radius_;
108 sons_ = std::move(other.sons_);
139 std::cout <<
"{" << std::endl;
140 std::cout <<
"midpoint: " <<
midpoint_.transpose() << std::endl;
141 std::cout <<
"llc: " <<
llc_.transpose() << std::endl;
142 std::cout <<
"p s n: " <<
prev_ <<
" " <<
this <<
" " << next_
144 std::cout <<
"neighbours: ";
145 for (
auto i = 0; i <
adjcents_.size(); ++i)
147 std::cout << std::endl;
148 std::cout <<
"vertices: ";
149 for (
auto i = 0; i <
vertices_.size(); ++i)
151 std::cout << std::endl;
152 std::cout <<
"radius: " << radius_ << std::endl;
153 std::cout <<
"id: " <<
id_ << std::endl;
154 std::cout <<
"level: " <<
level_ << std::endl;
155 std::cout <<
"patch: " <<
patch_ << std::endl;
156 std::cout <<
"}" << std::endl;
171 Eigen::Vector2d out = (in -
llc_) /
get_h();
172 assert(out(0) >= 0. && out(0) <= 1. && out(1) >= 0. && out(1) <= 1.);
182 return llc_ + Eigen::Vector2d(0.5, 0.5) *
get_h();
209 while (ptr->
sons_.size()) ptr = std::addressof(ptr->
sons_.front());
220 while (ptr->
sons_.size()) ptr = std::addressof(ptr->
sons_.back());
The ElementTreeNode corresponds to an element in the element tree.
int id_
radius of the element
const_iterator cend() const
Returns an iterator pointing to the element in the sequence after this ElementTreeNode.
int level_
element id with respect to the level
ElementTreeNode(const ElementTreeNode &other)=delete
Copy constructor (deleted).
ElementTreeNode & operator=(const ElementTreeNode &other)=delete
Copy assignment operator (deleted).
const_iterator begin() const
Returns an iterator pointing to the element in the sequence before this ElementTreeNodes.
int get_level() const
Get the level of refinement of the element.
std::vector< int > vertices_
neighbouring elements indices
void print() const
methods
ElementTreeNode & operator=(ElementTreeNode &&other)=delete
Move assignment operator (deleted).
Eigen::Vector2d llc_
midpoint of the element
ElementTreeNode(ElementTreeNode &&other) noexcept
Move constructor.
const_iterator cbegin() const
Returns an iterator pointing to the element in the sequence before this ElementTreeNodes.
ElementTreeNode * prev_
lower left corner on [0,1]^2
ElementTreeNode() noexcept
constructors
Eigen::Vector3d midpoint_
indices of the vertices
Eigen::Vector2d mapToReferenceElement(const Eigen::Vector2d &in) const
Maps a point in the reference domain of a patch to the reference element of this element.
int patch_
level of the element
double get_h() const
getter
std::vector< ElementTreeNode * > adjcents_
children
Eigen::Vector2d referenceMidpoint() const
Get the midpoint of this element with respect to the patch.
std::vector< ElementTreeNode > sons_
member variables
const ElementTreeNode & front() const
Returns a const reference to the first son if any or itself.
const_iterator end() const
Returns an iterator pointing to the element in the sequence after this ElementTreeNode.
const ElementTreeNode & back() const
Returns a const reference to the last son if any or itself.
Routines for the evalutation of pointwise errors.
iterator struct for element tree nodes. They may be used to iterator over the elements in a cluster....
const_iterator operator++(int)
Postfix increment.
const_iterator & operator++()
Prefix increment.
reference operator*() const
Accesses the pointed-to element.
friend bool operator!=(const const_iterator &a, const const_iterator &b)
Compares the underlying iterators.
const pointer operator->() const
Accesses the pointed-to element.
const_iterator(pointer ptr)
Constructs a new iterator.
friend bool operator==(const const_iterator &a, const const_iterator &b)
Compares the underlying iterators.