comparison src/Grids/EquidistantGrid.jl @ 1114:fc57804c9bf4 feature/grids

Add function dims
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 15 Jul 2022 09:38:08 +0200
parents 4e4c5011140d
children 6530fceef37c
comparison
equal deleted inserted replaced
1113:4e4c5011140d 1114:fc57804c9bf4
122 orthogonal_dims(grid::EquidistantGrid,dim) 122 orthogonal_dims(grid::EquidistantGrid,dim)
123 123
124 Returns the dimensions of grid orthogonal to that of dim. 124 Returns the dimensions of grid orthogonal to that of dim.
125 """ 125 """
126 function orthogonal_dims(grid::EquidistantGrid, dim) 126 function orthogonal_dims(grid::EquidistantGrid, dim)
127 dims = 1:dimension(grid) 127 orth_dims = filter(i -> i != dim, dims(grid))
128 orth_dims = filter(i -> i != dim, dims) 128 if orth_dims == dims(grid)
129 if orth_dims == dims
130 throw(DomainError(string("dimension ",string(dim)," not matching grid"))) 129 throw(DomainError(string("dimension ",string(dim)," not matching grid")))
131 end 130 end
132 return orth_dims 131 return orth_dims
133 end 132 end
134 133