|
422 | 422 | runtests(testable; rtol = 1e-2)
|
423 | 423 | end
|
424 | 424 |
|
| 425 | +@testitem "Meshes.Frustum" setup=[Combinations] begin |
| 426 | + if pkgversion(Meshes) >= v"0.52.12" |
| 427 | + # Geometry |
| 428 | + r = 2.5u"m" |
| 429 | + h = 3.5u"m" |
| 430 | + origin = Point(0, 0, 0) |
| 431 | + midpoint = Point(0.0u"m", 0.0u"m", 0.5 * h) |
| 432 | + apex = Point(0.0u"m", 0.0u"m", h) |
| 433 | + ẑ = Vec(0, 0, 1) |
| 434 | + xy_plane = Plane(origin, ẑ) |
| 435 | + base = Disk(xy_plane, r) |
| 436 | + mid_plane = Plane(midpoint, ẑ) |
| 437 | + mid_disk = Disk(mid_plane, 0.5 * r) |
| 438 | + frustum = Frustum(base, mid_disk) |
| 439 | + |
| 440 | + # Integrand & Solution |
| 441 | + integrand(p) = 1.0u"A" |
| 442 | + solution = (7 // 8) * (π * r^2 * h / 3) * u"A" |
| 443 | + |
| 444 | + # Package and run tests |
| 445 | + testable = TestableGeometry(integrand, frustum, solution) |
| 446 | + runtests(testable) |
| 447 | + end |
| 448 | +end |
| 449 | + |
425 | 450 | @testitem "Meshes.FrustumSurface" setup=[Combinations] begin
|
426 | 451 | # Geometry
|
427 | 452 | # Create a frustum whose radius halves at the top, i.e. the bottom half of a cone
|
|
491 | 516 | end
|
492 | 517 |
|
493 | 518 | @testitem "Meshes.ParaboloidSurface" setup=[Combinations] begin
|
| 519 | + # Geometry |
494 | 520 | origin = Point(0, 0, 0)
|
495 | 521 | parab = ParaboloidSurface(origin, 2.5, 4.15)
|
496 | 522 |
|
|
546 | 572 | runtests(testable)
|
547 | 573 | end
|
548 | 574 |
|
| 575 | +@testitem "Meshes.Pyramid" setup=[Combinations] begin |
| 576 | + if pkgversion(Meshes) >= v"0.52.12" |
| 577 | + # Geometry |
| 578 | + a = Point(-1, -1, 0) |
| 579 | + b = Point(1, -1, 0) |
| 580 | + c = Point(1, 1, 0) |
| 581 | + d = Point(-1, 1, 0) |
| 582 | + apex = Point(0, 0, 1) |
| 583 | + pyramid = Pyramid(a, b, c, d, apex) |
| 584 | + # Integrand & Solution |
| 585 | + integrand(p) = 1.0u"A" |
| 586 | + w = norm(b - a) |
| 587 | + h = norm(d - a) |
| 588 | + solution = (1 // 3) * w * h * u"A*m" |
| 589 | + # Package and run tests |
| 590 | + testable = TestableGeometry(integrand, pyramid, solution) |
| 591 | + runtests(testable) |
| 592 | + end |
| 593 | +end |
| 594 | + |
549 | 595 | @testitem "Meshes.Quadrangle" setup=[Combinations] begin
|
550 | 596 | using SpecialFunctions: erf
|
551 | 597 |
|
|
739 | 785 | testable = TestableGeometry(integrand, triangle, solution)
|
740 | 786 | runtests(testable)
|
741 | 787 | end
|
| 788 | + |
| 789 | +@testitem "Meshes.Wedge" setup=[Combinations] begin |
| 790 | + if pkgversion(Meshes) >= v"0.52.12" |
| 791 | + # Geometry |
| 792 | + a₀ = Point(0, 0, 0) |
| 793 | + b₀ = Point(1, 0, 0) |
| 794 | + c₀ = Point(0, 1, 0) |
| 795 | + a₁ = Point(0, 0, 1) |
| 796 | + b₁ = Point(1, 0, 1) |
| 797 | + c₁ = Point(0, 1, 1) |
| 798 | + wedge = Wedge(a₀, b₀, c₀, a₁, b₁, c₁) |
| 799 | + |
| 800 | + # Integrand & Solution |
| 801 | + function integrand(p::Meshes.Point) |
| 802 | + x, y, z = ustrip.(u"m", to(p)) |
| 803 | + (x + 2y + 3z) * u"A" |
| 804 | + end |
| 805 | + solution = (5 // 4) * u"A*m^3" |
| 806 | + |
| 807 | + # Package and run tests |
| 808 | + testable = TestableGeometry(integrand, wedge, solution) |
| 809 | + runtests(testable) |
| 810 | + end |
| 811 | +end |
0 commit comments