Mercurial > repos > public > sbplib_julia
comparison src/Grids/manifolds.jl @ 1946:c63116e2ec8e feature/grids/manifolds
Make boundaries() a method of boundary_identifiers
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 07 Feb 2025 17:37:42 +0100 |
parents | 19efb9dacfff |
children | dd77b45ee1ac |
comparison
equal
deleted
inserted
replaced
1945:19efb9dacfff | 1946:c63116e2ec8e |
---|---|
31 which will both allow calling `jacobian(c,ξ)`. | 31 which will both allow calling `jacobian(c,ξ)`. |
32 """ | 32 """ |
33 jacobian(c::Chart, ξ) = jacobian(c.mapping, ξ) | 33 jacobian(c::Chart, ξ) = jacobian(c.mapping, ξ) |
34 # TBD: Can we register a error hint for when jacobian is called with a function that doesn't have a registered jacobian? | 34 # TBD: Can we register a error hint for when jacobian is called with a function that doesn't have a registered jacobian? |
35 | 35 |
36 boundaries(c::Chart) = boundary_identifiers(parameterspace(c)) | 36 boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c)) |
37 | 37 |
38 | 38 |
39 """ | 39 """ |
40 Atlas | 40 Atlas |
41 | 41 |
84 end | 84 end |
85 | 85 |
86 return c | 86 return c |
87 end | 87 end |
88 | 88 |
89 function boundaries(a::CartesianAtlas) | 89 function boundary_identifiers(a::CartesianAtlas) |
90 bs = MultiBlockBoundary[] | 90 bs = MultiBlockBoundary[] |
91 | 91 |
92 for d ∈ 1:ndims(charts(a)) | 92 for d ∈ 1:ndims(charts(a)) |
93 Is = eachslice(CartesianIndices(charts(a)); dims=d) | 93 Is = eachslice(CartesianIndices(charts(a)); dims=d) |
94 | 94 |
112 end | 112 end |
113 | 113 |
114 charts(a::UnstructuredAtlas) = a.charts | 114 charts(a::UnstructuredAtlas) = a.charts |
115 connections(a::UnstructuredAtlas) = a.connections | 115 connections(a::UnstructuredAtlas) = a.connections |
116 | 116 |
117 function boundaries(a::UnstructuredAtlas) | 117 function boundary_identifiers(a::UnstructuredAtlas) |
118 bs = MultiBlockBoundary[] | 118 bs = MultiBlockBoundary[] |
119 | 119 |
120 for (i,c) ∈ enumerate(charts(a)) | 120 for (i,c) ∈ enumerate(charts(a)) |
121 for b ∈ boundaries(c) | 121 for b ∈ boundary_identifiers(c) |
122 mbb = MultiBlockBoundary{i,typeof(b)}() | 122 mbb = MultiBlockBoundary{i,typeof(b)}() |
123 | 123 |
124 if !any(cn->mbb∈cn, connections(a)) | 124 if !any(cn->mbb∈cn, connections(a)) |
125 push!(bs, mbb) | 125 push!(bs, mbb) |
126 end | 126 end |