Skip to content

Commit

Permalink
Reorganize structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold authored Sep 7, 2024
1 parent fa6b44d commit 3c56288
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,23 @@ end
exp(-r^2)
end
fv(p) = fill(f(p), 3)
sol = sqrt(π) * u"m"
vsol = fill(sol, 3)

# Scalar integrand
sol = sqrt(π) * u"m"
@test integral(f, line, GaussLegendre(100)) sol
@test integral(f, line, GaussKronrod()) sol
@test integral(f, line, HAdaptiveCubature()) sol

# Vector integrand
vsol = fill(sol, 3)
@test integral(fv, line, GaussLegendre(100)) vsol
@test integral(fv, line, GaussKronrod()) vsol
@test integral(fv, line, HAdaptiveCubature()) vsol

# Integral aliases
@test lineintegral(f, line) sol
@test_throws "not supported" surfaceintegral(f, line)
@test_throws "not supported" volumeintegral(f, line)
end

@testset "Meshes.Ray" begin
Expand All @@ -292,15 +300,23 @@ end
exp(-r^2)
end
fv(p) = fill(f(p), 3)
sol = sqrt(π) / 2 * u"m"
vsol = fill(sol, 3)

# Scalar integrand
sol = sqrt(π) / 2 * u"m"
@test integral(f, ray, GaussLegendre(100)) sol
@test integral(f, ray, GaussKronrod()) sol
@test integral(f, ray, HAdaptiveCubature()) sol

# Vector integrand
vsol = fill(sol, 3)
@test integral(fv, ray, GaussLegendre(100)) vsol
@test integral(fv, ray, GaussKronrod()) vsol
@test integral(fv, ray, HAdaptiveCubature()) vsol

# Integral aliases
@test lineintegral(f, line) sol
@test_throws "not supported" surfaceintegral(f, line)
@test_throws "not supported" volumeintegral(f, line)
end

end
Expand Down

0 comments on commit 3c56288

Please sign in to comment.