Skip to content

Commit

Permalink
LVDIM: Expose allowing differing quad/interp order
Browse files Browse the repository at this point in the history
  • Loading branch information
tanderson92 committed Aug 23, 2024
1 parent ef6ef7d commit c9180d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ function volume_potential(; pde, target, source::Quadrature, compression, correc
green_multiplier,
correction.maxdist,
correction.interpolation_order,
correction.quadrature_order,
shift,
)
else
Expand Down
32 changes: 11 additions & 21 deletions src/vdim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ function local_vdim_correction(
bdry_nodes;
green_multiplier::Vector{<:Real},
interpolation_order = nothing,
quadrature_order = nothing,
maxdist = Inf,
center = nothing,
shift::Val{SHIFT} = Val(false),
Expand Down Expand Up @@ -168,6 +169,9 @@ function local_vdim_correction(
near_list = dict_near[E]
nq, ne = size(qtags)
@assert length(near_list) == ne
sizehint!(Is, ne * nq * nq)
sizehint!(Js, ne * nq * nq)
sizehint!(Vs, ne * nq * nq)
topo_neighs = 1
neighbors = Inti.topological_neighbors(mesh, topo_neighs)
for n in 1:ne
Expand All @@ -179,6 +183,7 @@ function local_vdim_correction(
neighbors,
n,
interpolation_order,
quadrature_order,
p,
P,
γ₁P,
Expand All @@ -201,24 +206,9 @@ function local_vdim_correction(
wei = R * Linv
end
# correct each target near the current element
push!(Is, repeat(near_list[n], inner = nq)...)
push!(Js, repeat(jglob, outer = length(near_list[n]))...)
push!(Vs, transpose(wei)...)
if isdefined(Main, :Infiltrator)
Main.infiltrate(@__MODULE__, Base.@locals, @__FILE__, @__LINE__)
end
#for i in 1:length(near_list[n])
# #for k in 1:nq
# # push!(Is, near_list[n][i])
# # push!(Js, jglob[k])
# # push!(Vs, wei[i, k])
# #end
# for k in 1:nq
# push!(Is, near_list[n][i])
# push!(Js, jglob[k])
# push!(Vs, wei[i, k])
# end
#end
append!(Is, repeat(near_list[n], inner = nq)...)
append!(Js, repeat(jglob, outer = length(near_list[n]))...)
append!(Vs, transpose(wei)...)
end
end
@debug """Condition properties of vdim correction:
Expand Down Expand Up @@ -352,6 +342,7 @@ function _local_vdim_auxiliary_quantities(
neighbors,
el,
interpolation_order,
quadrature_order,
p,
P,
γ₁P,
Expand Down Expand Up @@ -387,9 +378,8 @@ function _local_vdim_auxiliary_quantities(
# build O(h) volume neighbors
els_idxs = [i[2] for i in collect(el_neighs)]
els_list = mesh.etype2els[Etype][els_idxs]
qorder = Inti.Triangle_VR_interpolation_order_to_quadrature_order(interpolation_order)
bdry_qorder = 2 * qorder
Yvol = Inti.Quadrature(mesh, els_list; qorder)
bdry_qorder = 2 * quadrature_order
Yvol = Inti.Quadrature(mesh, els_list; qorder = quadrature_order)
if need_layer_corr
Ybdry = Inti.Quadrature(mesh, bords; qorder = bdry_qorder)
else
Expand Down
5 changes: 3 additions & 2 deletions test/lvdim_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ using FMMLIB2D
using GLMakie
using Meshes

meshsize = 0.1
meshsize = 0.02
interpolation_order = 4
VR_qorder = Inti.Triangle_VR_interpolation_order_to_quadrature_order(interpolation_order)
VR_qorder = Inti.Triangle_VR_interpolation_order_to_quadrature_order(5)
bdry_qorder = 2 * VR_qorder

function gmsh_disk(; name, meshsize, order = 1, center = (0, 0), paxis = (2, 1))
Expand Down Expand Up @@ -96,6 +96,7 @@ V_d2d = Inti.volume_potential(;
method = :ldim,
mesh = Ωₕ,
interpolation_order,
quadrature_order = VR_qorder,
bdry_nodes = Γₕ.nodes,
maxdist = 5 * meshsize,
),
Expand Down

0 comments on commit c9180d7

Please sign in to comment.