G+Smo
24.08.0
Geometry + Simulation Modules
|
Class representing a reference quadrature rule.
Public Member Functions | |
index_t | dim () const |
Dimension of the rule. | |
gsQuadRule () | |
Default empty constructor. | |
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. More... | |
virtual void | mapTo (T startVal, T endVal, gsMatrix< T > &nodes, gsVector< T > &weights) const |
Maps a univariate quadrature rule (i.e., points and weights) from the reference interval to an arbitrary interval. | |
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 of intervals, implied by the breaks. | |
index_t | numNodes () const |
Number of nodes in the currently kept rule. | |
const gsMatrix< T > & | referenceNodes () const |
Returns reference nodes for the currently kept rule. More... | |
const gsVector< T > & | referenceWeights () const |
Returns reference weights for the currently kept rule. More... | |
virtual void | setNodes (gsVector< index_t > const &, unsigned=0) |
Initialize quadrature rule with numNodes number of quadrature points per integration variable. More... | |
void | setNodes (index_t numNodes, unsigned digits=0) |
Initialize a univariate quadrature rule with numNodes quadrature points. More... | |
Protected Member Functions | |
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. | |
Protected Attributes | |
gsMatrix< T > | m_nodes |
Reference quadrature nodes (on the interval [-1,1]). | |
gsVector< T > | m_weights |
Reference quadrature weights (corresponding to interval [-1,1]). | |
|
inlinevirtual |
Maps quadrature rule (i.e., points and weights) from the reference domain to an element.
The currently kept rule (which is initialized on the reference hypercube [-1,1]^d by calling setNodes()) is mapped to the d-dimensional hypercube specified by lower and upper.
For example, for d=2, the square [a,b]x[c,d] is defined by lower = [a,c], upper = [b,d].
[in] | lower | vector of length d, defining the coordinates of the lower corner of the hypercube. |
[in] | upper | vector of length d, defining the coordinates of the upper corner of the hypercube. |
[in,out] | nodes | will be overwritten with the coordinates of the quadrature nodes. Size of the matrix nodes = d x n, where d is the dimension of the element, and n is the number of quadrature points. |
[in,out] | weights | will be overwritten with the corresponding Gauss quadrature weights. Length of the vector weights = number of quadrature nodes. |
Reimplemented in gsPatchRule< T >, and gsOverIntegrateRule< T >.
|
inline |
Returns reference nodes for the currently kept rule.
|
inline |
Returns reference weights for the currently kept rule.
Initialize quadrature rule with numNodes number of quadrature points per integration variable.
The call of this function initializes the quadrature rule for further use, i.e., the quadrature points and weights on the reference cube are set up and stored. The dimension d of the reference cube is specified by the length of the vector numNodes.
Example: numNodes = [2,5] corresponds to quadrature in 2D where two quadrature points are used for the first coordinate and five quadrature points for the second coordinate. In this case, 2*5 = 10 quadrature nodes and weights are set up.
Parameters
numNodes vector of length digits containing numbers of nodes to be used (per integration variable).
digits accuracy of nodes and weights. If 0, the quadrature rule will use precomputed tables if possible. If greater then 0, it will force to compute it everytime.
Reimplemented in gsGaussRule< T >, gsNewtonCotesRule< T >, and gsLobattoRule< T >.
|
inline |
Initialize a univariate quadrature rule with numNodes quadrature points.
numNodes | quadrature point |
digits | accuracy of nodes and weights. If 0, the quadrature rule will use precomputed tables if possible. If greater then 0, it will force to compute it everytime. |