Skip to content

Commit

Permalink
Improve documentation (#62)
Browse files Browse the repository at this point in the history
* Update Support Matrix page

* Add page for algorithms

* Add page for example usage

* Remove support matrix from README
  • Loading branch information
mikeingold authored Sep 4, 2024
1 parent d0248d3 commit 450cc1d
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 73 deletions.
39 changes: 0 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,42 +48,3 @@ integral(f, unit_circle_bz, GaussKronrod())
# 0.017122 seconds (18.93 k allocations: 78.402 MiB)
# ans = 5.551055333711397 m^2
```

# 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: |
4 changes: 3 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ makedocs(
pages = [
"Home" => [
"About" => "index.md",
"Support Matrix" => "supportmatrix.md"
"Support Matrix" => "supportmatrix.md",
"Integration Algorithms" => "algorithms.md",
"Example Usage" => "usage.md"
],
"Derivations" => [
"Integrating a Triangle" => "triangle.md"
Expand Down
19 changes: 19 additions & 0 deletions docs/src/algorithms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Integration Algorithms

## Gauss-Kronrod

```@docs
MeshIntegrals.GaussKronrod
```

## Gauss-Legendre

```@docs
MeshIntegrals.GaussLegendre
```

## H-Adaptive Cubature

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

| Symbol | Meaning |
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).

| Symbol | Support Level |
|--------|---------|
| :white_check_mark: | Implemented, passes tests |
| :x: | Not yet supported |
| :stop_sign: | Not supported |
| | Supported, passes unit tests |
| 🎗️ | Planned to support in the future |
| 🛑 | Not supported |

### Integral
| Geometry | Gauss-Legendre | Gauss-Kronrod | H-Adaptive Cubature |
| `Meshes.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: |
| `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` | | | |
31 changes: 31 additions & 0 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Example Usage

## Integrating along a Bezier curve

```julia
using Meshes
using MeshIntegrals

# Define a unit circle on the xy-plane
origin = Point(0,0,0)
= Vec(0,0,1)
xy_plane = Plane(origin,ẑ)
unit_circle_xy = Circle(xy_plane, 1.0)

# Approximate unit_circle_xy with a high-order Bezier curve
unit_circle_bz = BezierCurve(
[Point(cos(t), sin(t), 0.0) for t in range(0,2pi,length=361)]
)

# A Real-valued function
f(x, y, z) = abs(x + y)
f(p) = f(to(p)...)

integral(f, unit_circle_xy, GaussKronrod())
# 0.000170 seconds (5.00 k allocations: 213.531 KiB)
# ans == 5.656854249525293 m^2

integral(f, unit_circle_bz, GaussKronrod())
# 0.017122 seconds (18.93 k allocations: 78.402 MiB)
# ans = 5.551055333711397 m^2
```

0 comments on commit 450cc1d

Please sign in to comment.