Mercurial > repos > public > sbplib_julia
diff src/Grids/tensor_grid.jl @ 1677:51f0c5f895fb feature/grids/curvilinear
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 30 Jun 2024 10:43:02 +0200 |
parents | b02917bcd7d5 5f348cc5598e |
children | ff7aeda1b292 |
line wrap: on
line diff
--- a/src/Grids/tensor_grid.jl Fri Jun 28 17:02:47 2024 +0200 +++ b/src/Grids/tensor_grid.jl Sun Jun 30 10:43:02 2024 +0200 @@ -50,6 +50,12 @@ Base.size(g::TensorGrid, d) = size(g)[d] +function min_spacing(g::TensorGrid) + relevant_grids = filter(g->!isa(g,ZeroDimGrid),g.grids) + d = min_spacing.(relevant_grids) + return minimum(d) +end + refine(g::TensorGrid, r::Int) = mapreduce(g->refine(g,r), TensorGrid, g.grids) coarsen(g::TensorGrid, r::Int) = mapreduce(g->coarsen(g,r), TensorGrid, g.grids)