39 template<
typename T,
unsigned d>
48 typedef typename std::vector<T>::const_iterator uiter;
61 m_meshStart.resize(d);
65 m_curElement.resize(d);
70 m_breaks = std::vector<std::vector<T> >(d, std::vector<T>());
98 for (
index_t i = 0; i < increment; i++)
123 return m_leaf.level();
128 gsHDomainBoundaryIterator();
134 m_leaf = tree_domain.beginLeafIterator();
136 for (; m_leaf.
good(); m_leaf.next() )
152 for (m_leaf.next(); m_leaf.
good(); m_leaf.next() )
172 if (basis().manualLevels() )
179 diadicSize = end - start;
184 return static_cast<size_t>(m_leaf.upperCorner().
at(dir) ) == diadicSize;
188 return m_leaf.lowerCorner().
at(dir) == 0;
197 const point & lower = m_leaf.lowerCorner();
198 const point & upper = m_leaf.upperCorner();
202 const int level2 = m_leaf.level();
210 if (basis().manualLevels() )
213 _diadicIndexToKnotIndex(level2,
dim,start);
215 _diadicIndexToKnotIndex(level2,
dim,end);
222 m_breaks[
dim].clear();
227 m_breaks[
dim].push_back( kv(end-1) );
228 m_breaks[
dim].push_back( kv(end ) );
232 m_breaks[
dim].push_back( kv(start) );
233 m_breaks[
dim].push_back( kv(start+1) );
238 for (
index_t index = start; index <= end; ++index)
239 m_breaks[
dim].push_back( kv(index) );
243 m_meshStart(
dim) = m_breaks[
dim].begin();
247 m_meshEnd(
dim) = m_breaks[
dim].end() - 1;
260 for (
unsigned i = 0; i < dir ; ++i)
262 m_lower[i] = *m_curElement[i];
263 m_upper[i] = *(m_curElement[i]+1);
264 center[i] = (T)(0.5) * (m_lower[i] + m_upper[i]);
268 center [dir] = (par ? *(m_curElement[dir]+1) : *m_curElement[dir] );
269 for (
unsigned i = dir+1; i < d; ++i)
271 m_lower[i] = *m_curElement[i];
272 m_upper[i] = *(m_curElement[i]+1);
273 center [i] = (T)(0.5) * (m_lower[i] + m_upper[i]);
285 using gsDomainIterator<T>::center;
286 using gsDomainIterator<T>::m_basis;
288 # define Eigen gsEigen
289 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
303 std::vector< std::vector<T> > m_breaks;
306 gsVector<uiter, d> m_meshStart, m_meshEnd;
309 gsVector<uiter, d> m_curElement;
312 gsVector<T> m_lower, m_upper;
315 gsGaussRule<T> m_quadrature;
void initLeaf(const hDomain &tree_domain)
Navigates to the first leaf on our side.
Definition: gsHDomainBoundaryIterator.h:131
void reset()
Definition: gsHDomainBoundaryIterator.h:111
Iterates over the leaves of an gsHDomain (tree).
Definition: gsHDomainLeafIter.h:29
short_t dim() const
Return dimension of the elements.
Definition: gsDomainIterator.h:115
bool parameter() const
Returns the parameter value (false=0=start, true=1=end) that corresponds to this side.
Definition: gsBoundary.h:128
const gsVector< T > & upperCorner() const
Returns the upper corner of the current element.
Definition: gsHDomainBoundaryIterator.h:119
Struct representing a kd-tree node.
Definition: gsKdNode.h:34
#define index_t
Definition: gsConfig.h:32
void updateLeaf()
Definition: gsHDomainBoundaryIterator.h:195
const gsHDomain< d > & tree() const
Returns a reference to m_tree.
Definition: gsHTensorBasis.h:601
Provides declaration of the HDomain class.
void _knotIndexToDiadicIndex(const index_t level, const index_t dir, index_t &knotIndex) const
Transfers the knotIndex in the knot span in direction dir on level level to diadic indices...
Definition: gsHTensorBasis.hpp:1892
virtual gsBSplineBasis< T > & component(short_t i)
The 1-d basis for the i-th parameter component at the highest level.
Definition: gsHTensorBasis.h:656
Class representing a (scalar) hierarchical tensor basis of functions .
Definition: gsHTensorBasis.h:74
Re-implements gsDomainIterator for iteration over all boundary elements of a hierarchical parameter d...
Definition: gsHDomainBoundaryIterator.h:40
Class which enables iteration over all elements of a parameter domain.
Definition: gsDomainIterator.h:67
Provides declaration of DomainIterator abstract interface.
const gsVector< T > & lowerCorner() const
Returns the lower corner of the current element.
Definition: gsHDomainBoundaryIterator.h:117
T at(index_t i) const
Returns the i-th element of the vector.
Definition: gsVector.h:177
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
bool nextLeaf()
returns true if there is a another leaf with a boundary element
Definition: gsHDomainBoundaryIterator.h:150
Class with a hierarchical domain structure represented by a box k-d-tree.
Definition: gsHDomain.h:75
bool m_isGood
Definition: gsDomainIterator.h:223
bool next()
Proceeds to the next element.
Definition: gsHDomainBoundaryIterator.h:83
bool nextLexicographic(Vec &cur, const Vec &size)
Iterates through a tensor lattice with the given size. Updates cur and returns true if another entry ...
Definition: gsCombinatorics.h:196
tensorBasis & tensorLevel(index_t i) const
Returns the tensor basis member of level i.
Definition: gsHTensorBasis.h:668
const gsBasis< T > * m_basis
The basis on which the domain iterator is defined.
Definition: gsDomainIterator.h:219
gsVector< T > center
Coordinates of a central point in the element (in the parameter domain).
Definition: gsDomainIterator.h:215
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
Class for representing a knot vector.
Definition: gsKnotVector.h:79
bool leafOnBoundary() const
returns true if the current leaf is on our side
Definition: gsHDomainBoundaryIterator.h:165
size_t uSize() const
Number of unique knots (i.e., without repetitions).
Definition: gsKnotVector.h:245
void updateElement()
Definition: gsHDomainBoundaryIterator.h:257
short_t direction() const
Returns the parametric direction orthogonal to this side.
Definition: gsBoundary.h:113
Provides declaration of the tree node.
bool good() const
Returns true iff we are still pointing at a valid leaf.
Definition: gsHDomainLeafIter.h:81
bool next(index_t increment)
Proceeds to the next element (skipping increment elements).
Definition: gsHDomainBoundaryIterator.h:96
Provides declaration of TensorBSplineBasis abstract interface.