@@ -9,6 +9,9 @@ Numerically integrate a given function `f(::Point)` along a line-like `geometry`
99using a particular numerical integration `rule` with floating point precision of
1010type `FP`.
1111
12+ This is a convenience wrapper around [`integral`](@ref) that additionally enforces
13+ a requirement that the geometry have one parametric dimension.
14+
1215Rule types available:
1316- [`GaussKronrod`](@ref) (default)
1417- [`GaussLegendre`](@ref)
@@ -20,14 +23,12 @@ function lineintegral(
2023 rule:: IntegrationRule = GaussKronrod ();
2124 kwargs...
2225)
23- N = Meshes. paramdim (geometry)
24-
25- if N == 1
26- return integral (f, geometry, rule; kwargs... )
27- else
26+ if (N = Meshes. paramdim (geometry)) != 1
2827 throw (ArgumentError (" Performing a line integral on a geometry \
2928 with $N parametric dimensions not supported." ))
3029 end
30+
31+ return integral (f, geometry, rule; kwargs... )
3132end
3233
3334# ###############################################################################
@@ -41,6 +42,9 @@ Numerically integrate a given function `f(::Point)` along a surface `geometry`
4142using a particular numerical integration `rule` with floating point precision of
4243type `FP`.
4344
45+ This is a convenience wrapper around [`integral`](@ref) that additionally enforces
46+ a requirement that the geometry have two parametric dimensions.
47+
4448Algorithm types available:
4549- [`GaussKronrod`](@ref)
4650- [`GaussLegendre`](@ref)
@@ -52,14 +56,12 @@ function surfaceintegral(
5256 rule:: IntegrationRule = HAdaptiveCubature ();
5357 kwargs...
5458)
55- N = Meshes. paramdim (geometry)
56-
57- if N == 2
58- return integral (f, geometry, rule; kwargs... )
59- else
59+ if (N = Meshes. paramdim (geometry)) != 2
6060 throw (ArgumentError (" Performing a surface integral on a geometry \
6161 with $N parametric dimensions not supported." ))
6262 end
63+
64+ return integral (f, geometry, rule; kwargs... )
6365end
6466
6567# ###############################################################################
@@ -73,6 +75,9 @@ Numerically integrate a given function `f(::Point)` throughout a volumetric
7375`geometry` using a particular numerical integration `rule` with floating point
7476precision of type `FP`.
7577
78+ This is a convenience wrapper around [`integral`](@ref) that additionally enforces
79+ a requirement that the geometry have three parametric dimensions.
80+
7681Algorithm types available:
7782- [`GaussKronrod`](@ref)
7883- [`GaussLegendre`](@ref)
@@ -84,12 +89,10 @@ function volumeintegral(
8489 rule:: IntegrationRule = HAdaptiveCubature ();
8590 kwargs...
8691)
87- N = Meshes. paramdim (geometry)
88-
89- if N == 3
90- return integral (f, geometry, rule; kwargs... )
91- else
92+ if (N = Meshes. paramdim (geometry)) != 3
9293 throw (ArgumentError (" Performing a volume integral on a geometry \
9394 with $N parametric dimensions not supported." ))
9495 end
96+
97+ return integral (f, geometry, rule; kwargs... )
9598end
0 commit comments