For editable models with equations and checked output, browse the C++ tutorials.
Follow one equation through its numerical choices
Consider diffusion, \(u_t=D u_{xx}\). The equation is short, but a program must still choose a grid, approximate derivatives, advance time and decide whether its result is trustworthy. Changing one of those choices can change accuracy, stability and computational cost.
Start with One equation, six experiments: a complete path from sampling through derivatives, diffusion and controlled error studies to a checked C++ run and MPI comparison. Four interactive experiments offer shareable setups and CSV downloads. Every chapter has a worked checkpoint.
Explore / Chapters 1–4
Predict it in the browser
Find an alias, differentiate the same field, cross a stability boundary and measure convergence while keeping the physical problem fixed. Begin with sampling.
Implement / Chapters 5–6
Check it in C++ and MPI
Run the canonical diffusion starter. Compare every owned value with an independent discrete formula, then change rank count without changing the global problem. Run the checked model.
Continue with nonlinear Fourier methods
The nonlinear spectral course follows periodic Allen–Cahn dynamics through FFT conventions, cubic dealiasing, exponential Heun time stepping, a runnable OpenPFC model and distributed FFT ownership. Its independent reference uses direct coefficient convolution and RK4.
Second course / Mathematics
Multiply modes without inventing low frequencies
Inspect complex Fourier coefficients, compare quadratic and cubic product padding, and measure ETD1/ETD2 time orders at a fixed spatial cutoff. Begin the Fourier course.
Second course / Implementation
Check a real nonlinear FFT solver
Run the canonical C++ model, compare its output with an independent Galerkin reference, and inspect actual MPI inbox/outbox ownership. Run the nonlinear model.
Work through the native C++ lessons
OpenPFC by example extends this path into physical grids, interpolation, quadrature, Fourier and Chebyshev operators, eigenvalue problems, boundary-value solves and wave evolution. Read the mathematical argument, inspect the C++ source, then run the model and compare its result with the stated reference.
Build a map of the subject
| Question | Continue with |
|---|---|
| What does a grid resolve? | Sampling and aliasing |
| What does the FFT change? | Fourier differentiation and the OpenPFC spectral stack |
| How do space and time errors interact? | Diffusion and stability |
| Which boundary conditions does a method assume? | Numerical scope and limits |
| How do local stencils work on many ranks? | MPI and halo exchange |
| Where do linear solves fit? | Krylov methods and multigrid |
| How do I implement the idea? | Runnable examples and the extension guide |
Use an independent answer
A known derivative, a conserved mean or a mode with an exact decay rate lets you test an implementation without comparing it only with itself. Refine the grid while controlling the other errors. Refine the time step at a fixed final time. Change rank count while keeping the global problem fixed. Each comparison asks a different question.
Accuracy is not stability. A method can approximate a derivative very well and still amplify a time-stepping error. Conservation is not full accuracy either: a method can keep the mean while getting the shape wrong. The experiments make those distinctions visible before you meet them in a larger simulation.
Read, predict, change, check
Before moving a slider, predict which curve should move and why. Try to find a parameter that breaks your prediction. Then run an example in C++, inspect its numerical output and connect the result to the same argument. The getting-started path takes you from an installed SDK to your first editable model and its results.
For a deeper treatment, Lloyd N. Trefethen’s Spectral Methods in MATLAB and freely available Finite Difference and Spectral Methods develop the mathematics with short programs and exercises. The lessons here use elementary periodic examples to connect those ideas to OpenPFC.