From 9f62f8c1069f68493679f6c5dc529a6731d06d11 Mon Sep 17 00:00:00 2001 From: SimonCan Date: Thu, 18 Apr 2024 15:19:47 +0100 Subject: [PATCH] Added boundary memoery allocation for p4est mesh. This is a working, but ugly solution. --- .../semidiscretization_coupled.jl | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/semidiscretization/semidiscretization_coupled.jl b/src/semidiscretization/semidiscretization_coupled.jl index 784fbcc5e35..d15248fdb86 100644 --- a/src/semidiscretization/semidiscretization_coupled.jl +++ b/src/semidiscretization/semidiscretization_coupled.jl @@ -448,13 +448,27 @@ function allocate_coupled_boundary_conditions(semi::AbstractSemidiscretization) n_boundaries = 2 * ndims(semi) mesh, equations, solver, _ = mesh_equations_solver_cache(semi) - for direction in 1:n_boundaries - boundary_condition = semi.boundary_conditions[direction] + # @autoinfiltrate + if !(typeof(semi.boundary_conditions) <: Trixi.UnstructuredSortedBoundaryTypes) + for direction in 1:n_boundaries + boundary_condition = semi.boundary_conditions[direction] + + allocate_coupled_boundary_condition(boundary_condition, direction, mesh, + equations, + solver) + end + else + # TODO: write this as loop. + boundary_condition = semi.boundary_conditions.boundary_dictionary[:x_neg] + allocate_coupled_boundary_condition(boundary_condition, 1, mesh, equations, solver) + boundary_condition = semi.boundary_conditions.boundary_dictionary[:x_pos] + allocate_coupled_boundary_condition(boundary_condition, 2, mesh, equations, solver) + boundary_condition = semi.boundary_conditions.boundary_dictionary[:y_neg] + allocate_coupled_boundary_condition(boundary_condition, 3, mesh, equations, solver) + boundary_condition = semi.boundary_conditions.boundary_dictionary[:y_pos] + allocate_coupled_boundary_condition(boundary_condition, 4, mesh, equations, solver) +end - allocate_coupled_boundary_condition(boundary_condition, direction, mesh, - equations, - solver) - end end # Don't do anything for other BCs than BoundaryConditionCoupled