Mercurial > repos > public > sbplib_julia
comparison src/Grids/mapped_grid.jl @ 1768:672897f64d58 feature/grids/curvilinear
More reivew comments
author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
---|---|
date | Fri, 13 Sep 2024 13:35:20 -0700 |
parents | c98d9c528a22 |
children | 08e52f442872 |
comparison
equal
deleted
inserted
replaced
1752:c98d9c528a22 | 1768:672897f64d58 |
---|---|
72 Base.size(g::MappedGrid, d) = size(g.logicalgrid, d) | 72 Base.size(g::MappedGrid, d) = size(g.logicalgrid, d) |
73 | 73 |
74 boundary_identifiers(g::MappedGrid) = boundary_identifiers(g.logicalgrid) | 74 boundary_identifiers(g::MappedGrid) = boundary_identifiers(g.logicalgrid) |
75 boundary_indices(g::MappedGrid, id::TensorGridBoundary) = boundary_indices(g.logicalgrid, id) | 75 boundary_indices(g::MappedGrid, id::TensorGridBoundary) = boundary_indices(g.logicalgrid, id) |
76 | 76 |
77 # Review: Error when calling plot(boundary_grid(g, id)) | |
78 # Currently need to collect first, i.e., plot(collect(boundary_grid(g, id))) | |
77 function boundary_grid(g::MappedGrid, id::TensorGridBoundary) | 79 function boundary_grid(g::MappedGrid, id::TensorGridBoundary) |
78 b_indices = boundary_indices(g.logicalgrid, id) | 80 b_indices = boundary_indices(g.logicalgrid, id) |
79 | 81 |
80 # Calculate indices of needed jacobian components | 82 # Calculate indices of needed jacobian components |
81 D = ndims(g) | 83 D = ndims(g) |
120 map(x,lg), | 122 map(x,lg), |
121 map(J,lg), | 123 map(J,lg), |
122 ) | 124 ) |
123 end | 125 end |
124 | 126 |
127 # Review: Error when calling jacobian_determinant(boundary_grid(g,id)) | |
125 """ | 128 """ |
126 jacobian_determinant(g::MappedGrid) | 129 jacobian_determinant(g::MappedGrid) |
127 | 130 |
128 The jacobian determinant of `g` as a grid function. | 131 The jacobian determinant of `g` as a grid function. |
129 """ | 132 """ |
198 end | 201 end |
199 | 202 |
200 return ms | 203 return ms |
201 end | 204 end |
202 | 205 |
206 # Review: I would implement the normal through Nansons formula | |
207 # nⱼ = inv(Jᵧ)*J*Fⱼᵢ*νᵢ | |
208 # where | |
209 # Jᵧ boundary jacobian determiant | |
210 # J is the volume jacobian determinant | |
211 # Fⱼᵢ = dξᵢ/dxⱼ | |
212 # νᵢ normal on logical grid | |
213 # j: indices on physical grid | |
214 # i: indices on logical grid | |
215 # ξ: coordinate vector on logical grid | |
216 # x: coordinate vector on logical grid | |
217 # Perhaps the below is equivalent? | |
203 """ | 218 """ |
204 normal(g::MappedGrid, boundary) | 219 normal(g::MappedGrid, boundary) |
205 | 220 |
206 The outward pointing normal as a grid function on the corresponding boundary grid. | 221 The outward pointing normal as a grid function on the corresponding boundary grid. |
207 """ | 222 """ |