From 185e7d6278c552e1573227bdcd18cf56c0949aae Mon Sep 17 00:00:00 2001 From: Jared Crean Date: Thu, 14 Sep 2017 10:26:43 -0400 Subject: [PATCH 1/2] make separate outer constructor for 2p omegas --- src/outerconstructors.jl | 26 ++++++++++++++++++++++++-- test/printnodes.jl | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/outerconstructors.jl b/src/outerconstructors.jl index 7336d0d..25cfad3 100644 --- a/src/outerconstructors.jl +++ b/src/outerconstructors.jl @@ -60,14 +60,36 @@ Returns SBP-Omega type elements, that have no nodes on the element boundary """-> function getTriSBPOmega(;degree::Int=1, Tsbp::Type=Float64) - #return TriSBP{Tsbp}(degree=degree, internal=true, vertices=false) + return TriSBP{Tsbp}(degree=degree, internal=true, vertices=false) +end + +""" +### SBP.getTriSBPOmega2 + +Like getTRISBPomega, but ensures the operator has a degree 2p cubature +rule + +**Inputs** + +* `degree`: maximum polynomial degree for which the derivatives are exact +* `Tsbp`: floating point type used for the operators + +**Returns** + +* `sbp`: an SBP-Omega type operator of the appropriate degree + +""" +function getTriSBPOmega2(;degree::Int=1, Tsbp::Type=Float64) + cub, vtx = tricubature(2*degree, Tsbp, internal=true, vertices=false) Q = zeros(Tsbp, (cub.numnodes, cub.numnodes, 2)) w, Q = SummationByParts.buildoperators(cub, vtx, degree) - TriSBP{Tsbp}(degree, cub, vtx, w, Q) + + return TriSBP{Tsbp}(degree, cub, vtx, w, Q) end + function getTriSBPWithDiagE(;degree::Int=1, Tsbp::Type=Float64, vertices::Bool=true) @assert( degree >= 1 && degree <= 4 ) diff --git a/test/printnodes.jl b/test/printnodes.jl index 4f42373..4f799cd 100644 --- a/test/printnodes.jl +++ b/test/printnodes.jl @@ -39,7 +39,7 @@ end function printTriOmegaNodes(degree::Int, filename::AbstractString="nodes.dat") @assert( degree >= 1 && degree <= 4) - sbp = getTriSBPOmega(degree=degree) + sbp = getTriSBPOmega2(degree=degree) sbpface = TriFace{Float64}(degree, sbp.cub, [-1. -1; 1 -1; -1 1]) # compute the volume nodes vtx = [0.0 0.0; 1 0.0; 0.5 sqrt(3)*0.5] From 0b251d4eff57b3711a37fc59cada2fef58390625 Mon Sep 17 00:00:00 2001 From: Jared Crean Date: Thu, 14 Sep 2017 10:36:25 -0400 Subject: [PATCH 2/2] add missing export statement --- src/SummationByParts.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SummationByParts.jl b/src/SummationByParts.jl index 148a0a5..0b218ff 100644 --- a/src/SummationByParts.jl +++ b/src/SummationByParts.jl @@ -16,7 +16,7 @@ using .SymCubatures using .Cubature export AbstractSBP, TriSBP, TetSBP, SparseTriSBP, SparseTetSBP -export getTriSBPGamma, getTriSBPOmega, getTriSBPWithDiagE +export getTriSBPGamma, getTriSBPOmega, getTriSBPOmega2, getTriSBPWithDiagE export getTetSBPGamma, getTetSBPOmega, getTetSBPWithDiagE export AbstractFace, TriFace, TetFace export getTriFaceForDiagE, getTetFaceForDiagE