Skip to content

Commit

Permalink
MortarL2 -> AbstractMortarL2
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Oct 25, 2020
1 parent 2a7c139 commit cb95dd3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ export TreeMesh
export DG,
DGSEM, LobattoLegendreBasis,
VolumeIntegralWeakForm, VolumeIntegralFluxDifferencing,
VolumeIntegralShockCapturingHG, IndicatorHennemannGassner
VolumeIntegralShockCapturingHG, IndicatorHennemannGassner,
MortarL2

export SemidiscretizationHyperbolic, semidiscretize, compute_coefficients
export SemidiscretizationHyperbolic, semidiscretize, compute_coefficients, integrate

export SemidiscretizationEulerGravity, ParametersEulerGravity, timestep_gravity_erk52_3Sstar!

Expand Down
2 changes: 1 addition & 1 deletion src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract type AbstractMortar{RealT<:Real} end

# abstract supertype of mortar methods using L² projection
# which will be specialized for different SBP bases
abstract type MortarL2{RealT<:Real} <: AbstractMortar{RealT} end
abstract type AbstractMortarL2{RealT<:Real} <: AbstractMortar{RealT} end


# abstract supertype of functionality related to the analysis of
Expand Down
6 changes: 3 additions & 3 deletions src/solvers/dg/basis_lobatto_legendre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ end



struct LobattoLegendreMortarL2{RealT<:Real, NNODES, MortarMatrix<:AbstractMatrix{RealT}} <: MortarL2{RealT}
struct LobattoLegendreMortarL2{RealT<:Real, NNODES, MortarMatrix<:AbstractMatrix{RealT}} <: AbstractMortarL2{RealT}
forward_upper::MortarMatrix
forward_lower::MortarMatrix
reverse_upper::MortarMatrix
Expand Down Expand Up @@ -109,9 +109,9 @@ end


# TODO: We can create EC mortars along the lines of the following implementation.
# abstract type MortarEC{RealT} <: AbstractMortar{RealT} end
# abstract type AbstractMortarEC{RealT} <: AbstractMortar{RealT} end

# struct LobattoLegendreMortarEC{RealT<:Real, NNODES, MortarMatrix<:AbstractMatrix{RealT}, SurfaceFlux} <: MortarL2{RealT}
# struct LobattoLegendreMortarEC{RealT<:Real, NNODES, MortarMatrix<:AbstractMatrix{RealT}, SurfaceFlux} <: AbstractMortarEC{RealT}
# forward_upper::MortarMatrix
# forward_lower::MortarMatrix
# reverse_upper::MortarMatrix
Expand Down
12 changes: 7 additions & 5 deletions src/solvers/dg/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ include("basis_lobatto_legendre.jl")
"""
DGSEM([RealT=Float64,] polydeg::Integer,
surface_flux=flux_central,
volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm())
volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm(),
mortar=MortarL2(basis))
Create a discontinuous Galerkin spectral element method (DGSEM) using a
[`LobattoLegendreBasis`](@ref) with polynomials of degree `polydeg`.
Expand All @@ -248,19 +249,20 @@ const DGSEM = DG{RealT, Basis, Mortar, SurfaceFlux, VolumeIntegral} where {RealT

function DGSEM(basis::LobattoLegendreBasis,
surface_flux=flux_central,
volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm())
mortar = MortarL2(basis)
volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm(),
mortar=MortarL2(basis))

return DG{real(basis), typeof(basis), typeof(mortar), typeof(surface_flux), typeof(volume_integral)}(
basis, mortar, surface_flux, volume_integral)
end

function DGSEM(RealT, polydeg::Integer,
surface_flux=flux_central,
volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm())
volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm(),
mortar=MortarL2(LobattoLegendreBasis(RealT, polydeg)))
basis = LobattoLegendreBasis(RealT, polydeg)

return DGSEM(basis, surface_flux, volume_integral)
return DGSEM(basis, surface_flux, volume_integral, mortar)
end

DGSEM(polydeg, surface_flux=flux_central, volume_integral::AbstractVolumeIntegral=VolumeIntegralWeakForm()) = DGSEM(Float64, polydeg, surface_flux, volume_integral)
Expand Down

0 comments on commit cb95dd3

Please sign in to comment.