Handle Spherical SL solutions for large harmonic orders#152
Handle Spherical SL solutions for large harmonic orders#152michael-petersen merged 19 commits intodevelfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a solution to handle large harmonic orders in spherical Sturm-Liouville (SL) solutions by restricting the evaluation grid for large harmonic orders where the radial dependencies (
- Introduces adaptive grid boundaries for SL solver based on harmonic order to prevent convergence issues
- Refactors variable names for clarity (LMAX→LMAXFID, NMAX→NMAXFID, NORDER→NMAX)
- Adds improved spherical harmonic evaluation with prenormalized recursion for numerical stability
- Enhances debug output and MPI-aware console messaging
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/ICs/check_coefs2.cc | Major refactor of parameter names, improved MPI output handling, and debug features |
| utils/ICs/DiskEval.cc | Added MPI-aware console output and improved thread handling |
| utils/ICs/DiskEval.H | Implemented prenormalized spherical harmonic evaluation for numerical stability |
| include/SLGridMP2.H | Added static constants for grid boundary heuristics |
| exputil/SLGridMP2.cc | Core implementation of adaptive grid boundaries and enhanced SL solver diagnostics |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ndr, FlatDisk, Sphere, and SphericalBasis
|
I appended a bunch of comment changes to this commit for the sole purpose of checking how they are rendered in the Doxygen+Breathe+Sphinx generation of the manual. I probably should have made a separate PR for this, sorry about that. Anyway, seems good to me. The lists of YAM configuration parameters is not particular front and center, but they are easy enough to find. A bunch of classes already have documented YAML keys, btw. |
|
I think we can go ahead and merge this one. Or perhaps there are some additional tests that we need? |
What
The inner and outer solutions to the Laplace equation scale as$r^l$ and $r^{-1-1}$ respectively. These very strong radial dependencies break the convergence of the SL solver in the tails. The solution is to restrict the evaluation grid of the SL solver for large r, replacing the tabulated values with zero.
Implementation
Tests
slcheckto verify that thatSLGridSphgenerates orthogonal bases in both scalar and MPI modesNotes
compute_tableso the risk of breaking existing behavior is low.ncylrfrom the default value of 2000 to something proportionately higher. E.g. at least 10000 or more for