Mercurial > repos > public > sbplib_julia
diff src/Grids/tensor_grid.jl @ 1678:13a7a4ff49e3 feature/grids/manifolds
Merge feature/grids/curvilinear
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 30 Jun 2024 10:50:44 +0200 |
parents | 51f0c5f895fb |
children | ff7aeda1b292 |
line wrap: on
line diff
--- a/src/Grids/tensor_grid.jl Wed Jun 26 12:42:28 2024 +0200 +++ b/src/Grids/tensor_grid.jl Sun Jun 30 10:50:44 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)