This package implements a quadrature method on implicitly defined regions based on ideas from the algorithm in:
NOTE: For the original C++ implementation, see the Algoim repo. Also, see the Julia wrapper in Algoim.jl.
Due to time constraints, I am no longer able to continue working on this project. Fortunately, there's another Julia package that implements the Algoim algorithm. It offers cleaner code and better performance than my implementation, so I highly recommend using it instead.
Let
using QuadratureOnImplicitRegions
ψ(x)= x'*x-1.0
a,b=zeros(2), ones(2) #the unit interval.
quad_order=10
#the nodes and weights on Ω₁
xy1,w1=algoim_nodes_weights(ψ,-1.0, a,b,quad_order)
#the nodes and weights on Ω₂
xy2,w2=algoim_nodes_weights(ψ,+1.0, a,b,quad_order)
To plot the nodes, please see this tutorial and the documentation.
The same syntax can be used for higher dimensional regions. For example, in the case of the intersection of the unit sphere and unit cube, we only need to adjust a
and b
:
using QuadratureOnImplicitRegions
ψ(x)= x'*x-1.0
a,b=zeros(3), ones(3) #the unit cube.
quad_order=5
xyz1,w1=algoim_nodes_weights(ψ,-1.0, a,b,quad_order)
For the outer region, we only need to change -1.0
to 1.0