18 constexpr
unsigned int GEOMETRIC_MAP_IDX = 0;
19 constexpr
unsigned int ALGEBRAIC_MAP_IDX = 1;
27 params.
addParam<std::vector<processor_id_type>>(
"pids",
"The PID(s) to see the ghosting for");
32 params.
addClassDescription(
"Creates ghosting maps that can be queried by external objects.");
38 _mesh(_subproblem.
mesh()),
39 _nl(_fe_problem.getNonlinearSystemBase(_sys.number()))
63 for (
auto & map_ref :
_maps)
64 for (
auto pid_map_pair : map_ref)
65 pid_map_pair.second.clear();
67 for (
auto pid :
_pids)
69 auto begin_elem =
_mesh.
getMesh().active_pid_elements_begin(pid);
70 const auto end_elem =
_mesh.
getMesh().active_pid_elements_end(pid);
77 (*gf)(begin_elem, end_elem, pid, geometric_elems);
78 _maps[GEOMETRIC_MAP_IDX].emplace(pid, geometric_elems);
84 _nl.
dofMap().algebraic_ghosting_functors_end()))
85 (*gf)(begin_elem, end_elem, pid, algebraic_elems);
88 (*gf)(begin_elem, end_elem, pid, algebraic_elems);
89 _maps[ALGEBRAIC_MAP_IDX].emplace(pid, algebraic_elems);
101 auto map_it =
_maps[map_idx].find(pid);
102 if (map_it ==
_maps[map_idx].end())
103 mooseError(
"No entry in the ghosting map for processor ID: ", pid);
105 auto map_ref = map_it->second;
106 if (map_ref.find(elem) != map_ref.end())
std::vector< std::unordered_map< processor_id_type, libMesh::GhostingFunctor::map_type > > _maps
Ghost Functor maps Dimension one: Map type (Geometric, Algebraic) Dimension two: Proc ID -> Map Dimen...
A MultiMooseEnum object to hold "execute_on" flags.
std::vector< processor_id_type > _pids
The PID to show the ghosting for.
RelationshipManagerType
Main types of Relationship Managers.
static InputParameters validParams()
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
Real getElementalValue(const Elem *elem, Moose::RelationshipManagerType rm_type, processor_id_type pid) const
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
This object loops over all of the underlying ghosting functors added by libMesh or MOOSE through Rela...
uint8_t processor_id_type
virtual DofMap & dofMap()
Gets writeable reference to the dof map.
processor_id_type n_processors() const
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
GhostingUserObject(const InputParameters ¶meters)
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
MooseApp & _app
The MOOSE application this is associated with.
virtual void meshChanged() override
Called on this object when the mesh changes.
NonlinearSystemBase & _nl
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const InputParameters & parameters() const
Get the parameters of the object.
registerMooseObject("MooseApp", GhostingUserObject)
const ExecFlagType EXEC_INITIAL