Public API

Integrals

MeshIntegrals.integralFunction
integral(f, geometry[, rule]; kwargs...)

Numerically integrate a given function f(::Point) over the domain defined by a geometry using a particular numerical integration rule with floating point precision of type FP.

Arguments

  • f: an integrand function, i.e. any callable with a method f(::Meshes.Point)
  • geometry: a Meshes.jl Geometry or Domain that defines the integration domain
  • rule: optionally, the IntegrationRule used for integration (by default

GaussKronrod() in 1D and HAdaptiveCubature() else)

Keyword Arguments

  • diff_method::DifferentiationMethod: manually specifies the differentiation method use to

calculate Jacobians within the integration domain.

  • FP = Float64: manually specifies the desired output floating point precision
source

Specializations

MeshIntegrals.integralMethod
integral(f, curve::BezierCurve[, rule = GaussKronrod()]; kwargs...)

Like integral but integrates along the domain defined by curve.

Special Keyword Arguments

  • alg = Meshes.Horner(): the method to use for parametrizing curve. Alternatively,

alg=Meshes.DeCasteljau() can be specified for increased accuracy, but comes with a steep performance cost, especially for curves with a large number of control points.

source
MeshIntegrals.integralMethod
integral(f, area::PolyArea[, rule = HAdaptiveCubature()]; kwargs...)

Like integral but integrates over the surface domain defined by a PolyArea. The surface is first discretized into facets that are integrated independently using the specified integration rule.

source
MeshIntegrals.integralMethod
integral(f, ring::Ring[, rule = GaussKronrod()]; kwargs...)

Like integral but integrates along the domain defined by ring. The specified integration rule is applied independently to each segment formed by consecutive points in the Ring.

source
MeshIntegrals.integralMethod
integral(f, rope::Rope[, rule = GaussKronrod()]; kwargs...)

Like integral but integrates along the domain defined by rope. The specified integration rule is applied independently to each segment formed by consecutive points in the Rope.

source
MeshIntegrals._ParametricGeometryType
_ParametricGeometry <: Meshes.Primitive <: Meshes.Geometry

_ParametricGeometry is used internally in MeshIntegrals.jl to behave like a generic wrapper for geometries with custom parametric functions. This type is used for transforming other geometries to enable integration over the standard rectangular [0,1]^n domain.

Meshes.jl adopted a ParametrizedCurve type that performs a similar role as of v0.51.20, but only supports geometries with one parametric dimension. Support is additionally planned for more types that span surfaces and volumes, at which time this custom type will probably no longer be required.

Fields

  • fun - anything callable representing a parametric function: (ts...) -> Meshes.Point

Type Structure

  • M <: Meshes.Manifold - same usage as in Meshes.Geometry{M, C}
  • C <: CoordRefSystems.CRS - same usage as in Meshes.Geometry{M, C}
  • F - type of the callable parametric function
  • Dim - number of parametric dimensions
source
MeshIntegrals._ParametricGeometryMethod
_ParametricGeometry(fun, dims)

Construct a _ParametricGeometry using a provided parametric function fun for a geometry with dims parametric dimensions.

Arguments

  • fun - anything callable representing a parametric function mapping (ts...) -> Meshes.Point
  • dims::Int64 - number of parametric dimensions, i.e. length(ts)
source
MeshIntegrals._parametricFunction
_parametric(geometry::G) where {G <: Meshes.Geometry} -> Function

Used in MeshIntegrals.jl for defining parametric functions that transform non-standard geometries into a form that can be integrated over the standard rectangular [0,1]^n limits.

source

Aliases

MeshIntegrals.lineintegralFunction
lineintegral(f, geometry[, rule]; FP=Float64)

Numerically integrate a given function f(::Point) along a line-like geometry using a particular numerical integration rule with floating point precision of type FP.

This is a convenience wrapper around integral that additionally enforces a requirement that the geometry have one parametric dimension.

Rule types available:

source
MeshIntegrals.surfaceintegralFunction
surfaceintegral(f, geometry[, rule]; FP=Float64)

Numerically integrate a given function f(::Point) along a surface geometry using a particular numerical integration rule with floating point precision of type FP.

This is a convenience wrapper around integral that additionally enforces a requirement that the geometry have two parametric dimensions.

Algorithm types available:

source
MeshIntegrals.volumeintegralFunction
volumeintegral(f, geometry[, rule]; FP=Float64)

Numerically integrate a given function f(::Point) throughout a volumetric geometry using a particular numerical integration rule with floating point precision of type FP.

This is a convenience wrapper around integral that additionally enforces a requirement that the geometry have three parametric dimensions.

Algorithm types available:

source

Integration Rules

MeshIntegrals.GaussKronrodType
GaussKronrod(kwargs...)

The h-adaptive Gauss-Kronrod quadrature rule implemented by QuadGK.jl. All standard QuadGK.quadgk keyword arguments are supported. This rule works natively for one dimensional geometries; some two- and three-dimensional geometries are additionally supported using nested integral solvers with the specified kwarg settings.

source
MeshIntegrals.GaussLegendreType
GaussLegendre(n)

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)/λ.

source

Derivatives

MeshIntegrals.FiniteDifferenceType
FiniteDifference(ε=1e-6)

Use to specify use of a finite-difference approximation method with a step size of ε for calculating derivatives.

source
MeshIntegrals.differentialMethod
differential(geometry, ts[, diff_method])

Calculate the differential element (length, area, volume, etc) of the parametric function for geometry at arguments ts. Optionally, direct the use of a particular differentiation method diff_method; by default use analytic solutions where possible and finite difference approximations otherwise.

Arguments

  • geometry: some Meshes.Geometry of N parametric dimensions
  • ts: a parametric point specified as a vector or tuple of length N
  • diff_method: the desired DifferentiationMethod to use
source
MeshIntegrals.jacobianMethod
jacobian(geometry, ts[, diff_method])

Calculate the Jacobian of a geometry's parametric function at some point ts. Optionally, direct the use of a particular differentiation method diff_method; by default use analytic solutions where possible and finite difference approximations otherwise.

Arguments

  • geometry: some Meshes.Geometry of N parametric dimensions
  • ts: a parametric point specified as a vector or tuple of length N
  • diff_method: the desired DifferentiationMethod to use
source