Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cubature.jl Interface #185

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/IntegralsCubature/src/IntegralsCubature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ module IntegralsCubature
using Integrals, Cubature

import Integrals: transformation_if_inf, scale_x, scale_x!
import Cubature: INDIVIDUAL, PAIRED, L1, L2, LINF

abstract type AbstractCubatureJLAlgorithm <: SciMLBase.AbstractIntegralAlgorithm end
"""
CubatureJLh()

Multidimensional h-adaptive integration from Cubature.jl.
`error_norm` specifies the convergence criterion for vector valued integrands.
Defaults to `Cubature.INDIVIDUAL`, other options are
`Cubature.PAIRED`, `Cubature.L1`, `Cubature.L2`, or `Cubature.LINF`.
Defaults to `IntegralsCubature.INDIVIDUAL`, other options are
`IntegralsCubature.PAIRED`, `IntegralsCubature.L1`, `IntegralsCubature.L2`, or `IntegralsCubature.LINF`.

## References

Expand All @@ -29,7 +30,7 @@ publisher={Elsevier}
struct CubatureJLh <: AbstractCubatureJLAlgorithm
error_norm::Int32
end
CubatureJLh() = CubatureJLh(Cubature.INDIVIDUAL)
CubatureJLh(; error_norm = Cubature.INDIVIDUAL) = CubatureJLh(error_norm)

"""
CubatureJLp()
Expand All @@ -39,13 +40,13 @@ This method is based on repeatedly doubling the degree of the cubature rules,
until convergence is achieved.
The used cubature rule is a tensor product of Clenshaw–Curtis quadrature rules.
`error_norm` specifies the convergence criterion for vector valued integrands.
Defaults to `Cubature.INDIVIDUAL`, other options are
`Cubature.PAIRED`, `Cubature.L1`, `Cubature.L2`, or `Cubature.LINF`.
Defaults to `IntegralsCubature.INDIVIDUAL`, other options are
`IntegralsCubature.PAIRED`, `IntegralsCubature.L1`, `IntegralsCubature.L2`, or `IntegralsCubature.LINF`.
"""
struct CubatureJLp <: AbstractCubatureJLAlgorithm
error_norm::Int32
end
CubatureJLp() = CubatureJLp(Cubature.INDIVIDUAL)
CubatureJLp(; error_norm = Cubature.INDIVIDUAL) = CubatureJLp(error_norm)

function Integrals.__solvebp_call(prob::IntegralProblem,
alg::AbstractCubatureJLAlgorithm,
Expand Down