changeset 1981:ea04a542a526 feature/grids/geometry_functions

Merge feature/grids/manifolds
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 26 Feb 2025 22:44:10 +0100
parents db3383581b9f (current diff) 2d6c45f53bc9 (diff)
children 486b3c6f919e
files src/Grids/Grids.jl
diffstat 6 files changed, 16 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/docs/make.jl	Wed Feb 26 15:40:37 2025 +0100
+++ b/docs/make.jl	Wed Feb 26 22:44:10 2025 +0100
@@ -30,7 +30,7 @@
     "operator_file_format.md",
     "grids_and_grid_functions.md",
     "matrix_and_tensor_representations.md",
-    "manifolds_charts_atlases.md"
+    "manifolds_charts_atlases.md",
     "Submodules" => [
         "submodules/grids.md",
         "submodules/lazy_tensors.md",
--- a/docs/src/manifolds_charts_atlases.md	Wed Feb 26 15:40:37 2025 +0100
+++ b/docs/src/manifolds_charts_atlases.md	Wed Feb 26 22:44:10 2025 +0100
@@ -1,10 +1,10 @@
 # Manifolds, Charts, and Atlases
 
 To construct grids on more complicated geometries we use manifolds described
-by one or more charts. The charts describe a mapping from some parameter space
+by one or more charts. The charts describe a mapping from a logical parameter space
 to the geometry that we are interested in. If there are more than one chart
 for a given geometry this collection of charts and their connection is
-described by and atlas.
+described by an atlas.
 
 For the construction of differential and difference operators on a manifold
 with a chart the library needs to know the Jacobian of the mapping as a
--- a/ext/DiffinitivePlotsExt.jl	Wed Feb 26 15:40:37 2025 +0100
+++ b/ext/DiffinitivePlotsExt.jl	Wed Feb 26 22:44:10 2025 +0100
@@ -57,16 +57,4 @@
     return x, y
 end
 
-# get_axis_limits(plt, :x)
-
-
-# ReicpesPipline/src/user_recipe.jl
-# @recipe function f(f::FuncOrFuncs{F}) where {F<:Function}
-
-# @recipe function f(f::Function, xmin::Number, xmax::Number)
-
-# _scaled_adapted_grid(f, xscale, yscale, xmin, xmax)
-
 end
-
-
--- a/src/Grids/Grids.jl	Wed Feb 26 15:40:37 2025 +0100
+++ b/src/Grids/Grids.jl	Wed Feb 26 22:44:10 2025 +0100
@@ -67,7 +67,6 @@
 
 export MultiBlockBoundary
 
-
 # MappedGrid
 export MappedGrid
 export jacobian
@@ -85,4 +84,17 @@
 include("mapped_grid.jl")
 include("geometry.jl")
 
+function __init__()
+    if !isdefined(Base.Experimental, :register_error_hint)
+        return
+    end
+
+    Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, kwargs
+        if exc.f == Grids.jacobian
+            print(io, "\nThis possibly means that a function used to define a coordinate mapping is missing a method for `Grids.jacobian`.\n")
+            print(io, "Provide one by for exmple implementing `Grids.jacobian(::$(typeof(exc.args[1])), x) = ...` or `Grids.jacobian(f, x) = ForwardDiff.jacobian(f,x)`")
+        end
+    end
+end
+
 end # module
--- a/src/Grids/manifolds.jl	Wed Feb 26 15:40:37 2025 +0100
+++ b/src/Grids/manifolds.jl	Wed Feb 26 22:44:10 2025 +0100
@@ -31,7 +31,6 @@
 which will both allow calling `jacobian(c,ξ)`.
 """
 jacobian(c::Chart, ξ) = jacobian(c.mapping, ξ)
-# TBD: Can we register a error hint for when jacobian is called with a function that doesn't have a registered jacobian?
 
 boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c))
 
--- a/test/Grids/equidistant_grid_test.jl	Wed Feb 26 15:40:37 2025 +0100
+++ b/test/Grids/equidistant_grid_test.jl	Wed Feb 26 22:44:10 2025 +0100
@@ -164,7 +164,6 @@
         @test equidistant_grid(HyperBox((0,),(2,)),4) == equidistant_grid(@SVector[0], @SVector[2], 4)
     end
 
-
     @testset "equidistant_grid(::Chart)" begin
         c = Chart(unitsquare()) do (ξ,η)
             @SVector[2ξ, 3η]