comparison src/Grids/equidistant_grid.jl @ 1751:f3d7e2d7a43f feature/sbp_operators/laplace_curvilinear

Merge feature/grids/manifolds
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 11 Sep 2024 16:26:19 +0200
parents 03894fd7b132
children 2a8a2b52a112
comparison
equal deleted inserted replaced
1731:3684db043add 1751:f3d7e2d7a43f
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