comparison src/Grids/parameter_space.jl @ 1910:15be190a40cd feature/grids/parameter_spaces

Add boundary_intifiers(::Interval) and boundary_identifiers(::HyperBox)
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 07 Feb 2025 15:29:05 +0100
parents 09c4fda8779d
children 449cce897da9
comparison
equal deleted inserted replaced
1909:4209290cb377 1910:15be190a40cd
43 43
44 The limits of the interval. 44 The limits of the interval.
45 """ 45 """
46 limits(i::Interval) = (i.a, i.b) 46 limits(i::Interval) = (i.a, i.b)
47 47
48 boundary_identifiers(::Interval) = (LowerBoundary(), UpperBoundary())
49
48 """ 50 """
49 unitinterval(T=Float64) 51 unitinterval(T=Float64)
50 52
51 The interval ``(0,1)``. 53 The interval ``(0,1)``.
52 """ 54 """
88 limits(box::HyperBox) 90 limits(box::HyperBox)
89 91
90 The lower and upper limits of `box` as tuples. 92 The lower and upper limits of `box` as tuples.
91 """ 93 """
92 limits(box::HyperBox) = (box.a, box.b) 94 limits(box::HyperBox) = (box.a, box.b)
95
96 function boundary_identifiers(box::HyperBox)
97 mapreduce(vcat, 1:ndims(box)) do d
98 [
99 CartesianBoundary{d, LowerBoundary}(),
100 CartesianBoundary{d, UpperBoundary}(),
101 ]
102 end
103 end
104
93 105
94 """ 106 """
95 unitsquare(T=Float64) 107 unitsquare(T=Float64)
96 108
97 The square starting at ``(0,0)`` with side length 1. 109 The square starting at ``(0,0)`` with side length 1.