48 mooseAssert(elem.active(),
"We should never call this method with an inactive element");
50 for (
const auto side : elem.side_index_range())
52 const Elem *
const candidate_neighbor = elem.neighbor_ptr(side);
56 std::set<const Elem *> neighbors;
58 const bool inactive_neighbor_detected =
59 candidate_neighbor ? !candidate_neighbor->active() :
false;
62 if (inactive_neighbor_detected)
65 mooseAssert(candidate_neighbor->has_children(),
"We should have children");
67 const auto candidate_neighbor_side = candidate_neighbor->which_neighbor_am_i(&elem);
69 for (
const auto child_num : make_range(candidate_neighbor->n_children()))
70 if (candidate_neighbor->is_child_on_side(child_num, candidate_neighbor_side))
72 const Elem *
const child = candidate_neighbor->child_ptr(child_num);
73 mooseAssert(child->level() - elem.level() == 1,
"The math doesn't work out here.");
74 mooseAssert(child->has_neighbor(&elem),
"Elem should be a neighbor of this child.");
75 mooseAssert(child->active(),
76 "We shouldn't have greater than a face mismatch level of one");
77 neighbors.insert(child);
81 neighbors.insert(candidate_neighbor);
83 for (
const Elem *
const neighbor : neighbors)
86 elem_has_info ?
mesh.faceInfo(&elem, side)
87 :
mesh.faceInfo(neighbor, neighbor->which_neighbor_am_i(&elem));
89 mooseAssert(fi,
"We should have found a FaceInfo");
90 mooseAssert(elem_has_info ? &elem == &fi->
elem() : &elem == fi->
neighborPtr(),
91 "Doesn't seem like we understand how this FaceInfo thing is working");
95 "Remote element detected. This indicates that you have insufficient geometric "
96 "ghosting. Please contact your application developers.");
97 mooseAssert(elem_has_info ? neighbor == fi->
neighborPtr() : neighbor == &fi->
elem(),
98 "Doesn't seem like we understand how this FaceInfo thing is working");
101 const Point elem_normal = elem_has_info ? fi->
normal() : Point(-fi->
normal());
106 const Point surface_vector = elem_normal * fi->
faceArea() * coord;
108 act(elem, neighbor, fi, surface_vector, coord, elem_has_info);
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face.
void coordTransformFactor(const P &point, C &factor, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint)
Compute a coordinate transformation volume integration factor.
std::tuple< const Elem *, const Elem *, bool > determineElemOneAndTwo(const FaceInfo &fi, const FVVar &var)
This utility determines element one and element two given a FaceInfo fi and variable var.
void loopOverElemFaceInfo(const Elem &elem, const MooseMesh &mesh, ActionFunctor &act, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint)