Repository navigation
Conversation
Co-authored by: Nanna Berre <nanna.berre@ntnu.no>
|
Hi @ericneiva, thanks for the PR. I mostly tested this machinery with 2D, no 3D as far as I remember. Thus, I am not surprised that you found BUGs when testing in 3D.
Can we add it to the test suite as we do, e.g., in Gridap.jl/GridapDistributed.jl? Thanks! |
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness/robustness issues (helpers returning nothing on invalid input) and the newly added regression test is not wired into the repository’s test harness as-is.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes incorrect regular/hanging reclassification for non-conforming entities on 3D triangulation portions by detecting whether any cell incident to the owner face is active (not just the nominal owner cell), preventing misclassification that later breaks distributed FE space assembly.
Changes:
- Update non-conforming glue regeneration to reclassify hanging faces based on activity of cells around the owner face and (when needed) remap owner-cell/subface data consistently.
- Fix 3D edge entity propagation and related topology wiring during active model generation.
- Add an MWE/regression reproducer for issue 108.
File summaries
| File | Description |
|---|---|
src/OctreeDistributedDiscreteModels.jl |
Adjusts non-conforming glue regeneration and face classification logic for 3D portions; includes helper utilities moved/added for face lid bookkeeping. |
src/FESpaces.jl |
Removes duplicated helper functions now defined elsewhere in the module. |
test/issue_108.jl |
Adds an MWE/regression script demonstrating the failure mode and expected non-hanging classification behavior. |
Review details
Suppressed comments (2)
src/OctreeDistributedDiscreteModels.jl:2690
face_lid_within_dimcan also returnnothingfor out-of-rangeface_lid, producing aUnion{Int,Nothing}return type. Throw an explicit error if the input lid is invalid.
function face_lid_within_dim(num_vertices, num_edges, num_faces, face_lid)
if (face_lid <= num_vertices)
return face_lid
elseif (face_lid <= num_vertices + num_edges)
return face_lid - num_vertices
test/issue_108.jl:67
- This call relies on the pirated
Triangulation(::AdaptedTriangulation, mask)method defined above. After switching to a local helper, call it here explicitly to avoid extending Gridap’s API from tests.
Ω1_trians = map(local_views(Ωh), cell_active) do trian, mask
Triangulation(trian, mask)
end
- Files reviewed: 3/3 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cell_reffe = first(Gridap.Geometry.get_reffes(model)) | ||
| num_cell_vertices = Gridap.ReferenceFEs.num_faces(cell_reffe,0) | ||
| num_cell_edges = Dcm==3 ? Gridap.ReferenceFEs.num_faces(cell_reffe,1) : 0 | ||
| num_cell_faces = Gridap.ReferenceFEs.num_faces(cell_reffe,Dcm-1) |
| function face_dim(num_vertices, num_edges, num_faces, face_lid) | ||
| if (face_lid <= num_vertices) | ||
| return 0 | ||
| elseif (face_lid <= num_vertices + num_edges) | ||
| return 1 | ||
| elseif (face_lid <= num_vertices + num_edges + num_faces) | ||
| return (num_edges==0 ? 1 : 2) | ||
| end | ||
| end |
| Gridap.Geometry.Triangulation(t::Gridap.Adaptivity.AdaptedTriangulation, | ||
| mask::AbstractArray{<:Bool}) = | ||
| Gridap.Geometry.Triangulation(t.trian, mask) |
| outdir = joinpath(@__DIR__, "mwe_sphere_out_no_embedded") | ||
| rank == 0 && mkpath(outdir) | ||
| MPI.Barrier(MPI.COMM_WORLD) | ||
|
|
| with_mpi() do distribute | ||
| mwe_sphere_3d_hanging_glue_on_portion(distribute,3,3) | ||
| println("finished") |
|
|
||
| for d=0:Dcm-1 | ||
| cell_faces_old = get_faces(topology_old, Dcm, d) | ||
| face_cells_old = get_faces(topology_old, d, Dcm) |
| with_mpi() do distribute | ||
| mwe_sphere_3d_hanging_glue_on_portion(distribute,3,3) | ||
| println("finished") | ||
| end No newline at end of file |
Hello, @amartinhuertas,
For hanging faces on 3D triangulation portions, we must check whether any of the cells around the owner face is active to ensure a correct re-classification into regular/hanging faces.
Here is a PR that applies the necessary changes to account for this. Previously, the code only checked if the owner cell was active or not., that led to an incorrect classification. For instance, in this mesh,
the circled hanging vertex was being marked as regular.
I've added a file
test/issue_108.jlwith the MWE of the mesh above. It's a little ad-hoc, because it comes from a GridapEmbedded.jl. Let me know what should we do with it.Please, review and accept this PR whenever you have some time.
Thanks!
Also thanks @nannaberre for the help!