Skip to content

Commit

Permalink
make sure two maps connecting lower-d and higher-d elements are built…
Browse files Browse the repository at this point in the history
… in recovery mode idaholab#27696
  • Loading branch information
YaqiWang committed May 23, 2024
1 parent f91337a commit 935c2cc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/include/mesh/MooseMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,9 @@ class MooseMesh : public MooseObject, public Restartable, public PerfGraphInterf
/// Build extra data for faster access to the information of extra element integers
void buildElemIDInfo();

/// Build two maps to connect lower-d elements with interior parent elements
void connectLowerDMesh();

/// Build lower-d mesh for all sides
void buildLowerDMesh();

Expand Down
26 changes: 26 additions & 0 deletions framework/src/mesh/MooseMesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,29 @@ MooseMesh::update()
_finite_volume_info_dirty = true;
}

void
MooseMesh::connectLowerDMesh()
{
for (const auto & elem : getMesh().active_element_ptr_range())
{
const auto parent = elem->interior_parent();
if (!parent)
continue;

auto side = parent->which_side_am_i(elem);

// For some grid sequencing tests: side == libMesh::invalid_uint
if (side != libMesh::invalid_uint)
{
auto pair = std::make_pair(parent, side);
auto link = std::make_pair(pair, elem);
auto ilink = std::make_pair(elem, side);
_lower_d_elem_to_higher_d_elem_side.insert(ilink);
_higher_d_elem_side_to_lower_d_elem.insert(link);
}
}
}

void
MooseMesh::buildLowerDMesh()
{
Expand Down Expand Up @@ -2677,6 +2700,9 @@ MooseMesh::init()

getMesh().allow_renumbering(allow_renumbering_later);
getMesh().skip_partitioning(skip_partitioning_later);

if (getParam<bool>("build_all_side_lowerd_mesh"))
connectLowerDMesh();
}
else // Normally just build the mesh
{
Expand Down

0 comments on commit 935c2cc

Please sign in to comment.