Skip to content

Commit

Permalink
move more definitions to abstract_types.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Oct 12, 2020
1 parent 03a3863 commit 35f5097
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
26 changes: 26 additions & 0 deletions src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,30 @@ abstract type AbstractSemidiscretization end
abstract type AbstractEquations{NDIMS, NVARS} end


# abstract supertype of specific SBP bases such as a Lobatto-Legendre nodal basis
abstract type AbstractBasisSBP{RealT<:Real} end


# abstract supertype of mortar methods, e.g. using L² projections
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

This comment has been minimized.

Copy link
@sloede

sloede Oct 20, 2020

Member

To remain consistent (and to make finding things easier), we should probably decide on a consistent strategy on whether to prefix abstract types with Abstract, or maybe if there are certain classes of cases where we should do it and some where we don't (e.g., to avoid confusion with concrete types). What do you think @ranocha ?

This comment has been minimized.

Copy link
@ranocha

ranocha Oct 25, 2020

Author Member

That's often a good idea, I think. I would just like to keep the name MortarL2 for the constructor of a general L2 mortar given an SBP basis. Fixed in cb95dd3



# abstract supertype of functionality related to the analysis of
# numerical solutions, e.g. the calculation of errors
abstract type SolutionAnalyzer{RealT<:Real} end


# abstract supertype of grid-transfer methods used for AMR,
# e.g. refinement and coarsening based on L² projections
abstract type AdaptorAMR{RealT<:Real} end

# abstract supertype of AMR grid-transfer operations using L² projections
# which will be specialized for different SBP bases
abstract type AdaptorL2{RealT<:Real} <: AdaptorAMR{RealT} end


# TODO: Taal decide, which abstract types shall be defined here?
File renamed without changes.
19 changes: 6 additions & 13 deletions src/solvers/dg/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,12 @@ end



abstract type AbstractBasisSBP{RealT<:Real} end

abstract type AbstractMortar{RealT<:Real} end

abstract type MortarL2{RealT<:Real} <: AbstractMortar{RealT} end

"""
DG(basis, basis, surface_flux, volume_integral)
Create a discontinuous Galerkin method.
If `basis isa LobattoLegendreBasis`, this creates a [`DGSEM`](@ref).
"""
struct DG{RealT, Basis<:AbstractBasisSBP{RealT}, Mortar, SurfaceFlux, VolumeIntegral}
basis::Basis
mortar::Mortar
Expand Down Expand Up @@ -226,12 +225,6 @@ end


# Used for analyze_solution
abstract type SolutionAnalyzer{RealT<:Real} end

abstract type AdaptorAMR{RealT<:Real} end

abstract type AdaptorL2{RealT<:Real} <: AdaptorAMR{RealT} end

SolutionAnalyzer(dg::DG; kwargs...) = SolutionAnalyzer(dg.basis; kwargs...)

AdaptorAMR(mesh, dg::DG) = AdaptorL2(dg.basis)
Expand All @@ -241,7 +234,7 @@ AdaptorAMR(mesh, dg::DG) = AdaptorL2(dg.basis)
# Include utilities
include("interpolation.jl")
include("l2projection.jl")
include("lobatto_legendre.jl")
include("basis_lobatto_legendre.jl")

"""
DGSEM([RealT=Float64,] polydeg::Integer,
Expand Down

0 comments on commit 35f5097

Please sign in to comment.