comparison src/Grids/equidistant_grid.jl @ 1531:9da4ab4fb85e bugfix/sbp_operators/stencil_return_type

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 11 Apr 2024 22:50:42 +0200
parents d7bc11053951
children 4df668d00d03 43aaf710463e
comparison
equal deleted inserted replaced
1456:f13857f37b8f 1531:9da4ab4fb85e
49 49
50 50
51 boundary_identifiers(::EquidistantGrid) = (Lower(), Upper()) 51 boundary_identifiers(::EquidistantGrid) = (Lower(), Upper())
52 boundary_grid(g::EquidistantGrid, id::Lower) = ZeroDimGrid(g[begin]) 52 boundary_grid(g::EquidistantGrid, id::Lower) = ZeroDimGrid(g[begin])
53 boundary_grid(g::EquidistantGrid, id::Upper) = ZeroDimGrid(g[end]) 53 boundary_grid(g::EquidistantGrid, id::Upper) = ZeroDimGrid(g[end])
54 54 boundary_indices(g::EquidistantGrid, id::Lower) = (1,)
55 boundary_indices(g::EquidistantGrid, id::Upper) = (length(g),)
55 56
56 """ 57 """
57 refine(g::EquidistantGrid, r::Int) 58 refine(g::EquidistantGrid, r::Int)
58 59
59 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
100 The number of equispaced points in each coordinate direction are given 101 The number of equispaced points in each coordinate direction are given
101 by the tuple `size`. 102 by the tuple `size`.
102 103
103 Note: If `limit_lower` and `limit_upper` are integers and `size` would allow a 104 Note: If `limit_lower` and `limit_upper` are integers and `size` would allow a
104 completely integer grid, `equidistant_grid` will still return a floating point 105 completely integer grid, `equidistant_grid` will still return a floating point
105 grid. This simlifies the implementation and avoids certain surprise 106 grid. This simplifies the implementation and avoids certain surprise
106 behaviours. 107 behaviors.
107 """ 108 """
108 function equidistant_grid(size::Dims, limit_lower, limit_upper) 109 function equidistant_grid(size::Dims, limit_lower, limit_upper)
109 gs = map(equidistant_grid, size, limit_lower, limit_upper) 110 gs = map(equidistant_grid, size, limit_lower, limit_upper)
110 return TensorGrid(gs...) 111 return TensorGrid(gs...)
111 end 112 end