svMultiPhysics
Loading...
Searching...
No Matches
GaussQuadrature.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef SVMP_FE_GAUSS_QUADRATURE_H
5#define SVMP_FE_GAUSS_QUADRATURE_H
6
7/**
8 * @file GaussQuadrature.h
9 * @brief Bounded Gauss-Legendre quadrature generation on the reference line.
10 * @ingroup FE_Quadrature
11 */
12
14
15namespace svmp::FE::quadrature {
16
17/** @addtogroup FE_Quadrature
18 * @{
19 */
20
21/**
22 * @brief Return the largest supported Gauss-Legendre exactness request.
23 * @details Degree 255 corresponds to the internal 128-point project support
24 * bound, which limits generator work and downstream product-rule growth; it
25 * is not a mathematical or convergence limit.
26 * @return The inclusive requested-exactness limit, 255.
27 */
28[[nodiscard]] constexpr int max_gauss_legendre_exactness() noexcept
29{
30 return 255;
31}
32
33/**
34 * @brief Generate a Gauss-Legendre rule on @f$[-1,1]@f$ with at least the
35 * requested exactness.
36 *
37 * @details For @f$d@f$ = @p requested_exactness, integer division gives the
38 * minimum point count @f$n=\lfloor d/2\rfloor+1@f$. The returned metadata reports
39 * the actual polynomial exactness @f$2n-1@f$, which exceeds even requests by one.
40 * Degree zero produces one point with exactness one. Points are the roots of
41 * the Legendre polynomial @f$P_n@f$ of degree @f$n@f$, in strictly increasing
42 * order inside @f$(-1,1)@f$; neither endpoint is included. Weights are positive
43 * and aligned with their points.
44 *
45 * @see [NIST DLMF: Legendre polynomials](https://dlmf.nist.gov/18.3)
46 *
47 * @param requested_exactness Minimum polynomial degree to integrate exactly;
48 * must be in [0, 255], inclusive (see max_gauss_legendre_exactness()).
49 * @return A complete QuadratureRule value for CellFamily::Line.
50 * @throws InvalidArgumentException If @p requested_exactness is outside the
51 * supported range; checked before point-count conversion or allocation.
52 * @throws ConvergenceException If root refinement or final numerical
53 * validation fails.
54 */
55[[nodiscard]] QuadratureRule
56make_gauss_legendre_rule(int requested_exactness);
57
58/** @} */
59
60} // namespace svmp::FE::quadrature
61
62#endif // SVMP_FE_GAUSS_QUADRATURE_H
Value type for reference-space quadrature rules.
constexpr int max_gauss_legendre_exactness() noexcept
Return the largest supported Gauss-Legendre exactness request.
Definition GaussQuadrature.h:28
QuadratureRule make_gauss_legendre_rule(int requested_exactness)
Generate a Gauss-Legendre rule on with at least the requested exactness.
Definition GaussQuadrature.cpp:185