Mercurial > repos > public > sbplib_julia
view src/Grids/multiblockgrids.jl @ 2023:50e7090f5a95 feature/grids/multiblock_grids
Add accessor functions
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 12 Mar 2025 11:11:50 +0100 |
| parents | fb2dc185c197 |
| children | 3fb33f00dab2 |
line wrap: on
line source
struct MultiBlockGrid{T,D,GT, CT} <: Grid{T,D} grids::GT connections::CT end function MultiBlockGrid(grids, connections) T = eltype(valtype(grids)) D = ndims(valtype(grids)) MultiBlockGrid{T,D,typeof(grids), typeof(connections)}(grids,connections) end grids(g::MultiBlockGrid) = g.grids connections(g::MultiBlockGrid) = g.connections # function Base.getindex end # function boundary_identifiers end # Requires function from manifolds? # function boundary_grid end # Should return a MultiBlockGrid with the right connections? # function min_spacing end # function refine end # function coarsen end # function boundary_indices end # Need to figure out the grid functions first? # function eval_on end # Need to figure out the grid functions first? # function Base.map end # Need to figure out the grid functions first? # Plotting recipes """ MultiBlockBoundary{N, BID} <: BoundaryIdentifier A boundary identifier for a multiblock grids. `N` Specifies which grid and `BID` which boundary on that grid. """ struct MultiBlockBoundary{N, BID} <: BoundaryIdentifier end grid_id(::MultiBlockBoundary{N, BID}) where {N, BID} = N boundary_id(::MultiBlockBoundary{N, BID}) where {N, BID} = BID() function connection(k1, b1::BoundaryIdentifier, k2, b2::BoundaryIdentifier) return ( MultiBlockBoundary{k1,typeof(b1)}(), MultiBlockBoundary{k2,typeof(b2)}(), ) end connection(t::Tuple) = connection(t...)
