diff src/Grids/Grids.jl @ 2057:8a2a0d678d6f feature/lazy_tensors/pretty_printing

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 10 Feb 2026 22:41:19 +0100
parents 3fb5b03162ee
children ea04a542a526
line wrap: on
line diff
--- a/src/Grids/Grids.jl	Mon May 23 07:20:27 2022 +0200
+++ b/src/Grids/Grids.jl	Tue Feb 10 22:41:19 2026 +0100
@@ -1,19 +1,99 @@
 module Grids
 
-using Sbplib.RegionIndices
+using Diffinitive.LazyTensors
+using StaticArrays
+using LinearAlgebra
+
+export ParameterSpace
+export HyperBox
+export Simplex
+export Interval
+export Rectangle
+export Box
+export Triangle
+export Tetrahedron
 
-export BoundaryIdentifier, CartesianBoundary
+export limits
+export unitinterval
+export unitsquare
+export unitcube
+export unithyperbox
+
+export verticies
+export unittriangle
+export unittetrahedron
+export unitsimplex
+
+export Chart
+
+export Atlas
+export charts
+export connections
+export CartesianAtlas
+export UnstructuredAtlas
+
+export parameterspace
 
-abstract type BoundaryIdentifier end
-struct CartesianBoundary{Dim, R<:Region} <: BoundaryIdentifier end
-dim(::CartesianBoundary{Dim, R}) where {Dim, R} = Dim
-region(::CartesianBoundary{Dim, R}) where {Dim, R} = R()
+# Grid
+export Grid
+export coordinate_size
+export component_type
+export grid_id
+export boundary_id
+export boundary_indices
+export boundary_identifiers
+export boundary_grid
+export min_spacing
+export coarsen
+export refine
+export eval_on
+export componentview
+export ArrayComponentView
+export normal
+
+export BoundaryIdentifier
+export TensorGridBoundary
+export CartesianBoundary
+export LowerBoundary
+export UpperBoundary
+
+export TensorGrid
+export ZeroDimGrid
+
+export EquidistantGrid
+export inverse_spacing
+export spacing
+export equidistant_grid
 
-export dim, region
+export MultiBlockBoundary
+
+# MappedGrid
+export MappedGrid
+export jacobian
+export logical_grid
+export mapped_grid
+export metric_tensor
 
-include("AbstractGrid.jl")
-include("EquidistantGrid.jl")
+include("parameter_space.jl")
+include("grid.jl")
+include("multiblockgrids.jl")
+include("manifolds.jl")
+include("tensor_grid.jl")
+include("equidistant_grid.jl")
+include("zero_dim_grid.jl")
+include("mapped_grid.jl")
 
-# TODO: Rename AbstractGrid to Grid and move definition here.
+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