From ace6b6732c165e36cbbc02674cfc07f218a6464b Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Wed, 6 Mar 2024 15:40:15 +0100 Subject: [PATCH] avoid if --- .../semidiscretization_hyperbolic.jl | 13 ++++++++++--- .../semidiscretization_hyperbolic_parabolic.jl | 4 +--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/semidiscretization/semidiscretization_hyperbolic.jl b/src/semidiscretization/semidiscretization_hyperbolic.jl index ad1ba0175f3..3f47308ba5b 100644 --- a/src/semidiscretization/semidiscretization_hyperbolic.jl +++ b/src/semidiscretization/semidiscretization_hyperbolic.jl @@ -72,9 +72,7 @@ function SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver _boundary_conditions = digest_boundary_conditions(boundary_conditions, mesh, solver, cache) - if mesh isa TreeMesh || mesh isa StructuredMesh - check_periodicity_mesh_boundary_conditions(mesh, _boundary_conditions) - end + check_periodicity_mesh_boundary_conditions(mesh, _boundary_conditions) SemidiscretizationHyperbolic{typeof(mesh), typeof(equations), typeof(initial_condition), @@ -214,6 +212,15 @@ function digest_boundary_conditions(boundary_conditions::AbstractArray, mesh, so throw(ArgumentError("Please use a (named) tuple instead of an (abstract) array to supply multiple boundary conditions (to improve performance).")) end +# No checks for these meshes yet available +function check_periodicity_mesh_boundary_conditions(mesh::Union{P4estMesh, + UnstructuredMesh2D, + T8CodeMesh, + DGMultiMesh}, + boundary_conditions) +end + +# No actions needed for periodic boundary conditions function check_periodicity_mesh_boundary_conditions(mesh::Union{TreeMesh, StructuredMesh}, boundary_conditions::BoundaryConditionPeriodic) diff --git a/src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl b/src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl index 5fb18428b59..57724374acb 100644 --- a/src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl +++ b/src/semidiscretization/semidiscretization_hyperbolic_parabolic.jl @@ -136,9 +136,7 @@ function SemidiscretizationHyperbolicParabolic(mesh, equations, equations_parabo _boundary_conditions_parabolic = digest_boundary_conditions(boundary_conditions_parabolic, mesh, solver, cache) - if mesh isa TreeMesh || mesh isa StructuredMesh - check_periodicity_mesh_boundary_conditions(mesh, _boundary_conditions) - end + check_periodicity_mesh_boundary_conditions(mesh, _boundary_conditions) cache_parabolic = (; create_cache_parabolic(mesh, equations, equations_parabolic,