From ef2d82e1025d5a8e55ad9786df9f550d899efdf0 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 14:04:01 -0500 Subject: [PATCH 01/19] Rename to _default_diff_method --- src/integral.jl | 6 +++--- src/utils.jl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 8777b86b..2535e21b 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -42,7 +42,7 @@ function _integral( geometry, rule::GaussKronrod; FP::Type{T} = Float64, - diff_method::DM = _default_method(geometry) + diff_method::DM = _default_diff_method(geometry) ) where {DM <: DifferentiationMethod, T <: AbstractFloat} # Implementation depends on number of parametric dimensions over which to integrate N = Meshes.paramdim(geometry) @@ -70,7 +70,7 @@ function _integral( geometry, rule::GaussLegendre; FP::Type{T} = Float64, - diff_method::DM = _default_method(geometry) + diff_method::DM = _default_diff_method(geometry) ) where {DM <: DifferentiationMethod, T <: AbstractFloat} N = Meshes.paramdim(geometry) @@ -96,7 +96,7 @@ function _integral( geometry, rule::HAdaptiveCubature; FP::Type{T} = Float64, - diff_method::DM = _default_method(geometry) + diff_method::DM = _default_diff_method(geometry) ) where {DM <: DifferentiationMethod, T <: AbstractFloat} N = Meshes.paramdim(geometry) diff --git a/src/utils.jl b/src/utils.jl index 1e5292f8..52f3aa8d 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -27,14 +27,14 @@ _ones(N::Int) = _ones(Float64, N) ################################################################################ # Return the default DifferentiationMethod instance for a particular geometry type -function _default_method( +function _default_diff_method( g::Type{G} ) where {G <: Geometry} return FiniteDifference() end # Return the default DifferentiationMethod instance for a particular geometry instance -_default_method(g::G) where {G <: Geometry} = _default_method(G) +_default_diff_method(g::G) where {G <: Geometry} = _default_diff_method(G) ################################################################################ # CliffordNumbers and Units From d5bc58fa77188a630e05e102e366da857dfacff8 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 14:11:24 -0500 Subject: [PATCH 02/19] Organize and add docstrings --- src/utils.jl | 57 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 52f3aa8d..5ac0d03c 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -2,26 +2,12 @@ # Misc. Internal Tools ################################################################################ -# Calculate Gauss-Legendre nodes/weights and convert to type T -function _gausslegendre(T, n) - xs, ws = FastGaussQuadrature.gausslegendre(n) - return T.(xs), T.(ws) -end - # Common error message structure function _error_unsupported_combination(geometry, rule) msg = "Integrating a $geometry using a $rule rule not supported." throw(ArgumentError(msg)) end -# Return an NTuple{N, T} of zeros; same interface as Base.zeros() but faster -_zeros(T::DataType, N::Int64) = ntuple(_ -> zero(T), N) -_zeros(N::Int) = _zeros(Float64, N) - -# Return an NTuple{N, T} of ones; same interface as Base.ones() but faster -_ones(T::DataType, N::Int64) = ntuple(_ -> one(T), N) -_ones(N::Int) = _ones(Float64, N) - ################################################################################ # DifferentiationMethod ################################################################################ @@ -37,15 +23,52 @@ end _default_diff_method(g::G) where {G <: Geometry} = _default_diff_method(G) ################################################################################ -# CliffordNumbers and Units +# Numerical Tools ################################################################################ -# Meshes.Vec -> Unitful.Quantity{CliffordNumber.KVector} +# Calculate Gauss-Legendre nodes/weights and convert to type T +""" + _gausslegendre(T, n) + +Return FastGaussQuadrature.gausslegendre(n) in type T. +""" +function _gausslegendre(T, n) + xs, ws = FastGaussQuadrature.gausslegendre(n) + return T.(xs), T.(ws) +end + +""" + _KVector(v::Meshes.Vec) -> Unitful.Quantity{CliffordNumbers.KVector} + +Convert a `Vec` to a Unitful KVector. +""" function _KVector(v::Meshes.Vec{Dim, T}) where {Dim, T} ucoords = Iterators.map(Unitful.ustrip, v.coords) return CliffordNumbers.KVector{1, VGA(Dim)}(ucoords...) * _units(v) end -# Extract the length units used by the CRS of a Geometry +""" + _units(geometry) + +Return the Unitful units associated with a particular `geometry`. +""" _units(::Geometry{M, CRS}) where {M, CRS} = Unitful.unit(CoordRefSystems.lentype(CRS)) _units(::Meshes.Vec{Dim, T}) where {Dim, T} = Unitful.unit(T) + +""" + _zeros(T = Float64, N) + +Return an `NTuple{N, T}` filled with zeros. This method avoids allocating an array, which +happens when using `Base.zeros`. +""" +_zeros(T::DataType, N::Int64) = ntuple(_ -> zero(T), N) +_zeros(N::Int) = _zeros(Float64, N) + +""" + _ones(T = Float64, N) + +Return an `NTuple{N, T}` filled with ones. This method avoids allocating an array, which +happens when using `Base.ones`. +""" +_ones(T::DataType, N::Int64) = ntuple(_ -> one(T), N) +_ones(N::Int) = _ones(Float64, N) From ce82526878af44c44e76789d72bedb812101c372 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 14:19:03 -0500 Subject: [PATCH 03/19] Absorb _gausslegendre into only remaining GaussLegendre method --- src/integral.jl | 10 ++++++---- src/utils.jl | 11 ----------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 2535e21b..2dbb0cdd 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -74,10 +74,12 @@ function _integral( ) where {DM <: DifferentiationMethod, T <: AbstractFloat} N = Meshes.paramdim(geometry) - # Get Gauss-Legendre nodes and weights for a region [-1,1]^N - xs, ws = _gausslegendre(FP, rule.n) - weights = Iterators.product(ntuple(Returns(ws), N)...) - nodes = Iterators.product(ntuple(Returns(xs), N)...) + # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ + xs, ws = FastGaussQuadrature.gausslegendre(N) + xsT = Iterator.map(FP, xs) + wsT = Iterator.map(FP, ws) + weights = Iterators.product(ntuple(Returns(wsT), N)...) + nodes = Iterators.product(ntuple(Returns(xsT), N)...) # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) diff --git a/src/utils.jl b/src/utils.jl index 5ac0d03c..954dcf08 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -26,17 +26,6 @@ _default_diff_method(g::G) where {G <: Geometry} = _default_diff_method(G) # Numerical Tools ################################################################################ -# Calculate Gauss-Legendre nodes/weights and convert to type T -""" - _gausslegendre(T, n) - -Return FastGaussQuadrature.gausslegendre(n) in type T. -""" -function _gausslegendre(T, n) - xs, ws = FastGaussQuadrature.gausslegendre(n) - return T.(xs), T.(ws) -end - """ _KVector(v::Meshes.Vec) -> Unitful.Quantity{CliffordNumbers.KVector} From 8a6bd871e5c2cc2a2cfba1f7890f59319312dbc7 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 14:28:01 -0500 Subject: [PATCH 04/19] Fix typo --- src/integral.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 2dbb0cdd..eb080673 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -76,8 +76,8 @@ function _integral( # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ xs, ws = FastGaussQuadrature.gausslegendre(N) - xsT = Iterator.map(FP, xs) - wsT = Iterator.map(FP, ws) + xsT = Iterators.map(FP, xs) + wsT = Iterators.map(FP, ws) weights = Iterators.product(ntuple(Returns(wsT), N)...) nodes = Iterators.product(ntuple(Returns(xsT), N)...) From 43659738834067a9aa157e828859e59d6e353adc Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 14:28:55 -0500 Subject: [PATCH 05/19] Update tests --- test/utils.jl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/utils.jl b/test/utils.jl index 545b2540..a75e5d7e 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -20,15 +20,12 @@ end @testitem "DifferentiationMethod" setup=[Setup] begin - using MeshIntegrals: _default_method - - # Test geometries - sphere = Sphere(Point(0, 0, 0), 1.0) - triangle = Triangle(Point(0, 0, 0), Point(0, 1, 0), Point(1, 0, 0)) + using MeshIntegrals: _default_diff_method # _default_method - @test _default_method(Meshes.Sphere) isa FiniteDifference - @test _default_method(sphere) isa FiniteDifference + sphere = Sphere(Point(0, 0, 0), 1.0) + @test _default_diff_method(Meshes.Sphere) isa FiniteDifference + @test _default_diff_method(sphere) isa FiniteDifference # FiniteDifference @test FiniteDifference().ε ≈ 1e-6 From 7789cfbcbf0aeef69a50a9bc543a28fca69a9e1a Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:00:40 -0500 Subject: [PATCH 06/19] Simplify to address inaccurate results --- src/integral.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index eb080673..d0bbee73 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -76,10 +76,8 @@ function _integral( # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ xs, ws = FastGaussQuadrature.gausslegendre(N) - xsT = Iterators.map(FP, xs) - wsT = Iterators.map(FP, ws) - weights = Iterators.product(ntuple(Returns(wsT), N)...) - nodes = Iterators.product(ntuple(Returns(xsT), N)...) + weights = Iterators.product(ntuple(Returns(FP.(ws)), N)...) + nodes = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) From 73da696ab04c8b4758ae5924ca5b1f52852ad229 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:10:41 -0500 Subject: [PATCH 07/19] Bugfix (wrong N) --- src/integral.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index d0bbee73..8ec759b0 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -75,15 +75,15 @@ function _integral( N = Meshes.paramdim(geometry) # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ - xs, ws = FastGaussQuadrature.gausslegendre(N) - weights = Iterators.product(ntuple(Returns(FP.(ws)), N)...) - nodes = Iterators.product(ntuple(Returns(FP.(xs)), N)...) + xs, ws = FastGaussQuadrature.gausslegendre(rule.N) + weights = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators + nodes = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) function integrand((weights, nodes)) - ts = t.(nodes) + ts = t.(nodes) # TODO Iterators prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method) end From f6d2c1044f28156f7f920c32c5eeed79f271a73d Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:20:12 -0500 Subject: [PATCH 08/19] Lowercase n, make ts an ntuple --- src/integral.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 8ec759b0..f72364fe 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -75,7 +75,7 @@ function _integral( N = Meshes.paramdim(geometry) # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ - xs, ws = FastGaussQuadrature.gausslegendre(rule.N) + xs, ws = FastGaussQuadrature.gausslegendre(rule.n) weights = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators nodes = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators @@ -83,7 +83,9 @@ function _integral( t(x) = (1 // 2) * x + (1 // 2) function integrand((weights, nodes)) - ts = t.(nodes) # TODO Iterators + # Transforms nodes/xs, store in an NTuple + ts = ntuple(i -> t(nodes[i]), length(nodes)) + # Integrand function prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method) end From cb5a1b619a714479eaf0fb795844c9ceb22d25f5 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:35:03 -0500 Subject: [PATCH 09/19] Rename variables for clarity --- src/integral.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index f72364fe..0be0014a 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -76,8 +76,8 @@ function _integral( # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ xs, ws = FastGaussQuadrature.gausslegendre(rule.n) - weights = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators - nodes = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators + weight_grid = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators + node_grid = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) @@ -89,7 +89,7 @@ function _integral( prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method) end - return (1 // (2^N)) .* sum(integrand, zip(weights, nodes)) + return (1 // (2^N)) .* sum(integrand, zip(weight_grid, node_grid)) end # HAdaptiveCubature From 610f26354d43b5d2492d7f0d78163013bc738435 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:37:34 -0500 Subject: [PATCH 10/19] Reduce line length --- test/combinations.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/combinations.jl b/test/combinations.jl index ed32a0a7..2ffb1b9a 100644 --- a/test/combinations.jl +++ b/test/combinations.jl @@ -66,9 +66,7 @@ end end @testitem "Meshes.BezierCurve" setup=[Setup] begin - curve = BezierCurve( - [Point(t * u"m", sin(t) * u"m", 0.0u"m") for t in range(-pi, pi, length = 361)] - ) + curve = BezierCurve([Point(t, sin(t), 0) for t in range(-pi, pi, length = 361)]) function f(p::P) where {P <: Meshes.Point} ux = ustrip(p.coords.x) From c9a03f09f60fefefa2393a37bccfdccdcb1608a9 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:39:28 -0500 Subject: [PATCH 11/19] Update old names --- src/differentiation.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/differentiation.jl b/src/differentiation.jl index 95232357..4433fd49 100644 --- a/src/differentiation.jl +++ b/src/differentiation.jl @@ -52,7 +52,7 @@ function jacobian( geometry::G, ts::Union{AbstractVector{T}, Tuple{T, Vararg{T}}} ) where {G <: Geometry, T <: AbstractFloat} - return jacobian(geometry, ts, _default_method(G)) + return jacobian(geometry, ts, _default_diff_method(G)) end function jacobian( @@ -107,7 +107,7 @@ possible and finite difference approximations otherwise. function differential( geometry::G, ts::Union{AbstractVector{T}, Tuple{T, Vararg{T}}}, - diff_method::DifferentiationMethod = _default_method(G) + diff_method::DifferentiationMethod = _default_diff_method(G) ) where {G <: Geometry, T <: AbstractFloat} J = Iterators.map(_KVector, jacobian(geometry, ts, diff_method)) return LinearAlgebra.norm(foldl(∧, J)) From 0e402c169322ab6f80f73da4ad2f2db79efe5267 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 15:54:40 -0500 Subject: [PATCH 12/19] Try with Iterators --- src/integral.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 0be0014a..cdc2eadc 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -76,8 +76,10 @@ function _integral( # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ xs, ws = FastGaussQuadrature.gausslegendre(rule.n) - weight_grid = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators - node_grid = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators + xsFP = Iterator.map(FP, xs) + wsFP = Iterator.map(FP, ws) + weight_grid = Iterators.product(ntuple(Returns(wsFP), N)...) + node_grid = Iterators.product(ntuple(Returns(xsFP), N)...) # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) From 6ef39bc2559e10cd4a1b2fc6c503dfc85c59c0c5 Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 16:01:56 -0500 Subject: [PATCH 13/19] Typo fix --- src/integral.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index cdc2eadc..1fc77d44 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -76,8 +76,8 @@ function _integral( # Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ xs, ws = FastGaussQuadrature.gausslegendre(rule.n) - xsFP = Iterator.map(FP, xs) - wsFP = Iterator.map(FP, ws) + xsFP = Iterators.map(FP, xs) + wsFP = Iterators.map(FP, ws) weight_grid = Iterators.product(ntuple(Returns(wsFP), N)...) node_grid = Iterators.product(ntuple(Returns(xsFP), N)...) From 10a2c341a7fcabda7565c565d2a2e29da7ce8206 Mon Sep 17 00:00:00 2001 From: Michael Ingold Date: Mon, 2 Dec 2024 16:48:41 -0500 Subject: [PATCH 14/19] Use stored length --- src/integral.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integral.jl b/src/integral.jl index 1fc77d44..9953d6d7 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -86,7 +86,7 @@ function _integral( function integrand((weights, nodes)) # Transforms nodes/xs, store in an NTuple - ts = ntuple(i -> t(nodes[i]), length(nodes)) + ts = ntuple(i -> t(nodes[i]), rule.n) # Integrand function prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method) end From 143442ebcbbda9f6c215fcbf12baddf6ee8bb16e Mon Sep 17 00:00:00 2001 From: Mike Ingold Date: Mon, 2 Dec 2024 17:03:08 -0500 Subject: [PATCH 15/19] Fix number, wrong N --- src/integral.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integral.jl b/src/integral.jl index 9953d6d7..426261ba 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -86,7 +86,7 @@ function _integral( function integrand((weights, nodes)) # Transforms nodes/xs, store in an NTuple - ts = ntuple(i -> t(nodes[i]), rule.n) + ts = ntuple(i -> t(nodes[i]), N) # Integrand function prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method) end From cfafe11fd20b5ce8bc5afa9e2036f5a149ac866e Mon Sep 17 00:00:00 2001 From: Michael Ingold Date: Mon, 2 Dec 2024 19:31:37 -0500 Subject: [PATCH 16/19] Pass-through N vs global access --- src/integral.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integral.jl b/src/integral.jl index 426261ba..782c02cb 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -84,7 +84,7 @@ function _integral( # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) - function integrand((weights, nodes)) + function integrand((weights, nodes); N=N) # Transforms nodes/xs, store in an NTuple ts = ntuple(i -> t(nodes[i]), N) # Integrand function From c63c7382f9894d082331ea83137b6ebaad789326 Mon Sep 17 00:00:00 2001 From: Michael Ingold Date: Mon, 2 Dec 2024 22:09:46 -0500 Subject: [PATCH 17/19] Abandon use of N --- src/integral.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integral.jl b/src/integral.jl index 782c02cb..1fc77d44 100644 --- a/src/integral.jl +++ b/src/integral.jl @@ -84,9 +84,9 @@ function _integral( # Domain transformation: x [-1,1] ↦ t [0,1] t(x) = (1 // 2) * x + (1 // 2) - function integrand((weights, nodes); N=N) + function integrand((weights, nodes)) # Transforms nodes/xs, store in an NTuple - ts = ntuple(i -> t(nodes[i]), N) + ts = ntuple(i -> t(nodes[i]), length(nodes)) # Integrand function prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method) end From f78d728079d1ab1ac60fedc1554f081629b68d58 Mon Sep 17 00:00:00 2001 From: Michael Ingold Date: Tue, 3 Dec 2024 09:52:09 -0500 Subject: [PATCH 18/19] Update utils.jl Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com> --- test/utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.jl b/test/utils.jl index a75e5d7e..50cb4ea1 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -22,7 +22,7 @@ end @testitem "DifferentiationMethod" setup=[Setup] begin using MeshIntegrals: _default_diff_method - # _default_method + # _default_diff_method sphere = Sphere(Point(0, 0, 0), 1.0) @test _default_diff_method(Meshes.Sphere) isa FiniteDifference @test _default_diff_method(sphere) isa FiniteDifference From 045a082ea4dba540b3a1b9295157a5ce461fe897 Mon Sep 17 00:00:00 2001 From: Michael Ingold Date: Tue, 3 Dec 2024 09:52:22 -0500 Subject: [PATCH 19/19] Update utils.jl Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com> --- src/utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.jl b/src/utils.jl index 954dcf08..6cf5ee14 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -39,7 +39,7 @@ end """ _units(geometry) -Return the Unitful units associated with a particular `geometry`. +Return the Unitful.jl units associated with a particular `geometry`. """ _units(::Geometry{M, CRS}) where {M, CRS} = Unitful.unit(CoordRefSystems.lentype(CRS)) _units(::Meshes.Vec{Dim, T}) where {Dim, T} = Unitful.unit(T)