@@ -169,14 +169,32 @@ end
169169end
170170
171171@testitem " Meshes.Box 4D" setup= [Setup] begin
172- a = zero (Float64)
173- b = zero (Float64)
174- box = Box (Point (a, a, a, a), Point (b, b, b, b))
172+ a = π
173+ box = Box (Point (0 , 0 , 0 , 0 ), Point (a, a, a, a))
175174
176- f = p -> one (Float64)
175+ function f (p:: P ) where {P <: Meshes.Point }
176+ x1, x2, x3, x4 = ustrip .(to (p). coords)
177+ σ (x) = sqrt (a^ 2 - x^ 2 )
178+ (σ (x1) + σ (x2) + σ (x3) + σ (x4)) * u " Ω/m^4"
179+ end
180+ fv (p) = fill (f (p), 3 )
177181
178- # Test for currently-unsupported >3D differentials
179- @test integral (f, box)≈ 1.0 u " m^4" broken= true
182+ # Scalar integrand
183+ sol = 4 a^ 3 * (π * a^ 2 / 4 ) * u " Ω"
184+ @test integral (f, box, GaussLegendre (100 ))≈ sol rtol= 1e-6
185+ @test_throws " not supported" integral (f, box, GaussKronrod ())
186+ @test integral (f, box, HAdaptiveCubature (rtol = 1e-6 ))≈ sol rtol= 1e-6
187+
188+ # Vector integrand
189+ vsol = fill (sol, 3 )
190+ @test integral (fv, box, GaussLegendre (100 ))≈ vsol rtol= 1e-6
191+ @test_throws " not supported" integral (fv, box, GaussKronrod ())
192+ @test integral (fv, box, HAdaptiveCubature (rtol = 1e-6 ))≈ vsol rtol= 1e-6
193+
194+ # Integral aliases
195+ @test_throws " not supported" lineintegral (f, box)
196+ @test_throws " not supported" surfaceintegral (f, box)
197+ @test_throws " not supported" volumeintegral (f, box)
180198
181199 # Test jacobian with wrong number of parametric coordinates
182200 @test_throws ArgumentError jacobian (box, zeros (2 ))
0 commit comments