Public API
Integrals
MeshIntegrals.integral
— Functionintegral(f, geometry)
+integral(f, geometry, algorithm)
+integral(f, geometry, algorithm, FP)
Numerically integrate a given function f(::Point)
over the domain defined by a geometry
using a particular integration algorithm
with floating point precision of type FP
.
Arguments
f
: an integrand function with a methodf(::Meshes.Point)
geometry
: someMeshes.Geometry
that defines the integration domainalgorithm
: optionally, theIntegrationAlgorithm
used for the integration (by defaultGaussKronrod()
in 1D andHAdaptiveCubature()
else)FP
: optionally, the floating point precision desired (Float64
by default)
Note that reducing FP
below Float64
will incur some loss of precision. By contrast, increasing FP
to e.g. BigFloat
will typically increase precision (at the expense of longer runtimes).
Aliases
MeshIntegrals.lineintegral
— Functionlineintegral(f, geometry)
+lineintegral(f, geometry, algorithm)
+lineintegral(f, geometry, algorithm, FP)
Numerically integrate a given function f(::Point)
along a line-like geometry
using a particular integration algorithm
with floating point precision of type FP
.
Algorithm types available:
- GaussKronrod (default)
- GaussLegendre
- HAdaptiveCubature
MeshIntegrals.surfaceintegral
— Functionsurfaceintegral(f, geometry)
+surfaceintegral(f, geometry, algorithm)
+surfaceintegral(f, geometry, algorithm, FP)
Numerically integrate a given function f(::Point)
along a surface geometry
using a particular integration algorithm
with floating point precision of type FP
.
Algorithm types available:
- GaussKronrod
- GaussLegendre
- HAdaptiveCubature (default)
MeshIntegrals.volumeintegral
— Functionvolumeintegral(f, geometry)
+volumeintegral(f, geometry, algorithm)
+volumeintegral(f, geometry, algorithm, FP)
Numerically integrate a given function f(::Point)
throughout a volumetric geometry
using a particular integration algorithm
with floating point precision of type FP
.
Algorithm types available:
- GaussKronrod
- GaussLegendre
- HAdaptiveCubature (default)
Integration Algorithms
MeshIntegrals.GaussKronrod
— TypeGaussKronrod(kwargs...)
Numerically integrate using the h-adaptive Gauss-Kronrod quadrature rule implemented by QuadGK.jl. All standard QuadGK.quadgk
keyword arguments are supported.
MeshIntegrals.GaussLegendre
— TypeGaussLegendre(n)
Numerically integrate using an n
'th-order Gauss-Legendre quadrature rule. Nodes and weights are efficiently calculated using FastGaussQuadrature.jl.
So long as the integrand function can be well-approximated by a polynomial of order 2n-1
, this method should yield results with 16-digit accuracy in O(n)
time. If the function is know to have some periodic content, then n
should (at a minimum) be greater than the expected number of periods over the geometry, e.g. length(geometry)/lambda
.
MeshIntegrals.HAdaptiveCubature
— TypeHAdaptiveCubature(kwargs...)
Numerically integrate areas and surfaces using the h-adaptive cubature rule implemented by HCubature.jl. All standard HCubature.hcubature
keyword arguments are supported.