diff --git a/src/Inti.jl b/src/Inti.jl index da928fcf..7ec1cda4 100644 --- a/src/Inti.jl +++ b/src/Inti.jl @@ -21,6 +21,9 @@ include("domain.jl") include("mesh.jl") include("quadrature.jl") +# nystrom methods +include("nystrom.jl") + # # integral operators # include("integral_potentials.jl") # include("integral_operators.jl") diff --git a/src/nystrom.jl b/src/nystrom.jl new file mode 100644 index 00000000..62cbeb8d --- /dev/null +++ b/src/nystrom.jl @@ -0,0 +1,13 @@ +""" + struct NystromDensity{N,T,V} <: AbstractVector{V} + +Values of type `V` on a `Quadrature` in `N` dimensions. +""" +struct NystromDensity{N,T,V} <: AbstractVector{V} + quadrature::Quadrature{N,T} + values::Vector{V} +end + +Base.size(σ::NystromDensity) = size(σ.values) +Base.getindex(σ::NystromDensity, args...) = getindex(vals(σ), args...) +Base.setindex!(σ::NystromDensity, args...) = setindex!(vals(σ), args...) diff --git a/src/quadrature.jl b/src/quadrature.jl index 9742df47..cc5e5c69 100644 --- a/src/quadrature.jl +++ b/src/quadrature.jl @@ -24,7 +24,7 @@ struct Quadrature{N,T} <: AbstractVector{QuadratureNode{N,T}} end # AbstractArray interface -Base.size(quad::Quadrature) = (length(quad.qnodes),) +Base.size(quad::Quadrature) = size(quad.qnodes) Base.getindex(quad::Quadrature, i) = quad.qnodes[i] ambient_dimension(quad::Quadrature) = ambient_dimension(quad.mesh)