From d197f8378b9e1b75e0479017a93fd34bcaf40c28 Mon Sep 17 00:00:00 2001 From: Michael Ingold Date: Thu, 5 Dec 2024 11:51:27 -0500 Subject: [PATCH] Implement for Torus --- test/combinations.jl | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/test/combinations.jl b/test/combinations.jl index bd2d5f6b..4452f3ce 100644 --- a/test/combinations.jl +++ b/test/combinations.jl @@ -807,30 +807,19 @@ end @test volumeintegral(f, tetrahedron, HAdaptiveCubature()) ≈ sol end -@testitem "Meshes.Torus" setup=[Setup] begin +@testitem "Meshes.Torus" setup=[Combinations] begin + # Geometry origin = Point(0, 0, 0) ẑ = Vec(0, 0, 1) torus = Torus(origin, ẑ, 3.5, 1.25) - f(p) = 1.0 - fv(p) = fill(f(p), 3) - - # Scalar integrand - sol = Meshes.measure(torus) - @test integral(f, torus, GaussLegendre(100)) ≈ sol - @test integral(f, torus, GaussKronrod()) ≈ sol - @test integral(f, torus, HAdaptiveCubature()) ≈ sol - - # Vector integrand - vsol = fill(sol, 3) - @test integral(fv, torus, GaussLegendre(100)) ≈ vsol - @test integral(fv, torus, GaussKronrod()) ≈ vsol - @test integral(fv, torus, HAdaptiveCubature()) ≈ vsol + # Integrand & Solution + integrand(p) = 1.0u"A" + solution = Meshes.measure(torus) * u"A" - # Integral aliases - @test_throws "not supported" lineintegral(f, torus) - @test surfaceintegral(f, torus) ≈ sol - @test_throws "not supported" volumeintegral(f, torus) + # Package and run tests + testable = TestableGeometry(integrand, torus, solution) + runtests(testable, SupportStatus(:surface)) end @testitem "Meshes.Triangle" setup=[Combinations] begin