14#include "libmesh/elem.h"
23 params.
addParam<processor_id_type>(
"rank", 0,
"The MPI rank to assign all elements to.");
34 paramError(
"rank",
"Cannot be larger than the available number of MPI ranks");
37std::unique_ptr<Partitioner>
46 for (
auto & elem_ptr :
mesh.active_element_ptr_range())
47 elem_ptr->processor_id() =
_rank;
registerMooseObject("MooseApp", SingleRankPartitioner)
std::unique_ptr< T > clone(const T &object)
Clones the object object.
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
MooseApp & _app
The MOOSE application this is associated with.
Base class for MOOSE partitioner.
static InputParameters validParams()
Partitions a mesh to one MPI rank.
static InputParameters validParams()
const processor_id_type _rank
Rank to assign every element to.
SingleRankPartitioner(const InputParameters ¶ms)
virtual std::unique_ptr< Partitioner > clone() const override
virtual void _do_partition(MeshBase &mesh, const unsigned int n) override
processor_id_type size() const
const Parallel::Communicator & _communicator