Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1748:03894fd7b132 feature/grids/manifolds
Merge feature/grids/curvilinear
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 11 Sep 2024 15:41:58 +0200 |
| parents | a4c52ae93b11 863385aae454 |
| children | 2a8a2b52a112 |
comparison
equal
deleted
inserted
replaced
| 1695:a4c52ae93b11 | 1748:03894fd7b132 |
|---|---|
| 47 """ | 47 """ |
| 48 inverse_spacing(g::EquidistantGrid) = 1/step(g.points) | 48 inverse_spacing(g::EquidistantGrid) = 1/step(g.points) |
| 49 | 49 |
| 50 min_spacing(g::EquidistantGrid) = spacing(g) | 50 min_spacing(g::EquidistantGrid) = spacing(g) |
| 51 | 51 |
| 52 """ | |
| 53 LowerBoundary <: BoundaryIdentifier | |
| 52 | 54 |
| 53 boundary_identifiers(::EquidistantGrid) = (Lower(), Upper()) | 55 Boundary identifier for the the lower (left) boundary of a one-dimensional grid. |
| 54 boundary_grid(g::EquidistantGrid, id::Lower) = ZeroDimGrid(g[begin]) | 56 |
| 55 boundary_grid(g::EquidistantGrid, id::Upper) = ZeroDimGrid(g[end]) | 57 See also: [`BoundaryIdentifier`](@ref) |
| 56 boundary_indices(g::EquidistantGrid, id::Lower) = (1,) | 58 """ |
| 57 boundary_indices(g::EquidistantGrid, id::Upper) = (length(g),) | 59 struct LowerBoundary <: BoundaryIdentifier end |
| 60 | |
| 61 """ | |
| 62 UpperBoundary <: BoundaryIdentifier | |
| 63 | |
| 64 Boundary identifier for the the upper (right) boundary of a one-dimensional grid. | |
| 65 | |
| 66 See also: [`BoundaryIdentifier`](@ref) | |
| 67 """ | |
| 68 struct UpperBoundary <: BoundaryIdentifier end | |
| 69 | |
| 70 | |
| 71 boundary_identifiers(::EquidistantGrid) = (LowerBoundary(), UpperBoundary()) | |
| 72 boundary_grid(g::EquidistantGrid, id::LowerBoundary) = ZeroDimGrid(g[begin]) | |
| 73 boundary_grid(g::EquidistantGrid, id::UpperBoundary) = ZeroDimGrid(g[end]) | |
| 74 boundary_indices(g::EquidistantGrid, id::LowerBoundary) = (firstindex(g),) | |
| 75 boundary_indices(g::EquidistantGrid, id::UpperBoundary) = (lastindex(g),) | |
| 58 | 76 |
| 59 """ | 77 """ |
| 60 refine(g::EquidistantGrid, r::Int) | 78 refine(g::EquidistantGrid, r::Int) |
| 61 | 79 |
| 62 The grid where `g` is refined by the factor `r`. The factor is applied to the number of | 80 The grid where `g` is refined by the factor `r`. The factor is applied to the number of |
