Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Lampert <[email protected]>
  • Loading branch information
mikeingold and JoshuaLampert authored Nov 28, 2024
1 parent 4239cd2 commit 5551192
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/supportmatrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
This library aims to enable users to calculate the value of integrals over all [**Meshes.jl**](https://github.com/JuliaGeometry/Meshes.jl)
geometry types using an array of numerical integration rules and techniques. However, some
combinations of geometry types and integration rules are ill-suited, and some others are simply
not yet yet implemented. The following Support Matrix captures the current state of support for
not yet implemented. The following Support Matrix captures the current state of support for
all geometry/rule combinations. Entries with a green check mark are fully supported and pass
unit tests designed to check for accuracy.

In general, Gauss-Kronrod integration rules are recommended (and the default) for geometries
with one parametric dimension, e.g.: `Segment`, `BezierCurve`, and `Rope`. or geometries with
with one parametric dimension, e.g.: `Segment`, `BezierCurve`, and `Rope`. For geometries with
more than one parametric dimension, e.g. surfaces and volumes, H-Adaptive Cubature rules are
recommended (and the default).

Expand Down
6 changes: 3 additions & 3 deletions src/integral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function _integral(
diff_method::DM = _default_method(geometry)
) where {DM <: DifferentiationMethod, T <: AbstractFloat}
# Implementation depends on number of parametric dimensions over which to integrate
const N = Meshes.paramdim(geometry)
N = Meshes.paramdim(geometry)
if N == 1
integrand(t) = f(geometry(t)) * differential(geometry, (t,), diff_method)
return QuadGK.quadgk(integrand, zero(FP), one(FP); rule.kwargs...)[1]
Expand All @@ -72,7 +72,7 @@ function _integral(
FP::Type{T} = Float64,
diff_method::DM = _default_method(geometry)
) where {DM <: DifferentiationMethod, T <: AbstractFloat}
const N = Meshes.paramdim(geometry)
N = Meshes.paramdim(geometry)

# Get Gauss-Legendre nodes and weights for a region [-1,1]^N
xs, ws = _gausslegendre(FP, rule.n)
Expand All @@ -98,7 +98,7 @@ function _integral(
FP::Type{T} = Float64,
diff_method::DM = _default_method(geometry)
) where {DM <: DifferentiationMethod, T <: AbstractFloat}
const N = Meshes.paramdim(geometry)
N = Meshes.paramdim(geometry)

integrand(ts) = f(geometry(ts...)) * differential(geometry, ts, diff_method)

Expand Down

0 comments on commit 5551192

Please sign in to comment.