comparison src/Grids/equidistant_grid.jl @ 1736:863385aae454 feature/grids/curvilinear

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 10 Sep 2024 21:59:10 +0200
parents 3ac94e8f28b3 b5690ab5f0b8
children 03894fd7b132 244311761969 871f3f1decea
comparison
equal deleted inserted replaced
1735:36986b75bf98 1736:863385aae454
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