comparison src/Grids/mapped_grid.jl @ 1741:248304f88e49 feature/grids/curvilinear

Add TBD for deciding about what jacobian_determinant should mean for Rn->Rm grids
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 11 Sep 2024 12:09:41 +0200
parents 863385aae454
children 49bd573ab07f
comparison
equal deleted inserted replaced
1740:9f2bc8ea6a07 1741:248304f88e49
75 function jacobian_determinant(g::MappedGrid) 75 function jacobian_determinant(g::MappedGrid)
76 return map(jacobian(g)) do ∂x∂ξ 76 return map(jacobian(g)) do ∂x∂ξ
77 det(∂x∂ξ) 77 det(∂x∂ξ)
78 end 78 end
79 end 79 end
80 # TBD: Should this be changed to calculate sqrt(g) instead?
81 # This would make it well defined also for n-dim grids embedded in higher dimensions.
82 # TBD: Is there a better name? metric_determinant?
80 83
81 function metric_tensor(g::MappedGrid) 84 function metric_tensor(g::MappedGrid)
82 return map(jacobian(g)) do ∂x∂ξ 85 return map(jacobian(g)) do ∂x∂ξ
83 ∂x∂ξ'*∂x∂ξ 86 ∂x∂ξ'*∂x∂ξ
84 end 87 end