Skip to content

Commit

Permalink
add NystromDensity
Browse files Browse the repository at this point in the history
  • Loading branch information
maltezfaria committed Oct 9, 2023
1 parent 1ee05ae commit f3934d6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Inti.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 13 additions & 0 deletions src/nystrom.jl
Original file line number Diff line number Diff line change
@@ -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...)

Check warning on line 13 in src/nystrom.jl

View check run for this annotation

Codecov / codecov/patch

src/nystrom.jl#L11-L13

Added lines #L11 - L13 were not covered by tests
2 changes: 1 addition & 1 deletion src/quadrature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 27 in src/quadrature.jl

View check run for this annotation

Codecov / codecov/patch

src/quadrature.jl#L27

Added line #L27 was not covered by tests
Base.getindex(quad::Quadrature, i) = quad.qnodes[i]

ambient_dimension(quad::Quadrature) = ambient_dimension(quad.mesh)
Expand Down

0 comments on commit f3934d6

Please sign in to comment.