Rodin::Geometry::GreedyPartitioner class

Partitioner using a greedy algorithm.

This partitioning strategy uses a greedy approach to divide the mesh into a specified number of partitions. The algorithm processes polytopes sequentially and assigns them to partitions to balance the load.

Base classes

class Partitioner
Abstract base class for mesh partitioning strategies.

Public types

using MeshType = Geometry::Mesh<Context::Local>
Type of mesh used by this partitioner.

Constructors, destructors, conversion operators

GreedyPartitioner(const MeshType& mesh)
Constructs a greedy partitioner for the given mesh.
~GreedyPartitioner() defaulted virtual
Virtual destructor.

Public functions

auto getMesh() const -> const MeshType& override
Gets the mesh being partitioned.
void partition(size_t count)
Partitions the mesh cells.
void partition(size_t numPartitions, size_t d) override
Partitions the mesh polytopes of dimension d.
auto getPartition(Index index) const -> size_t override
Gets the partition index for a given polytope.
auto getCount() const -> size_t override
Gets the total number of partitions.

Function documentation

Rodin::Geometry::GreedyPartitioner::GreedyPartitioner(const MeshType& mesh)

Constructs a greedy partitioner for the given mesh.

Parameters
mesh in Mesh to partition

const MeshType& Rodin::Geometry::GreedyPartitioner::getMesh() const override

Gets the mesh being partitioned.

Returns Reference to the mesh

void Rodin::Geometry::GreedyPartitioner::partition(size_t count)

Partitions the mesh cells.

Parameters
count in Number of partitions to create

Convenience method that partitions the highest-dimensional polytopes (cells) of the mesh into count partitions.

void Rodin::Geometry::GreedyPartitioner::partition(size_t numPartitions, size_t d) override

Partitions the mesh polytopes of dimension d.

Parameters
numPartitions in Number of partitions to create
in Dimension of polytopes to partition

Uses a greedy algorithm to divide polytopes of dimension d into numPartitions approximately equal-sized partitions.

size_t Rodin::Geometry::GreedyPartitioner::getPartition(Index index) const override

Gets the partition index for a given polytope.

Parameters
index in Index of the polytope
Returns Partition number assigned to the polytope

size_t Rodin::Geometry::GreedyPartitioner::getCount() const override

Gets the total number of partitions.

Returns Number of partitions created