Add distributed mesh support and fake neighbor handling in BreakMeshByBlock
closes #12033 closes #21161
Previous PR #31636 had many repeated messages from the moosebuild bot due to a temporary CIVET hiccup, making the thread difficult to review. As suggested, I am opening a new clean PR here and closing the previous one.
Reason
Currently, BreakMeshByBlock (bmbb) uses a hacky approach to prepare the mesh.
When nodes are duplicated by bmbb, their former neighbors are no longer neighbors (since neighborhood is based on shared nodes). As a result:
- We cannot call
prepare_for_use()at the end of bmbb, because it would erase the discontinuous neighbor information. - To work around this, the framework has special hacks for bmbb (e.g., skipping mesh validity checks in debug mode when bmbb is present).
Another limitation is that bmbb cannot run with distributed meshes. This PR addresses that.
Design
-
Preserving discontinuous neighbors
- Since
prepare_for_use()wipes out discontinuous neighbor data, we introduce a new data structure to store this information (referred to as fake neighbors). - These fake neighbors remain accessible to interface kernels that require them (e.g., CZM).
- Since
-
Support for distributed meshes
Following Roy’s suggestions:-
Unique node IDs: In replicated meshes, new nodes were created with
This fails in distributed meshes.Node::build(*current_node, mesh->n_nodes()).release();
-> Solution: use communication between processors and assign deterministic IDs based onmax_node_idstrides. -
Ghost node handling:
- Phase 0: Each rank computes locally connected blocks for its owned nodes and sends this info to the node owner.
- Phase 1: Node owners aggregate connected block info and broadcast the global set to all ranks.
- Boundary ID assignment: Updated in line with Roy’s fix (commit link).
-
Unique node IDs: In replicated meshes, new nodes were created with
Impact
- bmbb now supports distributed meshes.
-
prepare_for_use()can be safely called at the end of bmbb. - Removes the need for special hacks in the MOOSE framework for bmbb.
Job Documentation, step Docs: sync website on 4b5ade5 wanted to post the following:
View the site here
This comment will be updated on new commits.
Job Coverage, step Generate coverage on a06ed48 wanted to post the following:
Framework coverage
| e6abc1 | #32091 a06ed4 | ||||
|---|---|---|---|---|---|
| Total | Total | +/- | New | ||
| Rate | 85.81% | 85.82% | +0.01% | 100.00% | |
| Hits | 125810 | 125901 | +91 | 305 | |
| Misses | 20802 | 20803 | +1 | 0 | |
Modules coverage
Coverage did not change
Full coverage reports
Reports
-
framework -
chemical_reactions -
combined -
contact -
electromagnetics -
external_petsc_solver -
fluid_properties -
fsi -
functional_expansion_tools -
geochemistry -
heat_transfer -
level_set -
misc -
navier_stokes -
optimization -
peridynamics -
phase_field -
porous_flow -
ray_tracing -
rdg -
reactor -
richards -
scalar_transport -
solid_mechanics -
solid_properties -
stochastic_tools -
subchannel -
thermal_hydraulics -
xfem
This comment will be updated on new commits.
Hi @lindsayad and @GiudGiud, thank you both for the feedback. Since my family is visiting the U.S. for the first time, I’ll be starting a vacation tomorrow. I may not be able to address any additional comments promptly for the rest of December. Thanks for your understanding!
Hi @lindsayad and @GiudGiud, thank you both for the feedback. Since my family is visiting the U.S. for the first time, I’ll be starting a vacation tomorrow. I may not be able to address any additional comments promptly for the rest of December. Thanks for your understanding!
No rush. We appreciate your contributions any time they come in!
Job Test, step Results summary on 4b5ade5 wanted to post the following:
Framework test summary
Compared against fb28c06 in job civet.inl.gov/job/3464837.
Added tests
| Test | Time (s) | Memory (MB) |
|---|---|---|
constraints/equal_value_boundary_constraint.set_primary_and_coord_error |
1.38 | 102.53 |
constraints/equal_value_boundary_constraint.error_multiple_primary_nodes |
1.31 | 116.55 |
constraints/equal_value_boundary_constraint.error_not_find_node_id |
1.31 | 105.50 |
constraints/equal_value_boundary_constraint.test_primary_node_coord |
0.89 | 95.55 |
Modules test summary
Compared against fb28c06 in job civet.inl.gov/job/3464837.
Added tests
| Test | Time (s) | Memory (MB) |
|---|---|---|
solid_mechanics/test:cohesive_zone_model.czm_framework/boundary_pair_not_found |
1.55 | 130.24 |