Skip to content

Commit

Permalink
avoid if
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Mar 6, 2024
1 parent b0f3c88 commit ace6b67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/semidiscretization/semidiscretization_hyperbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ace6b67

Please sign in to comment.