35 template<
class T,
int D,
typename uiter>
55 for (
int i=0; i < dir; ++i)
57 breaks.push_back(
m_basis->component(i).domain()->breaks() );
58 meshEnd[i] = breaks[i].end() - 1;
59 meshBegin[i] = curElement[i] = breaks[i].begin();
64 if (meshEnd[i] == curElement[i])
69 breaks.push_back(
m_basis->component(dir).domain()->breaks() );
71 meshEnd[dir] = ( par ? breaks[dir].end() - 1 : breaks[dir].begin() + 1 );
73 meshBegin[dir] = ( par ? breaks[dir].end() - 2 : breaks[dir].begin() );
74 tindex = curElement[dir] - breaks[dir].begin();
83 for (
int i=dir+1; i < d; ++i)
85 breaks.push_back(
m_basis->component(i).domain()->breaks() );
86 meshEnd[i] = breaks[i].end() - 1;
87 meshBegin[i] = curElement[i] = breaks[i].begin();
92 if (meshEnd[i] == curElement[i])
118 for (
index_t i = 0; i < increment; i++)
130 curElement=meshBegin;
132 for(
int i=0; i < d; ++i)
134 if (i!=dir && curElement[i]==meshEnd[i])
145 for (
int i = 0; i < dir; ++i)
146 curr_index[i] = curElement[i] - meshBegin[i];
147 for (
int i = dir+1; i < d; ++i)
148 curr_index[i] = curElement[i] - meshBegin[i];
149 curr_index[dir] = tindex;
161 return *(curElement[dir]+1) - *curElement[dir];
168 for (
short_t i = 0; i < dir; ++i)
169 result *= breaks[i].size() - 1;
170 for (
short_t i = dir+1; i < d; ++i)
171 result *= breaks[i].size() - 1;
185 int a2 = !other_.dir;
187 other_.curElement[a2] = std::lower_bound(
188 other_.breaks[a2].begin(), other_.breaks[a2].end(),
189 orient[0] ? *curElement[a1] : *(curElement[a1]+1) );
196 breaks[i].swap(newBreaks);
197 meshEnd[i] = breaks[i].end() - 1;
198 meshBegin[i] = curElement[i] = breaks[i].begin();
209 for (
int i = 0; i < dir ; ++i)
211 lower[i] = *curElement[i];
212 upper[i] = *(curElement[i]+1);
213 center[i] = (T)(0.5) * (lower[i] + upper[i]);
217 center[dir] = (par ? *(curElement[dir]+1) : *curElement[dir] );
218 for (
int i = dir+1; i < d; ++i)
220 lower[i] = *curElement[i];
221 upper[i] = *(curElement[i]+1);
222 center[i] = (T)(0.5) * (lower[i] + upper[i]);
246 std::vector< std::vector<T> > breaks;
264 # define Eigen gsEigen
265 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Provides the Gauss-Legendre quadrature rule.
void reset()
Definition: gsTensorDomainBoundaryIterator.h:128
gsVector< unsigned, D > index() const
Return the tensor index of the current element.
Definition: gsTensorDomainBoundaryIterator.h:142
#define short_t
Definition: gsConfig.h:35
bool parameter() const
Returns the parameter value (false=0=start, true=1=end) that corresponds to this side.
Definition: gsBoundary.h:128
#define index_t
Definition: gsConfig.h:32
const gsVector< T > & lowerCorner() const
Returns the lower corner of the current element.
Definition: gsTensorDomainBoundaryIterator.h:153
Provides combinatorial unitilies.
void setBreaks(std::vector< T > newBreaks, index_t i)
Function to set the breakpoints in direction i manually.
Definition: gsTensorDomainBoundaryIterator.h:194
void update()
Definition: gsTensorDomainBoundaryIterator.h:207
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition: gsVector.h:35
Class which enables iteration over all elements of a parameter domain.
Definition: gsDomainIterator.h:67
const gsVector< T > & upperCorner() const
Returns the upper corner of the current element.
Definition: gsTensorDomainBoundaryIterator.h:156
Re-implements gsDomainIterator for iteration over all elements of the boundary of a tensor product pa...
Definition: gsTensorDomainBoundaryIterator.h:37
Provides declaration of DomainIterator abstract interface.
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
bool m_isGood
Definition: gsDomainIterator.h:223
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
const T getPerpendicularCellSize() const
Returns the perpendicular cell size of boundary iterator.
Definition: gsTensorDomainBoundaryIterator.h:159
const gsBasis< T > * m_basis
The basis on which the domain iterator is defined.
Definition: gsDomainIterator.h:219
bool next()
Proceeds to the next element.
Definition: gsTensorDomainBoundaryIterator.h:105
gsVector< T > center
Coordinates of a central point in the element (in the parameter domain).
Definition: gsDomainIterator.h:215
Class that represents the (tensor) Gauss-Legendre quadrature rule.
Definition: gsGaussRule.h:27
short_t direction() const
Returns the parametric direction orthogonal to this side.
Definition: gsBoundary.h:113
size_t numElements() const
Returns the number of elements.
Definition: gsTensorDomainBoundaryIterator.h:165
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
bool next(index_t increment)
Proceeds to the next element (skipping increment elements).
Definition: gsTensorDomainBoundaryIterator.h:116