34 template<
class T,
int D>
38 typedef typename std::vector<T>::const_iterator uiter;
43 : d( breaks_.size() ),
54 for (
int i=0; i < d; ++i)
56 meshEnd[i] = breaks[i].end() - 1;
57 curElement[i] = meshStart[i] = breaks[i].begin();
59 if (meshEnd[i] == meshStart[i])
80 for (
int i=0; i < d; ++i)
82 breaks.push_back(
m_basis->component(i).domain()->breaks() );
84 meshEnd[i] = breaks[i].end() - 1;
85 curElement[i] = meshStart[i] = breaks[i].begin();
87 if (meshEnd[i] == meshStart[i])
110 for (
index_t i = 0; i < increment; i++)
124 curElement = meshStart;
125 m_isGood = ( meshEnd.array() != meshStart.array() ).all() ;
134 for (
int i = 0; i < d; ++i)
135 curr_index[i] = curElement[i] - breaks[i].begin();
141 result.resize( D, 1 << D);
149 for (
int i = 0; i< D; ++i)
150 result(i,r) = ( v[i] ? upper[i] : lower[i] );
161 bool isBoundaryElement()
const
163 for (
int i = 0; i< D; ++i)
164 if ((lower[i]-*meshStart[i]==0) ||
165 (*meshEnd[0]-upper[0] ==0) )
170 index_t domainDim()
const {
return d;}
179 for (
int i = 0; i < d; ++i)
181 lower[i] = *curElement[i];
182 upper[i] = *(curElement[i]+1);
183 center[i] = (T)(0.5) * (lower[i] + upper[i]);
206 std::vector< std::vector<T> > breaks;
218 # define Eigen gsEigen
219 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Re-implements gsDomainIterator for iteration over all elements of a tensor product parameter domain...
Definition: gsTensorDomainIterator.h:35
Provides the Gauss-Legendre quadrature rule.
void reset()
Resets the iterator so that it points to the first element.
Definition: gsTensorDomainIterator.h:121
#define index_t
Definition: gsConfig.h:32
bool next()
Proceeds to the next element.
Definition: gsTensorDomainIterator.h:96
Provides combinatorial unitilies.
void update()
Definition: gsTensorDomainIterator.h:177
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
Provides declaration of DomainIterator abstract interface.
const gsVector< T > & upperCorner() const
Returns the upper corner of the current element.
Definition: gsTensorDomainIterator.h:158
bool next(index_t increment)
Proceeds to the next element (skipping increment elements).
Definition: gsTensorDomainIterator.h:108
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 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
gsVector< unsigned, D > index() const
return the tensor index of the current element
Definition: gsTensorDomainIterator.h:131
const gsVector< T > & lowerCorner() const
Returns the lower corner of the current element.
Definition: gsTensorDomainIterator.h:155
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
bool nextCubeVertex(Vec &cur, const Vec &start, const Vec &end)
Iterate in lexicographic order through the vertices of the cube [start,end]. Updates cur with the cur...
Definition: gsCombinatorics.h:252