From 3b74f39882cf27dfb6d0905402e9cd1001b6a5cf Mon Sep 17 00:00:00 2001 From: bennibolm Date: Thu, 29 Feb 2024 11:41:48 +0100 Subject: [PATCH] Move other boundary calculations to new function --- src/meshes/t8code_mesh.jl | 4 +++- src/solvers/fv_t8code/containers.jl | 27 --------------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/meshes/t8code_mesh.jl b/src/meshes/t8code_mesh.jl index ef4a7a8593d..50a677096ba 100644 --- a/src/meshes/t8code_mesh.jl +++ b/src/meshes/t8code_mesh.jl @@ -1115,7 +1115,7 @@ function fill_mesh_info!(mesh::T8codeMesh, interfaces, mortars, boundaries, return nothing end -function fill_mesh_info_fv!(mesh::T8codeMesh, interfaces, #=mortars,=# boundaries, +function fill_mesh_info_fv!(mesh::T8codeMesh, interfaces, boundaries, boundary_names; mpi_mesh_info = nothing) @assert t8_forest_is_committed(mesh.forest) != 0 @@ -1210,6 +1210,8 @@ function fill_mesh_info_fv!(mesh::T8codeMesh, interfaces, #=mortars,=# boundarie boundary_id = local_num_boundary # One-based indexing. + boundaries.neighbor_ids[boundary_id] = current_index + 1 + boundaries.faces[boundary_id] = iface + 1 boundaries.name[boundary_id] = boundary_names[iface + 1, itree + 1] end diff --git a/src/solvers/fv_t8code/containers.jl b/src/solvers/fv_t8code/containers.jl index fc30d60c0ad..324ab7cc4fc 100644 --- a/src/solvers/fv_t8code/containers.jl +++ b/src/solvers/fv_t8code/containers.jl @@ -327,33 +327,6 @@ function init_fv_boundaries(mesh::T8codeMesh, equations, solver::FV, elements, u boundaries = T8codeFVBoundaryContainer{uEltype}(u, neighbor_ids, faces, names, _u) - if n_boundaries > 0 - # See above - # init_boundaries!(boundaries, mesh) - - init_fv_boundaries!(boundaries, mesh, elements) - end - - return boundaries -end - -function init_fv_boundaries!(boundaries, mesh::T8codeMesh, elements) - # Note: In t8code, the routine 't8code_forest_iterate' is not implemented yet. - - idx = 1 - for element in 1:ncells(mesh) - (; face_connectivity, num_faces) = elements[element] - for (face, neighbor) in enumerate(face_connectivity[1:num_faces]) - if neighbor > 0 - continue - end - boundaries.neighbor_ids[idx] = element - boundaries.faces[idx] = face - - idx += 1 - end - end - return boundaries end