Skip to content

Commit

Permalink
add factor
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchan committed Mar 25, 2024
1 parent ede4c69 commit babc3a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RefElemData_SBP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ end


"""
function sparse_low_order_SBP_operators(rd)
function sparse_low_order_SBP_operators(rd; factor=1.01)
Constructs sparse low order SBP operators given a `RefElemData`.
Returns operators `Qrst..., E ≈ Vf * Pq` that satisfy a generalized
summation-by-parts (GSBP) property:
`Q_i + Q_i^T = E' * B_i * E`
"""
function sparse_low_order_SBP_operators(rd::RefElemData{NDIMS}) where {NDIMS}
function sparse_low_order_SBP_operators(rd::RefElemData{NDIMS}; factor=1.01) where {NDIMS}
(; Pq, Vf, rstq, wf, nrstJ) = rd

# if element is a simplex, convert nodes to an equilateral triangle for symmetry
Expand All @@ -269,7 +269,7 @@ function sparse_low_order_SBP_operators(rd::RefElemData{NDIMS}) where {NDIMS}
# heuristic cutoff - we take NDIMS + 1 neighbors, but the smallest distance = 0,
# so we need to access the first NDIMS + 2 sorted distance entries.
dist = sort(view(D, i, :))[NDIMS + 2]
for j in findall(view(D, i, :) .< 1.01 * dist)
for j in findall(view(D, i, :) .< factor * dist)
A[i, j] = 1
end
end
Expand Down

0 comments on commit babc3a0

Please sign in to comment.