Skip to content

Commit

Permalink
Move other boundary calculations to new function
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Feb 29, 2024
1 parent 765b828 commit 3b74f39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
4 changes: 3 additions & 1 deletion src/meshes/t8code_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
27 changes: 0 additions & 27 deletions src/solvers/fv_t8code/containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3b74f39

Please sign in to comment.