Mercurial > repos > public > sbplib_julia
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 1110:c0bff9f6e0fb | 2057:8a2a0d678d6f |
|---|---|
| 1 module Grids | 1 module Grids |
| 2 | 2 |
| 3 using Sbplib.RegionIndices | 3 using Diffinitive.LazyTensors |
| 4 using StaticArrays | |
| 5 using LinearAlgebra | |
| 4 | 6 |
| 5 export BoundaryIdentifier, CartesianBoundary | 7 export ParameterSpace |
| 8 export HyperBox | |
| 9 export Simplex | |
| 10 export Interval | |
| 11 export Rectangle | |
| 12 export Box | |
| 13 export Triangle | |
| 14 export Tetrahedron | |
| 6 | 15 |
| 7 abstract type BoundaryIdentifier end | 16 export limits |
| 8 struct CartesianBoundary{Dim, R<:Region} <: BoundaryIdentifier end | 17 export unitinterval |
| 9 dim(::CartesianBoundary{Dim, R}) where {Dim, R} = Dim | 18 export unitsquare |
| 10 region(::CartesianBoundary{Dim, R}) where {Dim, R} = R() | 19 export unitcube |
| 20 export unithyperbox | |
| 11 | 21 |
| 12 export dim, region | 22 export verticies |
| 23 export unittriangle | |
| 24 export unittetrahedron | |
| 25 export unitsimplex | |
| 13 | 26 |
| 14 include("AbstractGrid.jl") | 27 export Chart |
| 15 include("EquidistantGrid.jl") | |
| 16 | 28 |
| 17 # TODO: Rename AbstractGrid to Grid and move definition here. | 29 export Atlas |
| 30 export charts | |
| 31 export connections | |
| 32 export CartesianAtlas | |
| 33 export UnstructuredAtlas | |
| 34 | |
| 35 export parameterspace | |
| 36 | |
| 37 # Grid | |
| 38 export Grid | |
| 39 export coordinate_size | |
| 40 export component_type | |
| 41 export grid_id | |
| 42 export boundary_id | |
| 43 export boundary_indices | |
| 44 export boundary_identifiers | |
| 45 export boundary_grid | |
| 46 export min_spacing | |
| 47 export coarsen | |
| 48 export refine | |
| 49 export eval_on | |
| 50 export componentview | |
| 51 export ArrayComponentView | |
| 52 export normal | |
| 53 | |
| 54 export BoundaryIdentifier | |
| 55 export TensorGridBoundary | |
| 56 export CartesianBoundary | |
| 57 export LowerBoundary | |
| 58 export UpperBoundary | |
| 59 | |
| 60 export TensorGrid | |
| 61 export ZeroDimGrid | |
| 62 | |
| 63 export EquidistantGrid | |
| 64 export inverse_spacing | |
| 65 export spacing | |
| 66 export equidistant_grid | |
| 67 | |
| 68 export MultiBlockBoundary | |
| 69 | |
| 70 # MappedGrid | |
| 71 export MappedGrid | |
| 72 export jacobian | |
| 73 export logical_grid | |
| 74 export mapped_grid | |
| 75 export metric_tensor | |
| 76 | |
| 77 include("parameter_space.jl") | |
| 78 include("grid.jl") | |
| 79 include("multiblockgrids.jl") | |
| 80 include("manifolds.jl") | |
| 81 include("tensor_grid.jl") | |
| 82 include("equidistant_grid.jl") | |
| 83 include("zero_dim_grid.jl") | |
| 84 include("mapped_grid.jl") | |
| 85 | |
| 86 function __init__() | |
| 87 if !isdefined(Base.Experimental, :register_error_hint) | |
| 88 return | |
| 89 end | |
| 90 | |
| 91 Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, kwargs | |
| 92 if exc.f == Grids.jacobian | |
| 93 print(io, "\nThis possibly means that a function used to define a coordinate mapping is missing a method for `Grids.jacobian`.\n") | |
| 94 print(io, "Provide one by for exmple implementing `Grids.jacobian(::$(typeof(exc.args[1])), x) = ...` or `Grids.jacobian(f, x) = ForwardDiff.jacobian(f,x)`") | |
| 95 end | |
| 96 end | |
| 97 end | |
| 18 | 98 |
| 19 end # module | 99 end # module |
