Mercurial > repos > public > sbplib_julia
comparison src/Grids/mapped_grid.jl @ 1704:e5e76c8e52c5 feature/grids/curvilinear
Fix todos and add broken test for mapped_grid(::Grid,...)
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 04 Sep 2024 15:26:59 +0200 |
parents | 6eb5b48607e0 |
children | 4870fc3faa25 |
comparison
equal
deleted
inserted
replaced
1703:6eb5b48607e0 | 1704:e5e76c8e52c5 |
---|---|
14 | 14 |
15 Base.firstindex(g::MappedGrid, d) = firstindex(g.logicalgrid, d) | 15 Base.firstindex(g::MappedGrid, d) = firstindex(g.logicalgrid, d) |
16 Base.lastindex(g::MappedGrid, d) = lastindex(g.logicalgrid, d) | 16 Base.lastindex(g::MappedGrid, d) = lastindex(g.logicalgrid, d) |
17 | 17 |
18 # Iteration interface | 18 # Iteration interface |
19 | |
20 Base.iterate(g::MappedGrid) = iterate(g.physicalcoordinates) | 19 Base.iterate(g::MappedGrid) = iterate(g.physicalcoordinates) |
21 Base.iterate(g::MappedGrid, state) = iterate(g.physicalcoordinates, state) | 20 Base.iterate(g::MappedGrid, state) = iterate(g.physicalcoordinates, state) |
22 | 21 |
23 Base.IteratorSize(::Type{<:MappedGrid{<:Any, D}}) where D = Base.HasShape{D}() | 22 Base.IteratorSize(::Type{<:MappedGrid{<:Any, D}}) where D = Base.HasShape{D}() |
24 Base.length(g::MappedGrid) = length(g.logicalgrid) | 23 Base.length(g::MappedGrid) = length(g.logicalgrid) |
58 lg, | 57 lg, |
59 map(x,lg), | 58 map(x,lg), |
60 map(J,lg), | 59 map(J,lg), |
61 ) | 60 ) |
62 end | 61 end |
63 # TODO: Delete this function | |
64 | 62 |
65 function jacobian_determinant(g::MappedGrid) | 63 function jacobian_determinant(g::MappedGrid) |
66 return map(jacobian(g)) do ∂x∂ξ | 64 return map(jacobian(g)) do ∂x∂ξ |
67 det(∂x∂ξ) | 65 det(∂x∂ξ) |
68 end | 66 end |