Mercurial > repos > public > sbplib_julia
changeset 1112:b2afacd57635 feature/boundary_conditions
Merge change to boundary_grid
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 04 Jul 2022 23:02:11 +0200 |
parents | b4ee47f2aafb (current diff) 5b3d4a8ec3ab (diff) |
children | 302d36b5ba8e |
files | |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl Mon Jun 13 13:46:24 2022 +0200 +++ b/src/Grids/EquidistantGrid.jl Mon Jul 04 23:02:11 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