docs(solvers): state for each transform type where the boundary node sits relative to the input array (DST-I/II, DCT-I/II, FFT), with a staggered-grid example

Open
#122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

Start with docs/theory/elliptic_solvers.md and docs/elliptic_solvers_guide.md, then locate the solve_helmholtz_* docstrings and the mktestdocs setup from #95. Add the boundary-location table, the Arakawa C-grid worked example, and the L conventions described in the issue. Done means the snippets run in CI and every solver docstring states its boundary-node location.

Written by the indexing model from the issue text.

Description

documentation

Part of #83. Requested by the finitevolX audit (jejjohnson/finitevolX#300), where every spectral inversion converged at first order because the wrapper passed its full ghost-ringed array to solve_helmholtz_dst.

Summary

The solver docs say things like "DST-I: ψ = 0 on all edges" (docs/theory/elliptic_solvers.md) without saying which nodes are the edges. For a consumer whose unknowns live on a staggered grid this is the whole question:

Transform Unknowns Where the homogeneous BC is imposed L convention
DST-I (solve_helmholtz_dst, dst1) all N input nodes ψ = 0 on virtual nodes at index −1 and N, i.e. half a spacing beyond the first/last input node on a node-centred grid, a full cell beyond on a cell-centred one (N+1)·dx
DST-II (dst2) all N input nodes (cell centres) ψ = 0 on the faces at index −½ and N−½ N·dx
DCT-I (dct1) all N input nodes ∂ψ/∂n = 0 at the first/last node itself (node-centred, mirror) (N−1)·dx
DCT-II (dct, dct2) all N input nodes (cell centres) ∂ψ/∂n = 0 on the faces at −½ and N−½ N·dx
FFT all N periodic with period N·dx N·dx

Measured on a C-grid (finitevolX): passing the full [Ny, Nx] array with a one-cell ghost ring to DST-I puts the Dirichlet wall one full cell outside the physical wall (rate 0.53–0.89); passing the strictly interior X nodes [1:-2, 1:-2] gives rate 2.00.

Proposed fix

  • A "Where is the boundary?" section in docs/theory/elliptic_solvers.md and docs/elliptic_solvers_guide.md with the table above and one worked example: an Arakawa C-grid with ψ at corners and p at centres, showing which slice of the array to pass for Dirichlet (DST-I on the interior corners) and Neumann (DCT-II on the interior centres), and the mirrored-back embedding.
  • The same statement in each solve_helmholtz_* docstring and in the future HelmholtzSolver (#107) docstring, plus the L convention (which #94 already tracks for the _ps builders).
  • A doc-snippet test (via #95's mktestdocs) that runs the example and asserts rate ≥ 1.9.

Acceptance criteria

  • Table and worked example in the docs; snippets execute in CI.
  • Every solver docstring names its boundary-node location in one sentence.
Dominant language
Python
Stars
2
Forks
0
Avg merge
8h 13m
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jejjohnson/spectraldiffx

All issues in jejjohnson/spectraldiffx

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.