comparison src/Grids/multiblockgrids.jl @ 2026:1b6f150d95c5 feature/grids/multiblock_grids

Implement min_spacing, coarsen, refine
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 10 Apr 2025 16:20:22 +0200
parents d35a4cb170ff
children 06f4b2ab43e8
comparison
equal deleted inserted replaced
2025:d35a4cb170ff 2026:1b6f150d95c5
16 16
17 Base.getindex(g::MultiBlockGrid, I...) = g.grids[I...] 17 Base.getindex(g::MultiBlockGrid, I...) = g.grids[I...]
18 # function boundary_identifiers end # Requires function from manifolds? 18 # function boundary_identifiers end # Requires function from manifolds?
19 # function boundary_grid end # Should return a MultiBlockGrid with the right connections? 19 # function boundary_grid end # Should return a MultiBlockGrid with the right connections?
20 20
21 # function min_spacing end 21
22 # function refine end 22 min_spacing(g::MultiBlockGrid) = minimum(min_spacing, grids(g))
23 # function coarsen end 23
24 function refine(g::MultiBlockGrid, n)
25 gs = map(grids(g)) do gᵢ
26 refine(gᵢ,n)
27 end
28
29 return MultiBlockGrid(gs, connections(g))
30 end
31
32 function coarsen(g::MultiBlockGrid, n)
33 gs = map(grids(g)) do gᵢ
34 coarsen(gᵢ,n)
35 end
36
37 return MultiBlockGrid(gs, connections(g))
38 end
39
24 40
25 # function boundary_indices end # Need to figure out the grid functions first? 41 # function boundary_indices end # Need to figure out the grid functions first?
26 # function eval_on end # Need to figure out the grid functions first? 42 # function eval_on end # Need to figure out the grid functions first?
27 # function Base.map end # Need to figure out the grid functions first? Should only have to implement the iterator interface 43 # function Base.map end # Need to figure out the grid functions first? Should only have to implement the iterator interface
28 44