-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCylinderSurface.jl
More file actions
29 lines (25 loc) · 1.1 KB
/
CylinderSurface.jl
File metadata and controls
29 lines (25 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
################################################################################
# Specialized Methods for CylinderSurface
#
# Why Specialized?
# The parametric function that Meshes.jl currently implements for CylinderSurface
# only parametrizes the rounded walls, but this Geometry surface is defined as
# including the top and bottom circular base surfaces as well. These methods
# simply integrate the base and walls and return the sum of the three integrals.
################################################################################
function integral(
f,
cyl::Meshes.CylinderSurface,
rule::I;
kwargs...
) where {I <: IntegrationRule}
# The generic method only parametrizes the sides
sides = _integral(f, cyl, rule; kwargs...)
# Integrate the Disk at the top
disk_top = Meshes.Disk(cyl.top, cyl.radius)
top = _integral(f, disk_top, rule; kwargs...)
# Integrate the Disk at the bottom
disk_bottom = Meshes.Disk(cyl.bot, cyl.radius)
bottom = _integral(f, disk_bottom, rule; kwargs...)
return sides + top + bottom
end