Mercurial > repos > public > sbplib_julia
comparison docs/src/grids_and_grid_functions.md @ 2057:8a2a0d678d6f feature/lazy_tensors/pretty_printing
Merge default
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 10 Feb 2026 22:41:19 +0100 |
| parents | ee3fc2d83c73 |
| children |
comparison
equal
deleted
inserted
replaced
| 1110:c0bff9f6e0fb | 2057:8a2a0d678d6f |
|---|---|
| 1 # Grids and grid functions | |
| 2 | |
| 3 The submodule `Grids` aims to provide types and logic for all types of grids that are useful for implementing summation-by-parts difference methods. It provides an abstract top level type `Grid` which defines a broad interface for how a general grid is supposed to work. Currently only equidistant grids are supported, but the basic structure supports implementations of curvilinear grids, multi-block grids, periodic grids and much more. | |
| 4 | |
| 5 The module also has functionality for creating and working with grid functions. | |
| 6 | |
| 7 ## Interface for grids | |
| 8 All grids are expected to work as a grid function for the coordinate function, and thus implements Julia's Indexing- and Iteration-interfaces. Notably they are *not* abstract arrays because that inteface is too restrictive for the types of grids we wish to implement. | |
| 9 | |
| 10 | |
| 11 ## Plotting | |
| 12 Plotting of grids and grid functions is supported through a package extension with Makie.jl. | |
| 13 | |
| 14 For grids we have: | |
| 15 * `plot(::Grid{<:Any,2})` (same as `lines`) | |
| 16 * `lines(::Grid{<:Any,2})` | |
| 17 * `scatter(::Grid{<:Any,2})` | |
| 18 | |
| 19 For 1D grid functions we have: | |
| 20 * `plot(::Grid{<:Any,1}, ::AbstractVector)` (same as `lines`) | |
| 21 * `lines(::Grid{<:Any,1}, ::AbstractVector)` | |
| 22 * `scatter(::Grid{<:Any,1}, ::AbstractVector)` | |
| 23 | |
| 24 For 2D grid functions we have: | |
| 25 * `plot(::Grid{<:Any,2}, ::AbstractArray{<:Any,2})` (constructs a 2d mesh) | |
| 26 * `surface(::Grid{<:Any,2}, ::AbstractArray{<:Any,2})` | |
| 27 | |
| 28 ## To write about | |
| 29 <!-- # TODO: --> | |
| 30 * Grid functions | |
| 31 * Basic structure | |
| 32 * Indexing | |
| 33 * Curvilinear | |
| 34 * Multiblock | |
| 35 * Vector valued grid functions |
