12 #include "libmesh/boundary_info.h" 13 #include "libmesh/elem.h" 26 "The name of the primary boundary sideset.");
28 "The name of the secondary boundary sideset.");
29 params.
addRequiredParam<
bool>(
"enabled",
"Whether this relationship manager should ghost.");
31 "Ghosts full-dimensional elements with sides on the primary boundary to processors that own " 32 "full-dimensional elements with sides on the secondary boundary.");
38 _primary_boundary_name(getParam<BoundaryName>(
"primary_boundary")),
39 _secondary_boundary_name(getParam<BoundaryName>(
"secondary_boundary")),
40 _enabled(getParam<bool>(
"enabled"))
46 _primary_boundary_name(other._primary_boundary_name),
47 _secondary_boundary_name(other._secondary_boundary_name),
48 _enabled(other._enabled)
60 std::ostringstream oss;
61 oss <<
"GhostPrimaryFace" << (
_enabled ?
"" :
" (disabled)");
67 const MeshBase::const_element_iterator & range_end,
69 const bool generating_mesh)
const 74 for (
const Elem *
const elem :
as_range(range_begin, range_end))
76 if (elem->dim() != mesh_dim)
83 if (elem->on_boundary())
87 for (
const auto side : elem->side_index_range())
97 const MeshBase::const_element_iterator & range_end,
105 const auto primary_boundary_id = generating_mesh
108 const auto secondary_boundary_id = generating_mesh
118 for (
const Elem *
const elem :
_mesh->active_element_ptr_range())
120 if (elem->processor_id() == p || elem->dim() != mesh_dim)
127 if (elem->on_boundary())
128 coupled_elements.emplace(elem,
_null_mat);
131 for (
const auto side : elem->side_index_range())
134 coupled_elements.emplace(elem,
_null_mat);
143 const auto *
const primary_face =
dynamic_cast<const GhostPrimaryFace *
>(&other);
149 if (
_enabled && !primary_face->_enabled)
158 return primary_face->_enabled &&
_use_displaced_mesh == primary_face->_use_displaced_mesh &&
163 std::unique_ptr<GhostingFunctor>
std::string getInfo() const override
Method for returning relationship manager information (suitable for console output).
bool hasSecondaryBoundaryFace(const libMesh::MeshBase::const_element_iterator &range_begin, const libMesh::MeshBase::const_element_iterator &range_end, BoundaryID secondary_boundary_id, bool generating_mesh) const
Return whether the local element range contains a secondary boundary face.
static InputParameters validParams()
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
const BoundaryID INVALID_BOUNDARY_ID
registerMooseObject("MooseApp", GhostPrimaryFace)
GhostPrimaryFace(const InputParameters ¶ms)
MooseMesh * _moose_mesh
Pointer to the MooseMesh object.
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const BoundaryName _secondary_boundary_name
Secondary boundary whose local presence triggers primary boundary ghosting.
const BoundaryInfo & get_boundary_info() const
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
const BoundaryName _primary_boundary_name
Primary boundary whose full-dimensional elements may be ghosted.
const MeshBase * getMeshPtr() const
uint8_t processor_id_type
boundary_id_type BoundaryID
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
virtual void internalInitWithMesh(const libMesh::MeshBase &) override
const bool _enabled
Whether this relationship manager should add ghosting entries.
MooseApp & _app
The MOOSE application this is associated with.
const libMesh::CouplingMatrix *const _null_mat
null matrix for generating full variable coupling
virtual bool baseGreaterEqual(const RelationshipManager &rhs) const
Whether the base class provides more or the same amount and type of ghosting as the rhs...
virtual bool operator>=(const RelationshipManager &other) const override
Whether this relationship manager provides more or the same amount and type of ghosting as the rhs...
Ghosts full-dimensional elements with sides on the primary boundary to processors that own full-dimen...
const bool _use_displaced_mesh
Which system this should go to (undisplaced or displaced)
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
static InputParameters validParams()
virtual std::unique_ptr< libMesh::GhostingFunctor > clone() const override
virtual void operator()(const libMesh::MeshBase::const_element_iterator &range_begin, const libMesh::MeshBase::const_element_iterator &range_end, libMesh::processor_id_type p, map_type &coupled_elements) override
unsigned int mesh_dimension() const
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.