13 #include "libmesh/system.h" 14 #include "libmesh/elem.h" 15 #include "libmesh/dof_map.h" 25 "The libMesh system to mirror the ghosting from");
31 :
RelationshipManager(parameters), _other_system(getCheckedPointerParam<System *>(
"other_system"))
42 const MeshBase::const_element_iterator & ,
48 auto other_elements_begin = other_mesh.active_local_elements_begin();
49 auto other_elements_end = other_mesh.active_local_elements_end();
56 auto gf_it = other_mesh.ghosting_functors_begin();
57 const auto gf_end = other_mesh.ghosting_functors_end();
59 for (; gf_it != gf_end; ++gf_it)
60 if (!dynamic_cast<ProxyRelationshipManager *>(*gf_it))
61 (*(*gf_it))(other_elements_begin, other_elements_end, p, other_coupled_elements);
67 auto gf_it =
_other_system->get_dof_map().algebraic_ghosting_functors_begin();
68 const auto gf_end =
_other_system->get_dof_map().algebraic_ghosting_functors_end();
70 for (; gf_it != gf_end; ++gf_it)
71 if (!dynamic_cast<ProxyRelationshipManager *>(*gf_it))
72 (*(*gf_it))(other_elements_begin, other_elements_end, p, other_coupled_elements);
76 std::map<dof_id_type, const Elem *> unique_id_to_elem_map;
81 unique_id_to_elem_map[(*elem_it)->unique_id()] = *elem_it;
84 for (
auto other_coupled_it = other_coupled_elements.begin();
85 other_coupled_it != other_coupled_elements.end();
88 auto other_system_elem = other_coupled_it->first;
90 auto unique_id_to_elem_map_it = unique_id_to_elem_map.find(other_system_elem->unique_id());
91 mooseAssert(unique_id_to_elem_map_it != unique_id_to_elem_map.end(),
"no matching unique id");
93 coupled_elements.emplace(unique_id_to_elem_map_it->second, other_coupled_it->second);
115 std::unique_ptr<GhostingFunctor>
MooseMesh * _moose_mesh
Pointer to the MooseMesh object.
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
registerMooseObject("MooseApp", ProxyRelationshipManager)
std::unique_ptr< T > copyConstruct(const T &object)
Copy constructs the object object.
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
virtual void operator()(const MeshBase::const_element_iterator &, const MeshBase::const_element_iterator &, processor_id_type p, map_type &coupled_elements) override
uint8_t processor_id_type
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
virtual bool operator>=(const RelationshipManager &) const override
Whether this relationship manager provides more or the same amount and type of ghosting as the rhs...
ProxyRelationshipManager(const InputParameters ¶meters)
virtual std::unique_ptr< GhostingFunctor > clone() const override
A clone() is needed because GhostingFunctor can not be shared between different meshes.
bool isType(const Moose::RelationshipManagerType &type) const
Check to see if an RM is of a given type.
MooseApp & _app
The MOOSE application this is associated with.
virtual std::string getInfo() const override
Method for returning relationship manager information (suitable for console output).
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
static InputParameters validParams()
static InputParameters validParams()
bool useDisplacedMesh() const
Whether this should be placed on the undisplaced or displaced systems.
Intermediate base class for RelationshipManagers that are simply built using ghosting functors...