32 typedef memory::unique_ptr<gsQuadRule> uPtr;
140 virtual void mapTo( T startVal, T endVal,
147 void mapToAll(
const std::vector<T> & breaks,
157 void computeTensorProductRule_into(
const std::vector<
gsVector<T> > & nodes,
176 template<
class T>
void
180 const index_t d = lower.size();
181 GISMO_ASSERT( d == m_nodes.rows(),
"Inconsistent quadrature mapping");
183 nodes.resize( m_nodes.rows(), m_nodes.cols() );
184 weights.resize( m_weights.size() );
190 nodes.noalias() = ( h.asDiagonal() * (m_nodes.array()+1).matrix() ).colwise() + lower;
193 for (
index_t i = 0; i!=d; ++i)
196 hprod *= ( 0 == h[i] ? (T)(0.5) : h[i] );
200 weights.noalias() = hprod * m_weights;
205 #ifndef GISMO_BUILD_LIB
206 #include GISMO_HPP_HEADER(gsQuadRule.hpp)
Class representing a reference quadrature rule.
Definition: gsQuadRule.h:28
void setNodes(index_t numNodes, unsigned digits=0)
Initialize a univariate quadrature rule with numNodes quadrature points.
Definition: gsQuadRule.h:74
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
const gsMatrix< T > & referenceNodes() const
Returns reference nodes for the currently kept rule.
Definition: gsQuadRule.h:90
#define index_t
Definition: gsConfig.h:32
gsQuadRule()
Default empty constructor.
Definition: gsQuadRule.h:35
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
gsVector< T > m_weights
Reference quadrature weights (corresponding to interval [-1,1]).
Definition: gsQuadRule.h:170
void computeTensorProductRule(const std::vector< gsVector< T > > &nodes, const std::vector< gsVector< T > > &weights)
Computes the tensor product rule from coordinate-wise 1D nodes and weights.
Definition: gsQuadRule.hpp:80
gsMatrix< T > m_nodes
Reference quadrature nodes (on the interval [-1,1]).
Definition: gsQuadRule.h:166
virtual void mapTo(const gsVector< T > &lower, const gsVector< T > &upper, gsMatrix< T > &nodes, gsVector< T > &weights) const
Maps quadrature rule (i.e., points and weights) from the reference domain to an element.
Definition: gsQuadRule.h:177
index_t dim() const
Dimension of the rule.
Definition: gsQuadRule.h:109
const gsVector< T > & referenceWeights() const
Returns reference weights for the currently kept rule.
Definition: gsQuadRule.h:100
virtual void setNodes(gsVector< index_t > const &, unsigned=0)
Initialize quadrature rule with numNodes number of quadrature points per integration variable...
Definition: gsQuadRule.h:62
This is the main header file that collects wrappers of Eigen for linear algebra.
void mapToAll(const std::vector< T > &breaks, gsMatrix< T > &nodes, gsVector< T > &weights) const
Maps a univariate quadrature rule (i.e., points and weights) from the reference interval to a number ...
Definition: gsQuadRule.hpp:52
index_t numNodes() const
Number of nodes in the currently kept rule.
Definition: gsQuadRule.h:106