Mercurial > repos > public > sbplib_julia
comparison src/Grids/manifolds.jl @ 1920:ae83c91286a2 feature/grids/manifolds
Implement connections for CartesianAtlas
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 05 Feb 2025 16:17:29 +0100 |
parents | 71d218593cac |
children | 297e3d74f697 |
comparison
equal
deleted
inserted
replaced
1919:71d218593cac | 1920:ae83c91286a2 |
---|---|
61 struct CartesianAtlas <: Atlas | 61 struct CartesianAtlas <: Atlas |
62 charts::Matrix{Chart} | 62 charts::Matrix{Chart} |
63 end | 63 end |
64 | 64 |
65 charts(a::CartesianAtlas) = a.charts | 65 charts(a::CartesianAtlas) = a.charts |
66 connections(a::CartesianAtlas) = nothing | |
67 Base.size(a::CartesianAtlas) = size(a.charts) | 66 Base.size(a::CartesianAtlas) = size(a.charts) |
68 | 67 |
68 function connections(a::CartesianAtlas) | |
69 c = Tuple{MultiBlockBoundary, MultiBlockBoundary}[] | |
70 | |
71 N,M = size(a.charts) | |
72 for j ∈ 1:M, i ∈ 1:N-1 | |
73 push!(c, | |
74 ( | |
75 MultiBlockBoundary{(i,j), CartesianBoundary{1,UpperBoundary}}(), | |
76 MultiBlockBoundary{(i+1,j), CartesianBoundary{1,LowerBoundary}}(), | |
77 ), | |
78 ) | |
79 end | |
80 | |
81 for i ∈ 1:N, j ∈ 1:M-1 | |
82 push!(c, | |
83 ( | |
84 MultiBlockBoundary{(i,j), CartesianBoundary{2,UpperBoundary}}(), | |
85 MultiBlockBoundary{(i,j+1), CartesianBoundary{2,LowerBoundary}}(), | |
86 ), | |
87 ) | |
88 end | |
89 | |
90 return c | |
91 end | |
69 | 92 |
70 struct UnstructuredAtlas <: Atlas | 93 struct UnstructuredAtlas <: Atlas |
71 charts::Vector{Chart} | 94 charts::Vector{Chart} |
72 connections | 95 connections |
73 end | 96 end |