17 #include "libmesh/elem.h" 18 #include "libmesh/mesh_base.h" 19 #include "libmesh/boundary_info.h" 30 "The name of the primary boundary sideset.");
32 "to communicate ghost elements on a boundary.");
54 std::ostringstream oss;
55 oss <<
"GhostBoundary";
61 const MeshBase::const_element_iterator & ,
72 for (
const Elem *
const elem :
_mesh->active_element_ptr_range())
78 if (elem->on_boundary())
79 coupled_elements.insert(std::make_pair(elem,
_null_mat));
86 for (
auto side : elem->side_index_range())
87 for (
auto boundary_id : boundary_ids)
88 if ((elem->processor_id() != p) && (binfo.
has_boundary_id(elem, side, boundary_id)))
90 coupled_elements.insert(std::make_pair(elem,
_null_mat));
101 if (
auto asoi = dynamic_cast<const GhostBoundary *>(&other); asoi &&
baseGreaterEqual(*asoi))
104 std::set<BoundaryName> their_set(asoi->_boundary_name.begin(), asoi->_boundary_name.end());
105 std::set<BoundaryName> difference;
106 std::set_difference(their_set.begin(),
110 std::inserter(difference, difference.end()));
111 if (difference.empty())
117 std::unique_ptr<GhostingFunctor>
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
std::string getInfo() const override
Method for returning relationship manager information (suitable for console output).
const BoundaryID INVALID_BOUNDARY_ID
virtual void operator()(const MeshBase::const_element_iterator &, const MeshBase::const_element_iterator &, processor_id_type p, map_type &coupled_elements) override
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...
MooseMesh * _moose_mesh
Pointer to the MooseMesh object.
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
registerMooseObject("MooseApp", GhostBoundary)
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const BoundaryInfo & get_boundary_info() const
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
const CouplingMatrix *const _null_mat
null matrix for generating full variable coupling
const MeshBase * getMeshPtr() const
uint8_t processor_id_type
virtual std::unique_ptr< GhostingFunctor > clone() const override
virtual void internalInitWithMesh(const MeshBase &) override
static InputParameters validParams()
GhostBoundary(const InputParameters &)
MooseApp & _app
The MOOSE application this is associated with.
virtual bool baseGreaterEqual(const RelationshipManager &rhs) const
Whether the base class provides more or the same amount and type of ghosting as the rhs...
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
static InputParameters validParams()
GhostBoundary is used to ghost elements on a boundary.
const std::vector< BoundaryName > & _boundary_name
The boundary for which we will ghost elements.
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...