Skip to content

Commit

Permalink
FDSBP constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Dec 2, 2022
1 parent f17e286 commit 2ce4cad
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 31 deletions.
6 changes: 3 additions & 3 deletions examples/tree_1d_fdsbp/elixir_burgers_basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=32)
flux_splitting = splitting_lax_friedrichs
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = 0.0
coordinates_max = 1.0
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_1d_fdsbp/elixir_burgers_linear_stability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_lax_friedrichs
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = -1.0
coordinates_max = 1.0
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_1d_fdsbp/elixir_euler_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=32)
flux_splitting = splitting_steger_warming
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = 0.0
coordinates_max = 2.0
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_1d_fdsbp/elixir_euler_density_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_coirier_vanleer
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = -1.0
coordinates_max = 1.0
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_2d_fdsbp/elixir_advection_extended.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ initial_condition = initial_condition_convergence_test
D_SBP = derivative_operator(SummationByPartsOperators.MattssonNordström2004(),
derivative_order=1, accuracy_order=4,
xmin=0.0, xmax=1.0, N=100)
solver = DG(D_SBP, nothing #= mortar =#,
SurfaceIntegralStrongForm(flux_lax_friedrichs),
VolumeIntegralStrongForm())
solver = FDSBP(D_SBP,
surface_integral=SurfaceIntegralStrongForm(flux_lax_friedrichs),
volume_integral=VolumeIntegralStrongForm())

coordinates_min = (-1.0, -1.0)
coordinates_max = ( 1.0, 1.0)
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_2d_fdsbp/elixir_euler_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ D = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_steger_warming
solver = DG(D, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = (-1.0, -1.0)
coordinates_max = ( 1.0, 1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_vanleer_haenel
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = (-1.0, -1.0)
coordinates_max = ( 1.0, 1.0)
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_2d_fdsbp/elixir_euler_vortex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_steger_warming
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = (-10.0, -10.0)
coordinates_max = ( 10.0, 10.0)
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_3d_fdsbp/elixir_euler_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_steger_warming
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = (0.0, 0.0, 0.0)
coordinates_max = (2.0, 2.0, 2.0)
Expand Down
6 changes: 3 additions & 3 deletions examples/tree_3d_fdsbp/elixir_euler_taylor_green_vortex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ D_upw = upwind_operators(SummationByPartsOperators.Mattsson2017,
xmin=-1.0, xmax=1.0,
N=16)
flux_splitting = splitting_steger_warming
solver = DG(D_upw, nothing #= mortar =#,
SurfaceIntegralUpwind(flux_splitting),
VolumeIntegralUpwind(flux_splitting))
solver = FDSBP(D_upw,
surface_integral=SurfaceIntegralUpwind(flux_splitting),
volume_integral=VolumeIntegralUpwind(flux_splitting))

coordinates_min = (-1.0, -1.0, -1.0) .* pi
coordinates_max = ( 1.0, 1.0, 1.0) .* pi
Expand Down
1 change: 1 addition & 0 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export TreeMesh, StructuredMesh, UnstructuredMesh2D, P4estMesh

export DG,
DGSEM, LobattoLegendreBasis,
FDSBP,
VolumeIntegralWeakForm, VolumeIntegralStrongForm,
VolumeIntegralFluxDifferencing,
VolumeIntegralPureLGLFiniteVolume,
Expand Down
22 changes: 21 additions & 1 deletion src/solvers/fdsbp_tree/fdsbp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,29 @@
@muladd begin


# For dispatch
"""
FDSBP(D_SBP; surface_integral, volume_integral)
Specialization of [`DG`](@ref) methods that uses general summation by parts (SBP)
operators from
[SummationByPartsOperators.jl](https://github.com/ranocha/SummationByPartsOperators.jl).
In particular, this includes classical finite difference (FD) SBP methods.
These methods have the same structure as classical DG methods - local operations
on elements with connectivity through interfaces without imposing any continuity
constraints.
`D_SBP` is an SBP derivative operator from SummationByPartsOperators.jl.
The other arguments have the same meaning as in [`DG`](@ref) or [`DGSEM`](@ref).
!!! warning "Experimental implementation (upwind SBP)"
This is an experimental feature and may change in future releases.
"""
const FDSBP = DG{Basis} where {Basis<:AbstractDerivativeOperator}

function FDSBP(D_SBP::AbstractDerivativeOperator; surface_integral, volume_integral)
return DG(D_SBP, nothing #= mortar =#, surface_integral, volume_integral)
end


# General interface methods for SummationByPartsOperators.jl and Trixi.jl
nnodes(D::AbstractDerivativeOperator) = size(D, 1)
Expand Down

0 comments on commit 2ce4cad

Please sign in to comment.