diff src/Grids/Grids.jl @ 2003:524a52f190d7 feature/sbp_operators/laplace_curvilinear

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 29 Apr 2025 09:03:05 +0200
parents 496b8d3903c6 ea04a542a526
children
line wrap: on
line diff
--- a/src/Grids/Grids.jl	Tue Feb 11 09:03:04 2025 +0100
+++ b/src/Grids/Grids.jl	Tue Apr 29 09:03:05 2025 +0200
@@ -84,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