Public API

Integrals

MeshIntegrals.integralFunction
integral(f, geometry[, rule]; diff_method=_default_diff_method(geometry, FP), FP=Float64)

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: some Meshes.Geometry 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 = _default_diff_method(geometry, FP): the method to

use for calculating Jacobians that are used to calculate differential elements

  • FP = Float64: the floating point precision desired.
source

Specializations

MeshIntegrals.integralMethod
integral(f, curve::BezierCurve, rule = GaussKronrod();
         diff_method=Analytical(), FP=Float64, alg=Meshes.Horner())

Like integral but integrates along the domain defined by curve.

Arguments

  • f: an integrand function, i.e. any callable with a method f(::Meshes.Point)
  • curve: a Meshes.BezierCurve that defines the integration domain
  • rule = GaussKronrod(): optionally, the IntegrationRule used for integration

Keyword Arguments

  • diff_method::DifferentiationMethod = Analytical(): the method to use for

calculating Jacobians that are used to calculate differential elements

  • FP = Float64: the floating point precision desired
  • 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, ring::Ring, rule = GaussKronrod();
         diff_method=FiniteDifference(), FP=Float64)

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.

Arguments

  • f: an integrand function, i.e. any callable with a method f(::Meshes.Point)
  • ring: a Ring that defines the integration domain
  • rule = GaussKronrod(): optionally, the IntegrationRule used for integration

Keyword Arguments

  • diff_method::DifferentiationMethod = FiniteDifference(): the method to use for

calculating Jacobians that are used to calculate differential elements

  • FP = Float64: the floating point precision desired
source
MeshIntegrals.integralMethod
integral(f, rope::Rope, rule = GaussKronrod();
         diff_method=FiniteDifference(), FP=Float64)

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.

Arguments

  • f: an integrand function, i.e. any callable with a method f(::Meshes.Point)
  • rope: a Rope that defines the integration domain
  • rule = GaussKronrod(): optionally, the IntegrationRule used for integration

Keyword Arguments

  • diff_method::DifferentiationMethod = FiniteDifference(): the method to use for

calculating Jacobians that are used to calculate differential elements

  • FP = Float64: the floating point precision desired
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

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