Skip to content

Commit

Permalink
Fixed issue with non-simply connected p4est mesh views.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCan committed Dec 16, 2024
1 parent 8821ff2 commit 240918f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/meshes/p4est_mesh_view.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ function extract_interfaces(mesh::P4estMeshView, interfaces_parent)
interfaces = interfaces_parent
interfaces.u = interfaces_parent.u[.., mask]
interfaces.node_indices = interfaces_parent.node_indices[.., mask]
interfaces.neighbor_ids = interfaces_parent.neighbor_ids[.., mask]
neighbor_ids = interfaces_parent.neighbor_ids[.., mask]
# Transform the global (parent) indices into local (view) indices.
interfaces.neighbor_ids = zeros(Int, size(neighbor_ids))
for interface in 1:size(neighbor_ids)[2]
interfaces.neighbor_ids[1, interface] = findall(x->x==neighbor_ids[1, interface], mesh.cell_ids)[1]
interfaces.neighbor_ids[2, interface] = findall(x->x==neighbor_ids[2, interface], mesh.cell_ids)[1]
end

# u_new = Array{eltype(interfaces.u)}(undef, (size(interfaces.u)[1:3]..., size(mesh.cell_ids)[1]*2))
# u_new[:, :, :, 1:2:end] .= interfaces.u[:, :, :, (mesh.cell_ids.*2 .-1)]
Expand Down

0 comments on commit 240918f

Please sign in to comment.