Mercurial > repos > public > sbplib_julia
comparison src/Grids/mapped_grid.jl @ 1775:ecec2b0eea0f feature/grids/curvilinear
Delete jacobian_determinant. User should use map or broadcasting with det instead.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 15 Sep 2024 18:05:57 +0200 |
parents | 035af82f559a |
children | 265a740a49da |
comparison
equal
deleted
inserted
replaced
1774:035af82f559a | 1775:ecec2b0eea0f |
---|---|
119 lg, | 119 lg, |
120 map(x,lg), | 120 map(x,lg), |
121 map(J,lg), | 121 map(J,lg), |
122 ) | 122 ) |
123 end | 123 end |
124 | |
125 # Review: Error when calling jacobian_determinant(boundary_grid(g,id)) | |
126 """ | |
127 jacobian_determinant(g::MappedGrid) | |
128 | |
129 The jacobian determinant of `g` as a grid function. | |
130 """ | |
131 function jacobian_determinant(g::MappedGrid) | |
132 return map(jacobian(g)) do ∂x∂ξ | |
133 det(∂x∂ξ) | |
134 end | |
135 end | |
136 # TBD: Should this be changed to calculate sqrt(g) instead? | |
137 # This would make it well defined also for n-dim grids embedded in higher dimensions. | |
138 # TBD: Is there a better name? metric_determinant? | |
139 # TBD: Is the best option to delete it? | |
140 # Review: I don't think we should delete it. Users building their own | |
141 # curvilinear operators will need the functionality. Also the | |
142 # determinant of the jacobian (and not its square root) is required | |
143 # for quadratures on mapped grids right? For that reason I think we should | |
144 # keep the function as is. We could provide a function for the square root | |
145 # as well if we think it would be helpfull. Regarding naming, perhaps | |
146 # metric_determinant is better? | |
147 | 124 |
148 """ | 125 """ |
149 metric_tensor(g::MappedGrid) | 126 metric_tensor(g::MappedGrid) |
150 | 127 |
151 The metric tensor of `g` as a grid function. | 128 The metric tensor of `g` as a grid function. |