Skip to content

Commit

Permalink
New analytical solution for Torus
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Jan 18, 2025
1 parent ef7bd59 commit f6f5e04
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/combinations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -696,13 +696,18 @@ end

@testitem "Meshes.Torus" setup=[Combinations] begin
# Geometry
origin = Point(0, 0, 0)
center = Point(0, 0, 0)
= Vec(0, 0, 1)
torus = Torus(origin, ẑ, 3.5, 1.25)
R = 3.5 # radius from axis-of-revolution to center of circle being revolved
r = 1.2 # radius of circle being revolved
torus = Torus(center, ẑ, R, r)

# Integrand & Solution
integrand(p) = 1.0u"A"
solution = Meshes.measure(torus) * u"A"
function integrand(p::Meshes.Point)
x, y, z = ustrip.(u"m", to(p))
(x^2 + y^2) * u"A"
end
solution = (2π^2 * r * R * (2R^2 + 3r^2)) * u"A*m^2"

# Package and run tests
testable = TestableGeometry(integrand, torus, solution)
Expand Down

0 comments on commit f6f5e04

Please sign in to comment.