Nodes1D: Nodal points for Quadrature and Interpolation - #587
Conversation
aaadelmann
left a comment
There was a problem hiding this comment.
In general is a function is KOKKOS_INLINE_FUNCTION labled or not seams to me a bit random.
The Code Snippets which this submodule is based on are from the NUFFTUtilities and the Quadrature Code from FEM. Both of them do Node computation exclusively on Host side. Since Nodes computation is usually only run once during initialisation, with relatively small n (for FEM n<10 and for NUFFT n=100). So I guess for simplicity, there was reduced focus on performance. All of computeGauss*** methods are therefor like before written as pure host functions. The few functions writtten with KOKKOS are small functions that "should" be inlined, but instead of So if you wan't I can either switch it all to |
…auss* functions + clear comments in unit test
|
I will now additional wire up FEM/Quadrature to use, the Nodes1D module. |
Nodes1D
Adds a header-only ippl::nodes1d module for classical 1D quadrature (or interpolation) nodes and weights.
Functionalities
Includes: Gauss–Jacobi, Gauss–Legendre, Gauss–Lobatto (GLL), and Gauss–Chebyshev (closed form).
Also provides Affine maps for nodes/weights from [-1,1] onto other intervals.
Configurable backends for Root Finding:
Configuable Initial Guesses for Gauss Jacobi Newton Root finding:
Fallback Ladder for Newton Root Finders
computeGaussJacobiIf not all n nodes/roots are found by a newton method, it tries to find additional nodes, by rerunning with different initial guesses or the brent method.
LehrFEM
primary Guess:
InitialGuessType(Asymptotic | Chebyshev | StroudSecrest)→ Asymptotic (if not already primary)
→ Chebyshev (if not already primary)
→ Brent (scans samples of P_n on (-1,1) for sign changes; Brent on each bracket)
→ throw
computeGaussLobattoNo user
InitialGuessType.Endpoints$\pm 1$ ($j = 0$ and $j=n-1$ ) are fixed. Each interior node (roots of $P_{n-1}'$ ) is found from left to right ($j = 1,\ldots,n-2$ ) one after the other. If the j'th node is not found by the first method, the next method in the ladder is attempted and so on.
Asymptotic Jacobi(1,1)
→ Cosine (Chebyshev–Lobatto: -cos((j+1) π / (n-1)))
→ Brent (scans samples of P_{n-1}' on (lo, hi) for sign-change, then widen toward +1 if needed)
→ throw
Here$(j-1)$ and $j$ and $j+1$ . GLL therefore never retries a later guess family for all interiors at once; it finishes one interior before starting the next.
lois the previous accepted nodehiis the midpoint of the raw asymptotic guesses for interiorsConsumers
Tests:
unit_tests/Nodes1D/
Nodes1D.cpp:
Large test suite set which checks all root finding backends (except LehrFEM...) over the subset of data that is provided in
Nodes1DOracleData.h
Nodes1DOracleData.h:
File providing test data for nodes and weight finding for node samples (2, 3, 7, 10, 17, 64) + test data for the affine map functionality for the 7 Nodes test case.
create_Nodes1DOracleData.py:
Provides Python script which creates the file Nodes1DOracleData.h:. If needed we can produce a large set of test data.
by changing
and then Nodes1D.cpp test suite should still work without any adaptations.