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 authored and pbehne committed Jun 12, 2024
1 parent 22be231 commit 11ae8de
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions framework/src/mesh/MooseMesh.C
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ MooseMesh::cacheInfo()
_neighbor_subdomain_boundary_ids.clear();
_block_node_list.clear();
_higher_d_elem_side_to_lower_d_elem.clear();
_lower_d_elem_to_higher_d_elem_side.clear();

// TODO: Thread this!
for (const auto & elem : getMesh().element_ptr_range())
Expand All @@ -1255,6 +1256,8 @@ MooseMesh::cacheInfo()
auto pair = std::make_pair(ip_elem, ip_side);
_higher_d_elem_side_to_lower_d_elem.insert(
std::pair<std::pair<const Elem *, unsigned short int>, const Elem *>(pair, elem));
_lower_d_elem_to_higher_d_elem_side.insert(
std::pair<const Elem *, unsigned short int>(elem, ip_side));
}
}

Expand Down
5 changes: 5 additions & 0 deletions test/src/userobjects/LowerDIntegralSideUserObject.C
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ LowerDIntegralSideUserObject::execute()
upwind_elem ? _fe_problem.mesh().getLowerDElem(_current_elem, _current_side)
: _fe_problem.mesh().getLowerDElem(neighbor,
neighbor->which_neighbor_am_i(_current_elem));
if (!current_lower_d_elem)
mooseError("Cannot find lower-d element");
if (_mesh.getHigherDSide(current_lower_d_elem) == libMesh::invalid_uint)
mooseError("Error in getting side id of a lower-d element with respect to higher-d element");
_fe_problem.reinitLowerDElem(current_lower_d_elem, _tid);
for (unsigned int qp = 0; qp < _qrule->n_points(); ++qp)
{
Expand All @@ -62,4 +66,5 @@ LowerDIntegralSideUserObject::threadJoin(const UserObject & y)
void
LowerDIntegralSideUserObject::finalize()
{
gatherSum(_integral_value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
value = '1'
block = '1 2 3 4'
[]
[time]
type = CoefTimeDerivative
variable = u
block = '1 2 3 4'
Coefficient = 1
[]
[]

[DGKernels]
Expand Down Expand Up @@ -119,8 +125,18 @@
[]
[]

[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
block = '1 2 3 4'
[]
[]

[Executioner]
type = Steady
type = Transient
nl_abs_tol = 1e-12
num_steps = 8
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
Expand Down

0 comments on commit 11ae8de

Please sign in to comment.