Skip to content

Commit c9180d7

Browse files
committed
LVDIM: Expose allowing differing quad/interp order
1 parent ef6ef7d commit c9180d7

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

src/api.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ function volume_potential(; pde, target, source::Quadrature, compression, correc
301301
green_multiplier,
302302
correction.maxdist,
303303
correction.interpolation_order,
304+
correction.quadrature_order,
304305
shift,
305306
)
306307
else

src/vdim.jl

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ function local_vdim_correction(
140140
bdry_nodes;
141141
green_multiplier::Vector{<:Real},
142142
interpolation_order = nothing,
143+
quadrature_order = nothing,
143144
maxdist = Inf,
144145
center = nothing,
145146
shift::Val{SHIFT} = Val(false),
@@ -168,6 +169,9 @@ function local_vdim_correction(
168169
near_list = dict_near[E]
169170
nq, ne = size(qtags)
170171
@assert length(near_list) == ne
172+
sizehint!(Is, ne * nq * nq)
173+
sizehint!(Js, ne * nq * nq)
174+
sizehint!(Vs, ne * nq * nq)
171175
topo_neighs = 1
172176
neighbors = Inti.topological_neighbors(mesh, topo_neighs)
173177
for n in 1:ne
@@ -179,6 +183,7 @@ function local_vdim_correction(
179183
neighbors,
180184
n,
181185
interpolation_order,
186+
quadrature_order,
182187
p,
183188
P,
184189
γ₁P,
@@ -201,24 +206,9 @@ function local_vdim_correction(
201206
wei = R * Linv
202207
end
203208
# correct each target near the current element
204-
push!(Is, repeat(near_list[n], inner = nq)...)
205-
push!(Js, repeat(jglob, outer = length(near_list[n]))...)
206-
push!(Vs, transpose(wei)...)
207-
if isdefined(Main, :Infiltrator)
208-
Main.infiltrate(@__MODULE__, Base.@locals, @__FILE__, @__LINE__)
209-
end
210-
#for i in 1:length(near_list[n])
211-
# #for k in 1:nq
212-
# # push!(Is, near_list[n][i])
213-
# # push!(Js, jglob[k])
214-
# # push!(Vs, wei[i, k])
215-
# #end
216-
# for k in 1:nq
217-
# push!(Is, near_list[n][i])
218-
# push!(Js, jglob[k])
219-
# push!(Vs, wei[i, k])
220-
# end
221-
#end
209+
append!(Is, repeat(near_list[n], inner = nq)...)
210+
append!(Js, repeat(jglob, outer = length(near_list[n]))...)
211+
append!(Vs, transpose(wei)...)
222212
end
223213
end
224214
@debug """Condition properties of vdim correction:
@@ -352,6 +342,7 @@ function _local_vdim_auxiliary_quantities(
352342
neighbors,
353343
el,
354344
interpolation_order,
345+
quadrature_order,
355346
p,
356347
P,
357348
γ₁P,
@@ -387,9 +378,8 @@ function _local_vdim_auxiliary_quantities(
387378
# build O(h) volume neighbors
388379
els_idxs = [i[2] for i in collect(el_neighs)]
389380
els_list = mesh.etype2els[Etype][els_idxs]
390-
qorder = Inti.Triangle_VR_interpolation_order_to_quadrature_order(interpolation_order)
391-
bdry_qorder = 2 * qorder
392-
Yvol = Inti.Quadrature(mesh, els_list; qorder)
381+
bdry_qorder = 2 * quadrature_order
382+
Yvol = Inti.Quadrature(mesh, els_list; qorder = quadrature_order)
393383
if need_layer_corr
394384
Ybdry = Inti.Quadrature(mesh, bords; qorder = bdry_qorder)
395385
else

test/lvdim_test.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ using FMMLIB2D
99
using GLMakie
1010
using Meshes
1111

12-
meshsize = 0.1
12+
meshsize = 0.02
1313
interpolation_order = 4
14-
VR_qorder = Inti.Triangle_VR_interpolation_order_to_quadrature_order(interpolation_order)
14+
VR_qorder = Inti.Triangle_VR_interpolation_order_to_quadrature_order(5)
1515
bdry_qorder = 2 * VR_qorder
1616

1717
function gmsh_disk(; name, meshsize, order = 1, center = (0, 0), paxis = (2, 1))
@@ -96,6 +96,7 @@ V_d2d = Inti.volume_potential(;
9696
method = :ldim,
9797
mesh = Ωₕ,
9898
interpolation_order,
99+
quadrature_order = VR_qorder,
99100
bdry_nodes = Γₕ.nodes,
100101
maxdist = 5 * meshsize,
101102
),

0 commit comments

Comments
 (0)