comparison src/Grids/equidistant_grid.jl @ 1480:4550beef9694 feature/boundary_conditions

Merge with default
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Sat, 23 Dec 2023 23:03:13 +0100
parents 37cf9f79caa4
children 553111a15506 d7bc11053951
comparison
equal deleted inserted replaced
1479:b96858a50e35 1480:4550beef9694
27 Base.iterate(g::EquidistantGrid, state) = iterate(g.points, state) 27 Base.iterate(g::EquidistantGrid, state) = iterate(g.points, state)
28 28
29 Base.IteratorSize(::Type{<:EquidistantGrid}) = Base.HasShape{1}() 29 Base.IteratorSize(::Type{<:EquidistantGrid}) = Base.HasShape{1}()
30 Base.length(g::EquidistantGrid) = length(g.points) 30 Base.length(g::EquidistantGrid) = length(g.points)
31 Base.size(g::EquidistantGrid) = size(g.points) 31 Base.size(g::EquidistantGrid) = size(g.points)
32 Base.size(g::EquidistantGrid, d) = size(g.points)[d]
32 33
33 34
34 """ 35 """
35 spacing(grid::EquidistantGrid) 36 spacing(grid::EquidistantGrid)
36 37
48 49
49 50
50 boundary_identifiers(::EquidistantGrid) = (Lower(), Upper()) 51 boundary_identifiers(::EquidistantGrid) = (Lower(), Upper())
51 boundary_grid(g::EquidistantGrid, id::Lower) = ZeroDimGrid(g[begin]) 52 boundary_grid(g::EquidistantGrid, id::Lower) = ZeroDimGrid(g[begin])
52 boundary_grid(g::EquidistantGrid, id::Upper) = ZeroDimGrid(g[end]) 53 boundary_grid(g::EquidistantGrid, id::Upper) = ZeroDimGrid(g[end])
53 54 boundary_indices(g::EquidistantGrid, id::Lower) = (1,)
55 boundary_indices(g::EquidistantGrid, id::Upper) = (length(g),)
54 56
55 """ 57 """
56 refine(g::EquidistantGrid, r::Int) 58 refine(g::EquidistantGrid, r::Int)
57 59
58 The grid where `g` is refined by the factor `r`. The factor is applied to the number of 60 The grid where `g` is refined by the factor `r`. The factor is applied to the number of