Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
6 changes: 3 additions & 3 deletions docs/src/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ 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` | ✅ | ✅ | ✅ |
| `ParaboloidSurface` | ⚠️ | ✅ | ✅ |
| `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` | ✅ | ✅ | ✅ |
Expand All @@ -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 |
|--------|---------|
Expand Down
70 changes: 70 additions & 0 deletions test/combinations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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