|
svMultiPhysics
|
Integration rules on canonical reference cells. More...
Files | |
| file | GaussLobattoQuadrature.cpp |
| Exactness-requested generation of bounded Gauss-Lobatto-Legendre line rules. | |
| file | GaussLobattoQuadrature.h |
| Bounded Gauss-Lobatto-Legendre quadrature generation on the reference line. | |
| file | GaussQuadrature.cpp |
| Exactness-requested generation of bounded Gauss-Legendre line rules. | |
| file | GaussQuadrature.h |
| Bounded Gauss-Legendre quadrature generation on the reference line. | |
| file | QuadratureRule.cpp |
| Internal construction and structural validation for quadrature rules. | |
| file | QuadratureRule.h |
| Value type for reference-space quadrature rules. | |
| file | SymmetricTriangleQuadrature.cpp |
| Fixed, contained Dunavant tables and ordered symmetry expansion. | |
| file | SymmetricTriangleQuadrature.h |
| Contained Dunavant rules on the unit right triangle. | |
| file | TriangleQuadrature.cpp |
| Validated composition of supplied line quadrature into triangle rules. | |
| file | TriangleQuadrature.h |
| Centroid and bounded Duffy quadrature on the unit right triangle. | |
Classes | |
| class | svmp::FE::quadrature::QuadratureRule |
| Owning value type for quadrature rules on canonical reference cells. More... | |
Typedefs | |
| using | svmp::FE::quadrature::QuadPoint = math::Vector<double, 3> |
| Three-component coordinate used for every reference quadrature point. | |
Functions | |
| constexpr int | svmp::FE::quadrature::max_gauss_lobatto_exactness () noexcept |
| Return the largest supported Gauss-Lobatto-Legendre exactness request. | |
| QuadratureRule | svmp::FE::quadrature::make_gauss_lobatto_rule (int requested_exactness) |
| Generate a Gauss-Lobatto-Legendre rule on \([-1,1]\) with at least the requested exactness. | |
| constexpr int | svmp::FE::quadrature::max_gauss_legendre_exactness () noexcept |
| Return the largest supported Gauss-Legendre exactness request. | |
| QuadratureRule | svmp::FE::quadrature::make_gauss_legendre_rule (int requested_exactness) |
| Generate a Gauss-Legendre rule on \([-1,1]\) with at least the requested exactness. | |
| constexpr int | svmp::FE::quadrature::max_symmetric_triangle_exactness () noexcept |
| Return the largest supported symmetric triangle exactness. | |
| QuadratureRule | svmp::FE::quadrature::make_symmetric_triangle_rule (int requested_exactness) |
| Return the smallest Dunavant rule meeting the requested degree. | |
| constexpr int | svmp::FE::quadrature::max_triangle_exactness () noexcept |
| Return the project bound on requested triangle exactness. | |
| QuadratureRule | svmp::FE::quadrature::make_triangle_centroid_rule () |
| Return the degree-one centroid rule: point \((1/3,1/3,0)\), weight \(1/2\). | |
| QuadratureRule | svmp::FE::quadrature::make_triangle_rule (int requested_exactness, const QuadratureRule &u_rule, const QuadratureRule &v_rule) |
| Compose two canonical line rules into a Duffy triangle rule. | |
| QuadratureRule | svmp::FE::quadrature::make_triangle_rule (int requested_exactness, const QuadratureRule &line_rule) |
| Reuse one line rule in both Duffy directions. | |
Integration rules on canonical reference cells.
A QuadratureRule owns ordered reference coordinates and weights for
\[ \int_{\hat K} f(\hat x)\,d\hat x \approx \sum_q w_q f(\hat x_q). \]
Supported families use these canonical reference cells:
| Family | Reference cell | Measure |
|---|---|---|
| Point | \((0,0,0)\) | \(1\) |
| Line | \([-1,1]\) | \(2\) |
| Triangle | \(\{(x,y):x,y\geq0,\ x+y\leq1\}\) | \(1/2\) |
| Quad | \([-1,1]^2\) | \(4\) |
| Tetra | \(\{(x,y,z):x,y,z\geq0,\ x+y+z\leq1\}\) | \(1/6\) |
| Hex | \([-1,1]^3\) | \(8\) |
| Wedge | unit triangle \(\times[-1,1]\) | \(1\) |
The family therefore determines both reference dimension and cell measure. Quadrature points are not required to lie inside the reference cell. Generating code is responsible for verifying weight normalization and declared polynomial exactness through analytic moment tests.
| using svmp::FE::quadrature::QuadPoint = math::Vector<double, 3> |
Three-component coordinate used for every reference quadrature point.
Only the first QuadratureRule::dimension() components are active; remaining components must be zero.
|
nodiscard |
Generate a Gauss-Legendre rule on \([-1,1]\) with at least the requested exactness.
For \(d\) = requested_exactness, integer division gives the minimum point count \(n=\lfloor d/2\rfloor+1\). The returned metadata reports the actual polynomial exactness \(2n-1\), which exceeds even requests by one. Degree zero produces one point with exactness one. Points are the roots of the Legendre polynomial \(P_n\) of degree \(n\), in strictly increasing order inside \((-1,1)\); neither endpoint is included. Weights are positive and aligned with their points.
| requested_exactness | Minimum polynomial degree to integrate exactly; must be in [0, 255], inclusive (see max_gauss_legendre_exactness()). |
| InvalidArgumentException | If requested_exactness is outside the supported range; checked before point-count conversion or allocation. |
| ConvergenceException | If root refinement or final numerical validation fails. |
|
nodiscard |
Generate a Gauss-Lobatto-Legendre rule on \([-1,1]\) with at least the requested exactness.
For \(d\) = requested_exactness, integer division gives the minimum point count \(n=\lfloor d/2\rfloor+2\). The returned metadata reports the actual polynomial exactness \(2n-3\), which exceeds even requests by one. Degree zero produces two points with exactness one. The first and last points are exactly \(-1\) and \(+1\). When present, the \(n-2\) interior points are the roots of \(P'_{n-1}\), the derivative of the Legendre polynomial of degree \(n-1\). Points are strictly increasing, and weights are positive and aligned with their points.
| requested_exactness | Minimum polynomial degree to integrate exactly; must be in [0, 253], inclusive (see max_gauss_lobatto_exactness()). |
| InvalidArgumentException | If requested_exactness is outside the supported range; checked before point-count conversion or allocation. |
| ConvergenceException | If root refinement or final numerical validation fails. |
|
nodiscard |
Return the smallest Dunavant rule meeting the requested degree.
Reference: D. A. Dunavant (1985), High degree efficient symmetrical Gaussian quadrature rules for the triangle. https://doi.org/10.1002/nme.1620210612
The reference tabulates rules of degrees 1 to 20. Rules 11, 15, 16, 18, and 20 place some points outside the triangle, where the integrand may not be defined, so only degrees 1–10, 12, 13, 14, 17, and 19 are implemented. A request for any other degree returns the next higher implemented one (request 0 returns the degree-1 centroid rule); polynomial_exactness() reports the delivered degree.
The rules are symmetric: points come in groups of one (the centroid), three, or six that share a weight, each group being the permutations of one point's barycentric coordinates \((1-x-y,x,y)\). Groups follow the reference's order.
Points lie in the unit triangle \(x,y\geq0,\ x+y\leq1\), with third coordinate exactly zero. Weights sum to the area \(1/2\) within \(5\cdot10^{-15}\), the rounding of the reference's 15-digit tables. The degree-3 and degree-7 rules have a negative weight at the centroid, as in the reference. No clipping or renormalization is applied.
| [in] | requested_exactness | Minimum total degree in [0, 19], inclusive. |
| InvalidArgumentException | If the request is outside [0, 19], checked before table selection or allocation. |
|
nodiscard |
Return the degree-one centroid rule: point \((1/3,1/3,0)\), weight \(1/2\).
|
nodiscard |
Reuse one line rule in both Duffy directions.
Equivalent to make_triangle_rule(requested_exactness, line_rule, line_rule), with the same validation and sample-preservation contracts.
| requested_exactness | Minimum total degree \(p\); must be in [0, 254], inclusive (see max_triangle_exactness()). |
| line_rule | Canonical Line rule with \(1\leq n\leq128\) points and trusted exactness \(e\geq p+1\). |
|
nodiscard |
Compose two canonical line rules into a Duffy triangle rule.
Duffy maps the unit square onto \(x,y\geq0,\ x+y\leq1\) by \((x,y)=(u,(1-u)v)\), collapsing the edge \(u=1\) to vertex \((1,0)\). For supplied points \(\xi_i,\eta_j\) and weights \(a_i,b_j\),
\[u_i=(\xi_i+1)/2,\quad v_j=(\eta_j+1)/2,\quad \mathbf{x}_{ij}=(u_i,(1-u_i)v_j,0),\quad W_{ij}=a_i b_j(1-u_i)/4. \]
Weights include the Jacobian \(1-u\) and both interval scalings. Including the Jacobian, \(x^a y^b\) becomes \(u^a(1-u)^{b+1}v^b\); total degree \(p\) therefore requires \(e_u\geq p+1\) and \(e_v\geq p\).
Factors may come from different line generators and have different point counts; both are used as supplied. Select make_triangle_centroid_rule() for the centroid. All samples are kept in input order (i outer, j inner), including duplicates and collapsed points. Signed/zero weights are allowed. Duffy rules are not permutation-symmetric triangle tables.
Each rule requires \(|\sum w-M|\leq\tau\max(M,\sum|w|)\), with \(M=2\) for each line, \(M=1/2\) for the triangle, and \(\tau=256\epsilon\) for binary64 machine epsilon \(\epsilon\). Mapped points lie in the triangle up to rounding; no clipping or weight rescaling is performed.
| requested_exactness | Minimum total degree \(p\); must be in [0, 254], inclusive (see max_triangle_exactness()). |
| u_rule | Nonempty canonical Line rule on \([-1,1]\) with trusted \(e_u\geq p+1\). |
| v_rule | Nonempty canonical Line rule on \([-1,1]\) with trusted \(e_v\geq p\). |
| InvalidArgumentException | If the request or factors violate these contracts, or \(n_u n_v\) exceeds 16384; checked before product allocation. |
| ConvergenceException | If the mapped weights do not reproduce measure \(1/2\), for example after an overflowed product or when u_rule does not integrate linear functions exactly. |
|
nodiscardconstexprnoexcept |
Return the largest supported Gauss-Legendre exactness request.
Degree 255 corresponds to the internal 128-point project support bound, which limits generator work and downstream product-rule growth; it is not a mathematical or convergence limit.
|
nodiscardconstexprnoexcept |
Return the largest supported Gauss-Lobatto-Legendre exactness request.
Degree 253 corresponds to the internal 128-point project support bound, including both endpoints, which limits generator work and downstream product-rule growth; it is not a mathematical or convergence limit.
|
nodiscardconstexprnoexcept |
Return the largest supported symmetric triangle exactness.
|
nodiscardconstexprnoexcept |
Return the project bound on requested triangle exactness.