35template<
class T,
int D,
typename uiter>
48 : d( breaks_.size() ),
60 for (
int i=0; i < dir; ++i)
62 meshEnd[i] = breaks[i].end() - 1;
63 meshBegin[i] = curElement[i] = breaks[i].begin();
64 if (meshEnd[i] == curElement[i])
68 meshEnd[dir] = ( par ? breaks[dir].end() - 1 : breaks[dir].begin() + 1 );
70 meshBegin[dir] = ( par ? breaks[dir].end() - 2 : breaks[dir].begin() );
71 tindex = curElement[dir] - breaks[dir].begin();
73 for (
int i=dir+1; i < d; ++i)
75 meshEnd[i] = breaks[i].end() - 1;
76 meshBegin[i] = curElement[i] = breaks[i].begin();
78 if (meshEnd[i] == curElement[i])
106 curElement.resize(d);
109 for (
int i=0; i < dir; ++i)
111 breaks.push_back(
m_basis->component(i).domain()->breaks() );
112 meshEnd[i] = breaks[i].end() - 1;
113 meshBegin[i] = curElement[i] = breaks[i].begin();
118 if (meshEnd[i] == curElement[i])
123 breaks.push_back(
m_basis->component(dir).domain()->breaks() );
125 meshEnd[dir] = ( par ? breaks[dir].end() - 1 : breaks[dir].begin() + 1 );
127 meshBegin[dir] = ( par ? breaks[dir].end() - 2 : breaks[dir].begin() );
128 tindex = curElement[dir] - breaks[dir].begin();
137 for (
int i=dir+1; i < d; ++i)
139 breaks.push_back(
m_basis->component(i).domain()->breaks() );
140 meshEnd[i] = breaks[i].end() - 1;
141 meshBegin[i] = curElement[i] = breaks[i].begin();
146 if (meshEnd[i] == curElement[i])
172 for (
index_t i = 0; i < increment; i++)
184 curElement=meshBegin;
186 for(
int i=0; i < d; ++i)
188 if (i!=dir && curElement[i]==meshEnd[i])
199 for (
int i = 0; i < dir; ++i)
200 curr_index[i] = curElement[i] - meshBegin[i];
201 for (
int i = dir+1; i < d; ++i)
202 curr_index[i] = curElement[i] - meshBegin[i];
203 curr_index[dir] = tindex;
215 return *(curElement[dir]+1) - *curElement[dir];
222 for (
short_t i = 0; i < dir; ++i)
223 result *= breaks[i].size() - 1;
224 for (
short_t i = dir+1; i < d; ++i)
225 result *= breaks[i].size() - 1;
239 int a2 = !other_.dir;
241 other_.curElement[a2] = std::lower_bound(
242 other_.breaks[a2].begin(), other_.breaks[a2].end(),
243 orient[0] ? *curElement[a1] : *(curElement[a1]+1) );
250 breaks[i].swap(newBreaks);
251 meshEnd[i] = breaks[i].end() - 1;
252 meshBegin[i] = curElement[i] = breaks[i].begin();
263 for (
int i = 0; i < dir ; ++i)
265 lower[i] = *curElement[i];
266 upper[i] = *(curElement[i]+1);
267 center[i] = (T)(0.5) * (lower[i] + upper[i]);
271 center[dir] = (par ? *(curElement[dir]+1) : *curElement[dir] );
272 for (
int i = dir+1; i < d; ++i)
274 lower[i] = *curElement[i];
275 upper[i] = *(curElement[i]+1);
276 center[i] = (T)(0.5) * (lower[i] + upper[i]);
300 std::vector< std::vector<T> > breaks;
318# define Eigen gsEigen
319 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
bool parameter() const
Returns the parameter value (false=0=start, true=1=end) that corresponds to this side.
Definition gsBoundary.h:128
short_t direction() const
Returns the parametric direction orthogonal to this side.
Definition gsBoundary.h:113
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
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
Class that represents the (tensor) Gauss-Legendre quadrature rule.
Definition gsGaussRule.h:28
Re-implements gsDomainIterator for iteration over all elements of the boundary of a tensor product pa...
Definition gsTensorDomainBoundaryIterator.h:38
const gsVector< T > & upperCorner() const
Returns the upper corner of the current element.
Definition gsTensorDomainBoundaryIterator.h:210
gsVector< unsigned, D > index() const
Return the tensor index of the current element.
Definition gsTensorDomainBoundaryIterator.h:196
bool next(index_t increment)
Proceeds to the next element (skipping increment elements).
Definition gsTensorDomainBoundaryIterator.h:170
const gsVector< T > & lowerCorner() const
Returns the lower corner of the current element.
Definition gsTensorDomainBoundaryIterator.h:207
void setBreaks(std::vector< T > newBreaks, index_t i)
Function to set the breakpoints in direction i manually.
Definition gsTensorDomainBoundaryIterator.h:248
const T getPerpendicularCellSize() const
Returns the perpendicular cell size of boundary iterator.
Definition gsTensorDomainBoundaryIterator.h:213
bool next()
Proceeds to the next element.
Definition gsTensorDomainBoundaryIterator.h:159
void update()
Definition gsTensorDomainBoundaryIterator.h:261
void reset()
Definition gsTensorDomainBoundaryIterator.h:182
gsTensorDomainBoundaryIterator(const gsBasis< T > &b, const boxSide &s)
Constructs a new instance.
Definition gsTensorDomainBoundaryIterator.h:95
gsTensorDomainBoundaryIterator(const std::vector< std::vector< T > > &breaks_, const boxSide &s)
Constructor using explicitly defined breaks.
Definition gsTensorDomainBoundaryIterator.h:47
size_t numElements() const
Returns the number of elements.
Definition gsTensorDomainBoundaryIterator.h:219
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
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
Provides combinatorial unitilies.
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
Provides declaration of DomainIterator abstract interface.
Provides the Gauss-Legendre quadrature rule.
The G+Smo namespace, containing all definitions for the library.