Skip to content

Commit 055c445

Browse files
committed
Use Unitful integrand for Triangle and Tetrahedron
1 parent 817caa5 commit 055c445

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/combinations.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,11 @@ end
836836
= Vec(0, 0, 1)
837837
tetrahedron = Tetrahedron(pt_n, pt_w, pt_e, pt_n + ẑ)
838838

839-
f(p) = 1.0
839+
f(p) = 1.0u"A"
840840
fv(p) = fill(f(p), 3)
841841

842842
# Scalar integrand
843-
sol = Meshes.measure(tetrahedron)
843+
sol = Meshes.measure(tetrahedron) * u"A"
844844
@test integral(f, tetrahedron, GaussLegendre(100)) sol
845845
@test_throws "not supported" integral(f, tetrahedron, GaussKronrod())sol
846846
@test integral(f, tetrahedron, HAdaptiveCubature()) sol
@@ -889,11 +889,11 @@ end
889889
c(T = Float64) = Point(T(1), 0, 0)
890890
triangle = Triangle(a(), b(), c())
891891

892-
f(p) = 1.0
892+
f(p) = 1.0u"A"
893893
fv(p) = fill(f(p), 3)
894894

895895
# Scalar integrand
896-
sol = Meshes.measure(triangle)
896+
sol = Meshes.measure(triangle) * u"A"
897897
@test integral(f, triangle, GaussLegendre(100)) sol
898898
@test integral(f, triangle, GaussKronrod()) sol
899899
@test integral(f, triangle, HAdaptiveCubature()) sol
@@ -910,7 +910,7 @@ end
910910
@test_throws "not supported" volumeintegral(f, triangle)
911911

912912
# Type stability
913-
f32(p) = 1.0f0
913+
f32(p) = 1.0f0u"A"
914914
triangle32 = Triangle(a(Float32), b(Float32), c(Float32))
915915
int_FP32 = integral(f32, triangle32, GaussLegendre(100); FP = Float32)
916916
@test typeof(int_FP32.val) == Float32

0 commit comments

Comments
 (0)