Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make separate outer constructor for 2p omegas #20

Open
wants to merge 2 commits into
base: work
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SummationByParts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 24 additions & 2 deletions src/outerconstructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion test/printnodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down