Skip to content

Commit

Permalink
Improve docs (#61)
Browse files Browse the repository at this point in the history
* Incorporate triangle doc

* Update derivation

* Add Support Matrix and API pages

* Remove external references
  • Loading branch information
mikeingold authored Sep 2, 2024
1 parent 7523e91 commit d0248d3
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 72 deletions.
14 changes: 13 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
using Documenter
using MeshIntegrals

makedocs(sitename="MeshIntegrals.jl Documentation")
makedocs(
sitename="MeshIntegrals.jl",
pages = [
"Home" => [
"About" => "index.md",
"Support Matrix" => "supportmatrix.md"
],
"Derivations" => [
"Integrating a Triangle" => "triangle.md"
],
"Public API" => "api.md"
]
)

deploydocs(repo = "github.com/mikeingold/MeshIntegrals.jl.git")
23 changes: 23 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Public API

## Integrals

```@docs
MeshIntegrals.integral
```

### Aliases

```@docs
MeshIntegrals.lineintegral
MeshIntegrals.surfaceintegral
MeshIntegrals.volumeintegral
```

## Integration Algorithms

```@docs
MeshIntegrals.GaussKronrod
MeshIntegrals.GaussLegendre
MeshIntegrals.HAdaptiveCubature
```
38 changes: 38 additions & 0 deletions docs/src/supportmatrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Support Matrix

| Symbol | Meaning |
|--------|---------|
| :white_check_mark: | Implemented, passes tests |
| :x: | Not yet supported |
| :stop_sign: | Not supported |

### Integral
| Geometry | Gauss-Legendre | Gauss-Kronrod | H-Adaptive Cubature |
|----------|----------------|---------------|---------------------|
| `Ball` in `𝔼{2}` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Ball` in `𝔼{3}` | :white_check_mark: | :stop_sign: | :white_check_mark: |
| `BezierCurve` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Box` in `𝔼{1}` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Box` in `𝔼{2}` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Box` in `𝔼{3}` | :white_check_mark: | :stop_sign: | :white_check_mark: |
| `Circle` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Cone` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `ConeSurface` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Cylinder` | :white_check_mark: | :stop_sign: | :white_check_mark: |
| `CylinderSurface` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Disk` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Frustum` | :stop_sign: | :stop_sign: | :stop_sign: |
| `FrustumSurface` | :stop_sign: | :stop_sign: | :stop_sign: |
| `Line` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `ParaboloidSurface` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Plane` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Ray` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Ring` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Rope` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Segment` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SimpleMesh` | :x: | :x: | :x: |
| `Sphere` in `𝔼{2}` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Sphere` in `𝔼{3}` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Tetrahedron` in `𝔼{3}` | :x: | :white_check_mark: | :x: |
| `Triangle` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `Torus` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
17 changes: 17 additions & 0 deletions docs/src/triangle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Integrating a Triangle

For a specified `Meshes.Triangle` surface with area $A$, let $u$ and $v$ be Barycentric coordinates that span the surface.
```math
\int_\triangle f(\bar{r}) \, \text{d}A
= \iint_\triangle f\left( \bar{r}(u,v) \right) \, \left( \text{d}u \wedge \text{d}v \right)
```

Since the geometric transformation from the originally-arbitrary domain to a Barycentric domain is linear, the magnitude of the surface element $\text{d}u \wedge \text{d}v$ is constant throughout the integration domain. This constant will be equal to twice the magnitude of $A$.
```math
\int_\triangle f(\bar{r}) \, \text{d}A
= 2A \int_0^1 \int_0^{1-v} f\left( \bar{r}(u,v) \right) \, \text{d}u \, \text{d}v
```

This non-rectangular Barycentric domain prevents a direct application of most numerical integration methods. It can be directly integrated, albeit inefficiently, using nested Gauss-Kronrod quadrature rules. Alternatively, additional transformation could be applied to map this domain onto a rectangular domain.

**WORK IN PROGRESS:** continued derivation to detail this barycentric-rectangular domain transformation
69 changes: 0 additions & 69 deletions docs/surfaceintegral_triangle.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/integral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract type IntegrationAlgorithm end
GaussKronrod(kwargs...)
Numerically integrate using the h-adaptive Gauss-Kronrod quadrature rule implemented
by QuadGK.jl. All standard [`QuadGK.quadgk`](@ref) keyword arguments are supported.
by QuadGK.jl. All standard `QuadGK.quadgk` keyword arguments are supported.
"""
struct GaussKronrod <: IntegrationAlgorithm
kwargs
Expand All @@ -35,7 +35,7 @@ end
GaussKronrod(kwargs...)
Numerically integrate areas and surfaces using the h-adaptive cubature rule
implemented by HCubature.jl. All standard [`HCubature.hcubature`](@ref) keyword
implemented by HCubature.jl. All standard `HCubature.hcubature` keyword
arguments are supported.
"""
struct HAdaptiveCubature <: IntegrationAlgorithm
Expand Down

0 comments on commit d0248d3

Please sign in to comment.