Mercurial > repos > public > sbplib_julia
comparison src/Grids/EquidistantGrid.jl @ 666:94fe0761e6f9 feature/laplace_opset
Merge in changes from default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sun, 31 Jan 2021 20:59:29 +0100 |
parents | f0ceddeae993 |
children | 1d3e29ffc6c6 |
comparison
equal
deleted
inserted
replaced
663:f1803ab08740 | 666:94fe0761e6f9 |
---|---|
44 """ | 44 """ |
45 dimension(grid::EquidistantGrid) | 45 dimension(grid::EquidistantGrid) |
46 | 46 |
47 The dimension of the grid. | 47 The dimension of the grid. |
48 """ | 48 """ |
49 function dimension(grid::EquidistantGrid) | 49 dimension(grid::EquidistantGrid{Dim}) where Dim = Dim |
50 return length(grid.size) | |
51 end | |
52 | |
53 | 50 |
54 """ | 51 """ |
55 spacing(grid::EquidistantGrid) | 52 spacing(grid::EquidistantGrid) |
56 | 53 |
57 The spacing between the grid points of the grid. | 54 The spacing between the grid points of the grid. |
93 limit_upper = grid.limit_upper[dim] | 90 limit_upper = grid.limit_upper[dim] |
94 | 91 |
95 return EquidistantGrid(size, limit_lower, limit_upper) | 92 return EquidistantGrid(size, limit_lower, limit_upper) |
96 end | 93 end |
97 export restrict | 94 export restrict |
95 | |
96 """ | |
97 boundary_identifiers(::EquidistantGrid) | |
98 | |
99 Returns a tuple containing the boundary identifiers for the grid, stored as | |
100 (CartesianBoundary(1,Lower), | |
101 CartesianBoundary(1,Upper), | |
102 CartesianBoundary(2,Lower), | |
103 ...) | |
104 """ | |
105 boundary_identifiers(g::EquidistantGrid) = (((ntuple(i->(CartesianBoundary{i,Lower}(),CartesianBoundary{i,Upper}()),dimension(g)))...)...,) | |
106 export boundary_identifiers |