37template<
typename T,
unsigned d>
46 typedef typename std::vector<T>::const_iterator uiter;
58 m_meshStart.resize(d);
62 m_curElement.resize(d);
67 m_breaks = std::vector<std::vector<T> >(d, std::vector<T>());
69 m_leaf = hbs.
tree().beginLeafIterator();
115 m_leaf = hbs->
tree().beginLeafIterator();
126 return m_leaf.level();
131 gsVector<index_t> elementMultiIndex()
const
133 gsVector<index_t> res(d);
136 res[i] = std::distance(m_breaks[i].begin(), m_curElement[i]);
161 const point & lower = m_leaf.lowerCorner();
162 const point & upper = m_leaf.upperCorner();
166 const int level2 = m_leaf.level();
174 if (basis().manualLevels() )
177 _diadicIndexToKnotIndex(level2,
dim,start);
179 _diadicIndexToKnotIndex(level2,
dim,end);
188 m_breaks[
dim].clear();
189 for (
index_t index = start; index <= end; ++index)
190 m_breaks[
dim].push_back( kv(index) );
193 m_meshStart(
dim) = m_breaks[
dim].begin();
196 m_meshEnd(
dim) = m_breaks[
dim].end() - 1;
206 for (
unsigned i = 0; i < d ; ++i)
208 m_lower[i] = *m_curElement[i];
209 m_upper[i] = *(m_curElement[i]+1);
210 center[i] = (T)(0.5) * (m_lower[i] + m_upper[i]);
225# define Eigen gsEigen
226 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
230 using gsDomainIterator<T>::m_id;
239 std::vector< std::vector<T> > m_breaks;
242 gsVector<uiter, d> m_meshStart, m_meshEnd;
245 gsVector<uiter, d> m_curElement;
248 gsVector<T> m_lower, m_upper;
Class which enables iteration over all elements of a parameter domain.
Definition gsDomainIterator.h:68
bool m_isGood
Definition gsDomainIterator.h:223
gsVector< T > center
Coordinates of a central point in the element (in the parameter domain).
Definition gsDomainIterator.h:215
const gsBasis< T > * m_basis
The basis on which the domain iterator is defined.
Definition gsDomainIterator.h:219
short_t dim() const
Return dimension of the elements.
Definition gsDomainIterator.h:115
Re-implements gsDomainIterator for iteration over all boundary elements of a hierarchical parameter d...
Definition gsHDomainIterator.h:39
const gsVector< T > & upperCorner() const
Returns the upper corner of the current element.
Definition gsHDomainIterator.h:122
void updateLeaf()
Definition gsHDomainIterator.h:159
bool next(index_t increment)
Proceeds to the next element (skipping increment elements).
Definition gsHDomainIterator.h:93
const gsVector< T > & lowerCorner() const
Returns the lower corner of the current element.
Definition gsHDomainIterator.h:120
bool nextLeaf()
returns true if there is a another leaf with a boundary element
Definition gsHDomainIterator.h:146
bool next()
Proceeds to the next element.
Definition gsHDomainIterator.h:75
void reset()
Definition gsHDomainIterator.h:111
void updateElement()
Definition gsHDomainIterator.h:203
Iterates over the leaves of an gsHDomain (tree).
Definition gsHDomainLeafIter.h:30
bool good() const
Returns true iff we are still pointing at a valid leaf.
Definition gsHDomainLeafIter.h:81
Class with a hierarchical domain structure represented by a box k-d-tree.
Definition gsHDomain.h:76
Class representing a (scalar) hierarchical tensor basis of functions .
Definition gsHTensorBasis.h:75
const gsHDomain< d > & tree() const
Returns a reference to m_tree.
Definition gsHTensorBasis.h:601
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 for representing a knot vector.
Definition gsKnotVector.h:80
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
#define index_t
Definition gsConfig.h:32
Provides declaration of DomainIterator abstract interface.
Provides declaration of the HDomain class.
Provides declaration of the tree node.
Provides declaration of TensorBSplineBasis abstract interface.
The G+Smo namespace, containing all definitions for the library.
Struct representing a kd-tree node.
Definition gsKdNode.h:35