Skip to content

Commit

Permalink
Make sure to ghost lower-d elements for aux kernels that require them
Browse files Browse the repository at this point in the history
Refs parallel failures from idaholab#26593
  • Loading branch information
lindsayad authored and schakrabortygithub committed Mar 12, 2024
1 parent a76ac71 commit 671e819
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions framework/include/mesh/MooseMesh.h
Expand Up @@ -1359,6 +1359,12 @@ class MooseMesh : public MooseObject, public Restartable, public PerfGraphInterf
*/
bool isLowerD(const SubdomainID subdomain_id) const;

/**
* @return Whether there are any lower-dimensional blocks that are manifolds of higher-dimensional
* block faces
*/
bool hasLowerD() const { return _has_lower_d; }

protected:
/// Deprecated (DO NOT USE)
std::vector<std::unique_ptr<GhostingFunctor>> _ghosting_functors;
Expand Down Expand Up @@ -1751,6 +1757,10 @@ class MooseMesh : public MooseObject, public Restartable, public PerfGraphInterf
_higher_d_elem_side_to_lower_d_elem;
std::unordered_map<const Elem *, unsigned short int> _lower_d_elem_to_higher_d_elem_side;

/// Whether there are any lower-dimensional blocks that are manifolds of higher-dimensional block
/// faces
bool _has_lower_d;

/// Whether or not this Mesh is allowed to read a recovery file
bool _allow_recovery;

Expand Down
4 changes: 4 additions & 0 deletions framework/src/auxkernels/AuxKernel.C
Expand Up @@ -64,6 +64,10 @@ AuxKernelTempl<ComputeValueType>::validParams()
// This flag is set to true if the AuxKernelTempl is being used on a boundary
params.addPrivateParam<bool>("_on_boundary", false);

params.addRelationshipManager("GhostLowerDElems",
Moose::RelationshipManagerType::GEOMETRIC |
Moose::RelationshipManagerType::ALGEBRAIC);

params.declareControllable("enable"); // allows Control to enable/disable this type of object
params.registerBase("AuxKernel");

Expand Down
6 changes: 6 additions & 0 deletions framework/src/mesh/MooseMesh.C
Expand Up @@ -212,6 +212,7 @@ MooseMesh::MooseMesh(const InputParameters & parameters)
getParam<MooseEnum>("patch_update_strategy").getEnum<Moose::PatchUpdateType>()),
_regular_orthogonal_mesh(false),
_is_split(getParam<bool>("_is_split")),
_has_lower_d(false),
_allow_recovery(true),
_construct_node_list_from_side_list(getParam<bool>("construct_node_list_from_side_list")),
_need_delete(false),
Expand Down Expand Up @@ -270,6 +271,8 @@ MooseMesh::MooseMesh(const MooseMesh & other_mesh)
_patch_update_strategy(other_mesh._patch_update_strategy),
_regular_orthogonal_mesh(false),
_is_split(other_mesh._is_split),
_has_lower_d(other_mesh._has_lower_d),
_allow_recovery(other_mesh._allow_recovery),
_construct_node_list_from_side_list(other_mesh._construct_node_list_from_side_list),
_need_delete(other_mesh._need_delete),
_allow_remote_element_removal(other_mesh._allow_remote_element_removal),
Expand Down Expand Up @@ -1205,6 +1208,7 @@ MooseMesh::cacheInfo()
{
TIME_SECTION("cacheInfo", 3);

_has_lower_d = false;
_sub_to_data.clear();
_neighbor_subdomain_boundary_ids.clear();
_block_node_list.clear();
Expand Down Expand Up @@ -1264,6 +1268,8 @@ MooseMesh::cacheInfo()
_communicator.set_union(sub_data.neighbor_subs);
_communicator.set_union(sub_data.boundary_ids);
_communicator.max(sub_data.is_lower_d);
if (sub_data.is_lower_d)
_has_lower_d = true;
_communicator.set_union(_neighbor_subdomain_boundary_ids[blk_id]);
}
}
Expand Down
2 changes: 2 additions & 0 deletions framework/src/relationshipmanagers/GhostLowerDElems.C
Expand Up @@ -50,6 +50,8 @@ GhostLowerDElems::operator()(const MeshBase::const_element_iterator & range_begi
{
mooseAssert(_moose_mesh,
"The MOOSE mesh must be non-null in order for this relationship manager to work.");
if (!_moose_mesh->hasLowerD())
return;

static const CouplingMatrix * const null_mat = nullptr;

Expand Down

0 comments on commit 671e819

Please sign in to comment.