GreedyPartitioner

Partitioner using a greedy algorithm.

Defined in Rodin/Geometry/GreedyPartitioner.h

class GreedyPartitioner;

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.

Direct inheritance by class family
↓
GreedyPartitioner

Inherits from

Base classResponsibility
Partitionerpublic
Full type
Partitioner
Abstract base class for mesh partitioning strategies.

Overrides

MemberBase declaration
getMesh()Partitioner::getMesh
partition()Partitioner::partition
getPartition()Partitioner::getPartition
getCount()Partitioner::getCount

Inherited interface

Declared inMembers
Partitioner
1 members

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

GreedyPartitioner(const MeshType& mesh)

Constructs a greedy partitioner for the given mesh.

Parameters
mesh in Mesh to partition

const MeshType& getMesh() const override

Gets the mesh being partitioned.

Returns Reference to the mesh

void 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 partition(size_t numPartitions, size_t d) override

Partitions the mesh polytopes of dimension d.

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

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

size_t 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 getCount() const override

Gets the total number of partitions.

Returns Number of partitions created