changeset 1568:90af15f38c62 feature/grids/manifolds

Update todos
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 25 Apr 2024 13:51:17 +0200
parents 64baaf29ae4e
children 473cf7677e0f
files src/Grids/manifolds.jl src/Grids/mapped_grid.jl
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r 64baaf29ae4e -r 90af15f38c62 src/Grids/manifolds.jl
--- a/src/Grids/manifolds.jl	Thu Apr 25 13:28:59 2024 +0200
+++ b/src/Grids/manifolds.jl	Thu Apr 25 13:51:17 2024 +0200
@@ -86,6 +86,14 @@
 (c::Chart{D})(x̄::SVector{D}) where D = c(x̄...)
 
 
+# TODO: Add trait for if there is a jacobian available?
+# Add package extension to allow calling the getter function anyway if it's not available
+# And can we add an informative error that ForwardDiff could be loaded to make it work?
+# Or can we handle this be custom implementations? For sometypes in the library it can be implemented explicitly.
+# And as an example for ConcreteChart it can be implemented by the user like
+# c = ConcreteChart(...)
+# jacobian(c::typeof(c)) = ...
+
 struct ConcreteChart{D, PST<:ParameterSpace{D}, MT} <: Chart{D}
     mapping::MT
     parameterspace::PST
diff -r 64baaf29ae4e -r 90af15f38c62 src/Grids/mapped_grid.jl
--- a/src/Grids/mapped_grid.jl	Thu Apr 25 13:28:59 2024 +0200
+++ b/src/Grids/mapped_grid.jl	Thu Apr 25 13:51:17 2024 +0200
@@ -61,8 +61,6 @@
     )
 end
 
-# TODO add mapped_grid(x, size...) as a package extension with ForwardDiff
-
 function jacobian_determinant(g::MappedGrid)
     return map(jacobian(g)) do ∂x∂ξ
         det(∂x∂ξ)