46 libmesh_assert_greater (n, 0);
49 if (!
mesh.is_serial())
50 libmesh_not_implemented();
100 libmesh_error_msg(
"Unknown sort method: " << this->
sort_method());
104 const dof_id_type target_size = cast_int<dof_id_type>
114 std::min (cast_int<processor_id_type>(i / target_size),
115 cast_int<processor_id_type>(n-1));
122 const unsigned int n)
125 mesh.elements_begin(),
145 const std::pair<Point, Elem *> & rhs)
147 return (lhs.first(0) < rhs.first(0));
154 const std::pair<Point, Elem *> & rhs)
156 return (lhs.first(1) < rhs.first(1));
164 const std::pair<Point, Elem *> & rhs)
166 return (lhs.first(2) < rhs.first(2));
172 const std::pair<Point, Elem *> & rhs)
174 return (lhs.first.norm() < rhs.first.norm());
virtual void _do_partition(MeshBase &mesh, const unsigned int n) override
std::vector< std::pair< Point, Elem * > > _elem_centroids
The base class for all geometric element types.
virtual void partition_range(MeshBase &mesh, MeshBase::element_iterator it, MeshBase::element_iterator end, const unsigned int n) override
void single_partition_range(MeshBase::element_iterator it, MeshBase::element_iterator end)
SimpleRange< I > as_range(const std::pair< I, I > &p)
static bool sort_radial(const std::pair< Point, Elem *> &lhs, const std::pair< Point, Elem *> &rhs)
static bool sort_y(const std::pair< Point, Elem *> &lhs, const std::pair< Point, Elem *> &rhs)
CentroidSortMethod sort_method() const
static bool sort_x(const std::pair< Point, Elem *> &lhs, const std::pair< Point, Elem *> &rhs)
static bool sort_z(const std::pair< Point, Elem *> &lhs, const std::pair< Point, Elem *> &rhs)
processor_id_type processor_id() const
long double min(long double a, double b)
void compute_centroids(MeshBase::element_iterator it, MeshBase::element_iterator end)