Skip to content

Commit

Permalink
specialize inverse_trace_constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchan committed Dec 7, 2021
1 parent 7c976fb commit bb5cb48
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ref_elem_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
function find_face_nodes(elem, r, s, tol=50*eps())
function find_face_nodes(elem, r, s, t, tol=50*eps())
Given volume nodes `r`, `s`, `t`, finds face nodes. Note that this function implicitly
defines an ordering on the faces.
Given volume nodes `r`, `s`, `t`, finds face nodes. Note that this function implicitly
defines an ordering on the faces.
"""
function find_face_nodes(elem::Tri, r, s, tol=50*eps())
e1 = findall(@. abs(s + 1) < tol)
Expand Down Expand Up @@ -83,20 +83,20 @@ end
"""
function inverse_trace_constant(rd::RefElemData)
Returns the degree-dependent constant in the inverse trace equality over the reference element (as
Returns the degree-dependent constant in the inverse trace equality over the reference element (as
reported in ["GPU-accelerated dG methods on hybrid meshes"](https://doi.org/10.1016/j.jcp.2016.04.003)
by Chan, Wang, Modave, Remacle, Warburton 2016).
by Chan, Wang, Modave, Remacle, Warburton 2016).
Can be used to estimate dependence of maximum stable timestep on degree of approximation.
Can be used to estimate dependence of maximum stable timestep on degree of approximation.
"""
inverse_trace_constant(rd::RefElemData{1}) = (rd.N+1) * (rd.N+2) / 2
inverse_trace_constant(rd::RefElemData{2, Quad}) = (rd.N+1) * (rd.N + 2)
inverse_trace_constant(rd::RefElemData{3, Hex}) = 3 * (rd.N + 1) * (rd.N + 2) / 2
inverse_trace_constant(rd::RefElemData{1, Line, SBP{TensorProductLobatto}}) = rd.N * (rd.N + 1) / 2
inverse_trace_constant(rd::RefElemData{2, Quad, SBP{TensorProductLobatto}}) = rd.N * (rd.N + 1)
inverse_trace_constant(rd::RefElemData{3, Hex, SBP{TensorProductLobatto}}) = 3 * rd.N * (rd.N + 1) / 2
inverse_trace_constant(rd::RefElemData{1, Line, Polynomial}) = (rd.N+1) * (rd.N+2) / 2
inverse_trace_constant(rd::RefElemData{2, Quad, Polynomial}) = (rd.N+1) * (rd.N + 2)
inverse_trace_constant(rd::RefElemData{3, Hex, Polynomial}) = 3 * (rd.N + 1) * (rd.N + 2) / 2
inverse_trace_constant(rd::RefElemData{1, Line, SBP{TensorProductLobatto}}) = rd.N * (rd.N + 1) / 2
inverse_trace_constant(rd::RefElemData{2, Quad, SBP{TensorProductLobatto}}) = rd.N * (rd.N + 1)
inverse_trace_constant(rd::RefElemData{3, Hex, SBP{TensorProductLobatto}}) = 3 * rd.N * (rd.N + 1) / 2

# precomputed
# precomputed
_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_constant(rd::RefElemData{2, Tri, Polynomial}) where {Dim} = _inverse_trace_constants(rd)[rd.N]
Expand Down

0 comments on commit bb5cb48

Please sign in to comment.