Mercurial > repos > public > sbplib_julia
diff src/Grids/EquidistantGrid.jl @ 1124:f5d381e66346 refactor/sbpoperators/inflation
Merge with default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 04 Oct 2022 22:31:52 +0200 |
parents | 5b3d4a8ec3ab |
children | 4e4c5011140d |
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl Thu Jun 09 07:33:27 2022 +0200 +++ b/src/Grids/EquidistantGrid.jl Tue Oct 04 22:31:52 2022 +0200 @@ -116,6 +116,7 @@ return EquidistantGrid(size, limit_lower, limit_upper) end + """ boundary_identifiers(::EquidistantGrid) @@ -129,16 +130,16 @@ """ - boundary_grid(grid::EquidistantGrid,id::CartesianBoundary) - boundary_grid(::EquidistantGrid{1},::CartesianBoundary{1}) + boundary_grid(grid::EquidistantGrid, id::CartesianBoundary) Creates the lower-dimensional restriciton of `grid` spanned by the dimensions orthogonal to the boundary specified by `id`. The boundary grid of a 1-dimensional grid is a zero-dimensional grid. """ -function boundary_grid(grid::EquidistantGrid,id::CartesianBoundary) - dims = collect(1:dimension(grid)) - orth_dims = dims[dims .!= dim(id)] +function boundary_grid(grid::EquidistantGrid, id::CartesianBoundary) + dims = 1:dimension(grid) + # Extract dimensions orthogonal to dim(id) + orth_dims = filter(i -> i != dim(id), dims) if orth_dims == dims throw(DomainError("boundary identifier not matching grid")) end