From e8f7c8c8ca16f1d8bac6d8c0eae6a2933a398b08 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sun, 22 Sep 2024 21:55:51 +0000 Subject: [PATCH] build based on 8710148 --- previews/PR79/.documenter-siteinfo.json | 2 +- previews/PR79/api/index.html | 8 ++++---- previews/PR79/index.html | 2 +- previews/PR79/supportmatrix/index.html | 2 +- previews/PR79/triangle/index.html | 2 +- previews/PR79/usage/index.html | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/previews/PR79/.documenter-siteinfo.json b/previews/PR79/.documenter-siteinfo.json index ea55690d..19760379 100644 --- a/previews/PR79/.documenter-siteinfo.json +++ b/previews/PR79/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-09-22T20:57:53","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-09-22T21:55:47","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/previews/PR79/api/index.html b/previews/PR79/api/index.html index c8034bb3..ba258607 100644 --- a/previews/PR79/api/index.html +++ b/previews/PR79/api/index.html @@ -1,10 +1,10 @@ Public API · MeshIntegrals.jl

Public API

Integrals

MeshIntegrals.integralFunction
integral(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 method f(::Meshes.Point)
  • geometry: some Meshes.Geometry that defines the integration domain
  • algorithm: optionally, the IntegrationAlgorithm used for the integration (by default GaussKronrod() in 1D and HAdaptiveCubature() 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).

source

Aliases

MeshIntegrals.lineintegralFunction
lineintegral(f, geometry)
+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 method f(::Meshes.Point)
  • geometry: some Meshes.Geometry that defines the integration domain
  • algorithm: optionally, the IntegrationAlgorithm used for the integration (by default GaussKronrod() in 1D and HAdaptiveCubature() 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).

source

Aliases

MeshIntegrals.lineintegralFunction
lineintegral(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
source
MeshIntegrals.surfaceintegralFunction
surfaceintegral(f, geometry)
+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
source
MeshIntegrals.surfaceintegralFunction
surfaceintegral(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)
source
MeshIntegrals.volumeintegralFunction
volumeintegral(f, geometry)
+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)
source
MeshIntegrals.volumeintegralFunction
volumeintegral(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)
source

Integration Algorithms

MeshIntegrals.GaussKronrodType
GaussKronrod(kwargs...)

Numerically integrate using the h-adaptive Gauss-Kronrod quadrature rule implemented by QuadGK.jl. All standard QuadGK.quadgk keyword arguments are supported.

source
MeshIntegrals.GaussLegendreType
GaussLegendre(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.

source
MeshIntegrals.HAdaptiveCubatureType
GaussKronrod(kwargs...)

Numerically integrate areas and surfaces using the h-adaptive cubature rule implemented by HCubature.jl. All standard HCubature.hcubature keyword arguments are supported.

source
+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:

source

Integration Algorithms

MeshIntegrals.GaussKronrodType
GaussKronrod(kwargs...)

Numerically integrate using the h-adaptive Gauss-Kronrod quadrature rule implemented by QuadGK.jl. All standard QuadGK.quadgk keyword arguments are supported.

source
MeshIntegrals.GaussLegendreType
GaussLegendre(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.

source
MeshIntegrals.HAdaptiveCubatureType
GaussKronrod(kwargs...)

Numerically integrate areas and surfaces using the h-adaptive cubature rule implemented by HCubature.jl. All standard HCubature.hcubature keyword arguments are supported.

source
diff --git a/previews/PR79/index.html b/previews/PR79/index.html index f789a142..a771afa3 100644 --- a/previews/PR79/index.html +++ b/previews/PR79/index.html @@ -1,2 +1,2 @@ -About · MeshIntegrals.jl

MeshIntegrals.jl

Docs-stable Docs-dev License: MIT ColPrac

Build Status codecov Coveralls Aqua QA

MeshIntegrals.jl is a Julia library that leverages differential forms to implement fast and easy numerical integration of field equations over geometric domains.

+About · MeshIntegrals.jl

MeshIntegrals.jl

Docs-stable Docs-dev License: MIT ColPrac

Build Status codecov Coveralls Aqua QA

MeshIntegrals.jl is a Julia library that leverages differential forms to implement fast and easy numerical integration of field equations over geometric domains.

diff --git a/previews/PR79/supportmatrix/index.html b/previews/PR79/supportmatrix/index.html index 61a83ad8..6fb12951 100644 --- a/previews/PR79/supportmatrix/index.html +++ b/previews/PR79/supportmatrix/index.html @@ -1,2 +1,2 @@ -Support Matrix · MeshIntegrals.jl

Support Matrix

While this library aims to support all possible integration algorithms and Meshes.jl geometry types, some combinations are ill-suited and some others are simplu not yet implemented. The following Support Matrix aims to capture the current development state of all geometry/algorithm combinations. Entries with a green check mark are fully supported and have passing unit tests that provide some confidence they produce accurate results.

In general, Gauss-Kronrod integration rules are recommended (and the default) for geometries with one parametric dimension, e.g.: Segment, BezierCurve, and Rope. Gauss-Kronrod rules can also be applied to some geometries with more dimensions by nesting multiple integration solves, but this is inefficient. These Gauss-Kronrod rules are supported (but not recommended) for surface-like geometries, but not for volume-like geometries. For geometries with more than one parametric dimension, e.g. surfaces and volumes, H-Adaptive Cubature integration rules are recommended (and the default).

SymbolSupport Level
Supported, passes unit tests
🎗️Planned to support in the future
🛑Not supported
Meshes.GeometryGauss-LegendreGauss-KronrodH-Adaptive Cubature
Ball in 𝔼{2}
Ball in 𝔼{3}🛑
BezierCurve
Box in 𝔼{1}
Box in 𝔼{2}
Box in 𝔼{3}🛑
Circle
Cone
ConeSurface
Cylinder🛑
CylinderSurface
Disk
Frustum🎗️🎗️🎗️
FrustumSurface
Line
ParaboloidSurface
Plane
Ray
Ring
Rope
Segment
SimpleMesh🎗️🎗️🎗️
Sphere in 𝔼{2}
Sphere in 𝔼{3}
Tetrahedron in 𝔼{3}🎗️🎗️
Triangle
Torus
+Support Matrix · MeshIntegrals.jl

Support Matrix

While this library aims to support all possible integration algorithms and Meshes.jl geometry types, some combinations are ill-suited and some others are simplu not yet implemented. The following Support Matrix aims to capture the current development state of all geometry/algorithm combinations. Entries with a green check mark are fully supported and have passing unit tests that provide some confidence they produce accurate results.

In general, Gauss-Kronrod integration rules are recommended (and the default) for geometries with one parametric dimension, e.g.: Segment, BezierCurve, and Rope. Gauss-Kronrod rules can also be applied to some geometries with more dimensions by nesting multiple integration solves, but this is inefficient. These Gauss-Kronrod rules are supported (but not recommended) for surface-like geometries, but not for volume-like geometries. For geometries with more than one parametric dimension, e.g. surfaces and volumes, H-Adaptive Cubature integration rules are recommended (and the default).

SymbolSupport Level
Supported, passes unit tests
🎗️Planned to support in the future
🛑Not supported
Meshes.GeometryGauss-LegendreGauss-KronrodH-Adaptive Cubature
Ball in 𝔼{2}
Ball in 𝔼{3}🛑
BezierCurve
Box in 𝔼{1}
Box in 𝔼{2}
Box in 𝔼{3}🛑
Circle
Cone
ConeSurface
Cylinder🛑
CylinderSurface
Disk
Frustum🎗️🎗️🎗️
FrustumSurface
Line
ParaboloidSurface
Plane
Ray
Ring
Rope
Segment
SimpleMesh🎗️🎗️🎗️
Sphere in 𝔼{2}
Sphere in 𝔼{3}
Tetrahedron in 𝔼{3}🎗️🎗️
Triangle
Torus
diff --git a/previews/PR79/triangle/index.html b/previews/PR79/triangle/index.html index 1b3b9a9e..e9ea3b70 100644 --- a/previews/PR79/triangle/index.html +++ b/previews/PR79/triangle/index.html @@ -4,4 +4,4 @@ = 2A \int_0^1 \int_0^{1-v} f\left( \bar{r}(u,v) \right) \, \text{d}u \, \text{d}v\]

Since the integral domain is a right-triangle in the Barycentric domain, a nested application of Gauss-Kronrod quadrature rules is capable of computing the result, albeit inefficiently. However, many numerical integration methods that require rectangular bounds can not be directly applied.

In order to enable integration methods that operate over rectangular bounds, two coordinate system transformations are applied: the first maps from Barycentric coordinates $(u, v)$ to polar coordinates $(r, \phi)$, and the second is a non-linear map from polar coordinates to a new curvilinear basis $(R, \phi)$.

For the first transformation, let $u = r~\cos\phi$ and $v = r~\sin\phi$ where $\text{d}u~\text{d}v = r~\text{d}r~\text{d}\phi$. The Barycentric triangle's hypotenuse boundary line is described by the function $v(u) = 1 - u$. Substituting in the previous definitions leads to a new boundary line function in polar coordinate space $r(\phi) = 1 / (\sin\phi + \cos\phi)$.

\[\int_0^1 \int_0^{1-v} f\left( \bar{r}(u,v) \right) \, \text{d}u \, \text{d}v = \int_0^{\pi/2} \int_0^{1/(\sin\phi+\cos\phi)} f\left( \bar{r}(r,\phi) \right) \, r \, \text{d}r \, \text{d}\phi\]

These integral boundaries remain non-rectangular, so an additional transformation will be applied to a curvilinear $(R, \phi)$ space that normalizes all of the hypotenuse boundary line points to $R=1$. To achieve this, a function $R(r,\phi)$ is required such that $R(r_0, \phi) = 1$ where $r_0 = 1 / (\sin\phi + \cos\phi)$

To achieve this, let $R(r, \phi) = r~(\sin\phi + \cos\phi)$. Now, substituting some terms leads to

\[\int_0^{\pi/2} \int_0^{1/(\sin\phi+\cos\phi)} f\left( \bar{r}(r,\phi) \right) \, r \, \text{d}r \, \text{d}\phi = \int_0^{\pi/2} \int_0^{r_0} f\left( \bar{r}(r,\phi) \right) \, \left(\frac{R}{\sin\phi + \cos\phi}\right) \, \text{d}r \, \text{d}\phi\]

Since $\text{d}R/\text{d}r = \sin\phi + \cos\phi$, a change of integral domain leads to

\[\int_0^{\pi/2} \int_0^{r_0} f\left( \bar{r}(r,\phi) \right) \, \left(\frac{R}{\sin\phi + \cos\phi}\right) \, \text{d}r \, \text{d}\phi - = \int_0^{\pi/2} \int_0^1 f\left( \bar{r}(R,\phi) \right) \, \left(\frac{R}{\left(\sin\phi + \cos\phi\right)^2}\right) \, \text{d}R \, \text{d}\phi\]

The second term in this new integrand function serves as a correction factor that corrects for the impact of the non-linear domain transformation. Since all of the integration bounds are now constants, specialized integration methods can be defined for triangles that performs these domain transformations and then solve the new rectangular integration problem using a wider range of solver options.

+ = \int_0^{\pi/2} \int_0^1 f\left( \bar{r}(R,\phi) \right) \, \left(\frac{R}{\left(\sin\phi + \cos\phi\right)^2}\right) \, \text{d}R \, \text{d}\phi\]

The second term in this new integrand function serves as a correction factor that corrects for the impact of the non-linear domain transformation. Since all of the integration bounds are now constants, specialized integration methods can be defined for triangles that performs these domain transformations and then solve the new rectangular integration problem using a wider range of solver options.

diff --git a/previews/PR79/usage/index.html b/previews/PR79/usage/index.html index 93b858c0..6404e4da 100644 --- a/previews/PR79/usage/index.html +++ b/previews/PR79/usage/index.html @@ -23,4 +23,4 @@ integral(f, unit_circle_bz, GaussKronrod()) # 0.017122 seconds (18.93 k allocations: 78.402 MiB) - # ans = 5.551055333711397 m^2 + # ans = 5.551055333711397 m^2