diff --git a/CHANGELOG.md b/CHANGELOG.md index 13971714..cb034e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add official support for Frustum, Pyramid, and Wedge geometries. + ### Changed - Improved unit tests for `Meshes.Cylinder` and `Meshes.CylinderSurface` ([GitHub Issue #67](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/67)). diff --git a/docs/src/support.md b/docs/src/support.md index be77983c..0626a5fc 100644 --- a/docs/src/support.md +++ b/docs/src/support.md @@ -41,7 +41,7 @@ designed to check for accuracy. | `CylinderSurface` | ⚠️ | ✅ | ✅ | | `Disk` | ⚠️ | ✅ | ✅ | | `Ellipsoid` | ✅ | ✅ | ✅ | -| `Frustum` | 🛑 | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | +| `Frustum` | ⚠️ | ✅ | ✅ | | `FrustumSurface` | ⚠️ | ✅ | ✅ | | `Hexahedron` | ✅ | ✅ | ✅ | | `Line` | ✅ | ✅ | ✅ | @@ -49,7 +49,7 @@ designed to check for accuracy. | `ParametrizedCurve` | ✅ | ✅ | ✅ | | `Plane` | ✅ | ✅ | ✅ | | `Polyarea` | 🛑 | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | -| `Pyramid` | 🛑 | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | +| `Pyramid` | ⚠️ | ✅ | ✅ | | `Quadrangle` | ⚠️ | ✅ | ✅ | | `Ray` | ✅ | ✅ | ✅ | | `Ring` | ✅ | ✅ | ✅ | @@ -61,7 +61,7 @@ designed to check for accuracy. | `Tetrahedron` | ⚠️ | ✅ | ✅ | | `Triangle` | ✅ | ✅ | ✅ | | `Torus` | ⚠️ | ✅ | ✅ | -| `Wedge` | 🛑 | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | [🎗️](https://github.com/JuliaGeometry/MeshIntegrals.jl/issues/28) | +| `Wedge` | ⚠️ | ✅ | ✅ | | Symbol | Support Level | |--------|---------| diff --git a/test/combinations.jl b/test/combinations.jl index 4a57bbb3..d22a77e8 100644 --- a/test/combinations.jl +++ b/test/combinations.jl @@ -422,6 +422,31 @@ end runtests(testable; rtol = 1e-2) end +@testitem "Meshes.Frustum" setup=[Combinations] begin + if pkgversion(Meshes) >= v"0.52.12" + # Geometry + r = 2.5u"m" + h = 3.5u"m" + origin = Point(0, 0, 0) + midpoint = Point(0.0u"m", 0.0u"m", 0.5 * h) + apex = Point(0.0u"m", 0.0u"m", h) + ẑ = Vec(0, 0, 1) + xy_plane = Plane(origin, ẑ) + base = Disk(xy_plane, r) + mid_plane = Plane(midpoint, ẑ) + mid_disk = Disk(mid_plane, 0.5 * r) + frustum = Frustum(base, mid_disk) + + # Integrand & Solution + integrand(p) = 1.0u"A" + solution = (7 // 8) * (π * r^2 * h / 3) * u"A" + + # Package and run tests + testable = TestableGeometry(integrand, frustum, solution) + runtests(testable) + end +end + @testitem "Meshes.FrustumSurface" setup=[Combinations] begin # Geometry # Create a frustum whose radius halves at the top, i.e. the bottom half of a cone @@ -491,6 +516,7 @@ end end @testitem "Meshes.ParaboloidSurface" setup=[Combinations] begin + # Geometry origin = Point(0, 0, 0) parab = ParaboloidSurface(origin, 2.5, 4.15) @@ -546,6 +572,26 @@ end runtests(testable) end +@testitem "Meshes.Pyramid" setup=[Combinations] begin + if pkgversion(Meshes) >= v"0.52.12" + # Geometry + a = Point(-1, -1, 0) + b = Point(1, -1, 0) + c = Point(1, 1, 0) + d = Point(-1, 1, 0) + apex = Point(0, 0, 1) + pyramid = Pyramid(a, b, c, d, apex) + # Integrand & Solution + integrand(p) = 1.0u"A" + w = norm(b - a) + h = norm(d - a) + solution = (1 // 3) * w * h * u"A*m" + # Package and run tests + testable = TestableGeometry(integrand, pyramid, solution) + runtests(testable) + end +end + @testitem "Meshes.Quadrangle" setup=[Combinations] begin using SpecialFunctions: erf @@ -739,3 +785,27 @@ end testable = TestableGeometry(integrand, triangle, solution) runtests(testable) end + +@testitem "Meshes.Wedge" setup=[Combinations] begin + if pkgversion(Meshes) >= v"0.52.12" + # Geometry + a₀ = Point(0, 0, 0) + b₀ = Point(1, 0, 0) + c₀ = Point(0, 1, 0) + a₁ = Point(0, 0, 1) + b₁ = Point(1, 0, 1) + c₁ = Point(0, 1, 1) + wedge = Wedge(a₀, b₀, c₀, a₁, b₁, c₁) + + # Integrand & Solution + function integrand(p::Meshes.Point) + x, y, z = ustrip.(u"m", to(p)) + (x + 2y + 3z) * u"A" + end + solution = (5 // 4) * u"A*m^3" + + # Package and run tests + testable = TestableGeometry(integrand, wedge, solution) + runtests(testable) + end +end