diff src/Grids/Grids.jl @ 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 f46b4f1fa82c 3fb5b03162ee
children 524a52f190d7
line wrap: on
line diff
--- 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