Skip to content

Add pseudospectral grid setup utilities and integration/plotting example#41

Merged
haakoek merged 1 commit into
mainfrom
grid_setup
May 20, 2026
Merged

Add pseudospectral grid setup utilities and integration/plotting example#41
haakoek merged 1 commit into
mainfrom
grid_setup

Conversation

@haakoek
Copy link
Copy Markdown
Collaborator

@haakoek haakoek commented May 20, 2026

Summary:

  • Adds reusable setup helpers for pseudospectral grids.
  • Exposes setup helpers from the pseudospectral_grids package namespace.
  • Adds an example that builds multiple grids, plots $f(x) = e^{-x^2}$, and evaluates quadrature integrals against the exact Gaussian integral sqrt(pi).

What changed:

  • Added grid_lib/pseudospectral_grids/setup_grids.py:
    • setup_grid for sinc, gll, and femdvr grids
    • setup_femdvr_uniform convenience constructor
    • mapping and element-class support for flexible construction
  • Updated grid_lib/pseudospectral_grids/init.py:
    • exports Rational_map
    • exports setup_grid and setup_femdvr_uniform from setup_grids
  • Added examples/setup_different_grids.py:
    • configures Sinc DVR, GLL, FEM-DVR, and uniform FEM-DVR grids
    • plots $f(x) = e^{-x^2}$ on each grid in one multi-subplot figure
    • computes quadrature via $sum_i w_i f(x_i)$
    • compares numerical values to the exact full-domain integral $\int_{-\infty}^{\infty} e^{-x^2}dx = \sqrt{\pi}$

@haakoek haakoek merged commit 30271db into main May 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant