Skip to content

Commit

Permalink
precomputing inverse trace constants, adding warnings for SBP triangles
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchan committed Dec 21, 2022
1 parent 4780e0e commit f75a21a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/RefElemData_SBP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ function diagE_sbp_nodes(elem::Tri, approxType::SBP{Kubatko{LobattoFaceNodes}},
if N==6
@warn "N=6 SBP operators with quadrature strength 2N-1 and Lobatto face nodes may require very small timesteps."
end
if N > 6
@error "N > 6 triangular `SBP{Kubatko{LobattoFaceNodes}}` operators are not available."
end

# from Ethan Kubatko, private communication
vars = h5open((@__DIR__) * "/data/sbp_nodes/KubatkoQuadratureRules.h5", "r")
Expand All @@ -134,6 +137,10 @@ end

function diagE_sbp_nodes(elem::Tri, approxType::SBP{Kubatko{LegendreFaceNodes}}, N)

if N > 6
@error "N > 6 triangular `SBP{Kubatko{LegendreFaceNodes}}` operators are not available."
end

# from Ethan Kubatko, private communication
vars = h5open((@__DIR__) * "/data/sbp_nodes/KubatkoQuadratureRules.h5", "r")
rs = vars["Q_GaussLegendre"]["Points"][string(N)][]
Expand All @@ -150,6 +157,10 @@ parsevec(type, str) = str |>

function diagE_sbp_nodes(elem::Tri, approxType::SBP{Hicken}, N)

if N > 4
@error "N > 4 triangular `SBP{Hicken}` operators are not available."
end

# from Jason Hicken https://github.com/OptimalDesignLab/SummationByParts.jl/tree/work
lines = readlines((@__DIR__)*"/data/sbp_nodes/tri_diage_p$N.dat")
r = parsevec(Float64,lines[11])
Expand Down
4 changes: 4 additions & 0 deletions src/ref_elem_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ inverse_trace_constant(rd::RefElemData{3, Hex, SBP{TensorProductLobatto}}) = 3 *
_inverse_trace_constants(rd::RefElemData{2, Tri, Polynomial}) = (6.0, 10.898979485566365, 16.292060161853993, 23.999999999999808, 31.884512140579055, 42.42373503225737, 52.88579066878113, 66.25284319164409, 79.3535377715693, 95.53911875636945)
_inverse_trace_constants(rd::RefElemData{3, Tet, Polynomial}) = (10., 16.892024376045097, 23.58210016200093, 33.828424659883034, 43.40423356477473, 56.98869932201791, 69.68035962892684)
_inverse_trace_constants(rd::RefElemData{3, <:Wedge, Polynomial}) = (9.92613593327531, 18.56357670538197, 29.030325215439625, 42.98834597283998, 58.802145509223536, 78.00615833786019, 99.27149051377008, 123.76230676427465, 150.48304574455943)
_inverse_trace_constants(rd::RefElemData{2, Tri, SBP{Kubatko{LegendreFaceNodes}}}) = (3.0, 6.6666666666667105, 11.519123865805936, 17.945430732284063, 25.73017849975611, 47.67304311231776)
_inverse_trace_constants(rd::RefElemData{2, Tri, SBP{Kubatko{LobattoFaceNodes}}}) = (4.0, 10.0, 13.606721028333366, 17.948880228130577, 41.14350198287034, 340.3588047925354)
_inverse_trace_constants(rd::RefElemData{2, Tri, SBP{Hicken}}) = (6.666666666666666, 13.309638971217003, 21.905170262973158, 30.569992349262947)

inverse_trace_constant(rd::RefElemData{2, Tri, Polynomial}) = _inverse_trace_constants(rd)[rd.N]
inverse_trace_constant(rd::RefElemData{2, Tri, <:SBP}) = _inverse_trace_constants(rd)[rd.N]
inverse_trace_constant(rd::RefElemData{3, Tet, Polynomial}) = _inverse_trace_constants(rd)[rd.N]
inverse_trace_constant(rd::RefElemData{3, <:Wedge, Polynomial}) = _inverse_trace_constants(rd)[rd.N]

Expand Down

0 comments on commit f75a21a

Please sign in to comment.