svMultiPhysics
Loading...
Searching...
No Matches
GaussLobattoNodes.h
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_LOBATTO_NODES_H
5#define SVMP_FE_GAUSS_LOBATTO_NODES_H
6
7#include <cstddef>
8
9namespace svmp::FE::quadrature::detail {
10
11/** @cond INTERNAL */
12
13// Shared node refinement for interpolation and integration. The Legendre
14// value is retained so Quadrature can form a weight without another recurrence.
15struct GaussLobattoNode {
16 double coordinate;
17 double legendre_value; // P_(num_points-1) at coordinate.
18 int iterations;
19};
20
21// Refine a nonnegative interior node of an n-point GLL distribution on [-1, 1].
22// half_root_index runs from the positive endpoint toward the center, starting
23// at zero; an odd distribution's center is returned as exactly zero.
24// Requires n >= 3, index < (n-1)/2, and a finite positive correction tolerance.
25// Invalid requests throw InvalidArgumentException; unsuccessful refinement
26// throws ConvergenceException. Callers own endpoints, mirroring, and size caps.
27[[nodiscard]] GaussLobattoNode refine_gauss_lobatto_node(
28 std::size_t num_points, std::size_t half_root_index,
29 double correction_tolerance);
30
31/** @endcond */
32
33} // namespace svmp::FE::quadrature::detail
34
35#endif // SVMP_FE_GAUSS_LOBATTO_NODES_H