Skip to content

Commit

Permalink
Implement for Torus
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold authored Dec 5, 2024
1 parent 77de408 commit d197f83
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions test/combinations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d197f83

Please sign in to comment.