libMesh
|
The MappedSubdomainPartitioner
partitions the elements based on their subdomain ids.
More...
#include <mapped_subdomain_partitioner.h>
Public Member Functions | |
MappedSubdomainPartitioner ()=default | |
Ctors, assignment operators, and destructor are all explicitly defaulted for this class. More... | |
MappedSubdomainPartitioner (const MappedSubdomainPartitioner &)=default | |
MappedSubdomainPartitioner (MappedSubdomainPartitioner &&)=default | |
MappedSubdomainPartitioner & | operator= (const MappedSubdomainPartitioner &)=default |
MappedSubdomainPartitioner & | operator= (MappedSubdomainPartitioner &&)=default |
virtual | ~MappedSubdomainPartitioner ()=default |
virtual std::unique_ptr< Partitioner > | clone () const override |
virtual void | partition_range (MeshBase &mesh, MeshBase::element_iterator it, MeshBase::element_iterator end, const unsigned int n) override |
Called by the SubdomainPartitioner to partition elements in the range (it, end). More... | |
virtual void | partition (MeshBase &mesh, const unsigned int n) |
Partitions the MeshBase into n parts by setting processor_id() on Nodes and Elems. More... | |
virtual void | partition (MeshBase &mesh) |
Partitions the MeshBase into mesh.n_processors() by setting processor_id() on Nodes and Elems. More... | |
void | repartition (MeshBase &mesh, const unsigned int n) |
Repartitions the MeshBase into n parts. More... | |
void | repartition (MeshBase &mesh) |
Repartitions the MeshBase into mesh.n_processors() parts. More... | |
virtual void | attach_weights (ErrorVector *) |
Attach weights that can be used for partitioning. More... | |
Static Public Member Functions | |
static void | partition_unpartitioned_elements (MeshBase &mesh) |
These functions assign processor IDs to newly-created elements (in parallel) which are currently assigned to processor 0. More... | |
static void | partition_unpartitioned_elements (MeshBase &mesh, const unsigned int n) |
static void | set_parent_processor_ids (MeshBase &mesh) |
This function is called after partitioning to set the processor IDs for the inactive parent elements. More... | |
static void | set_node_processor_ids (MeshBase &mesh) |
This function is called after partitioning to set the processor IDs for the nodes. More... | |
static void | processor_pairs_to_interface_nodes (MeshBase &mesh, std::map< std::pair< processor_id_type, processor_id_type >, std::set< dof_id_type >> &processor_pair_to_nodes) |
On the partitioning interface, a surface is shared by two and only two processors. More... | |
static void | set_interface_node_processor_ids_linear (MeshBase &mesh) |
Nodes on the partitioning interface is linearly assigned to each pair of processors. More... | |
static void | set_interface_node_processor_ids_BFS (MeshBase &mesh) |
Nodes on the partitioning interface is clustered into two groups BFS (Breadth First Search)scheme for per pair of processors. More... | |
static void | set_interface_node_processor_ids_petscpartitioner (MeshBase &mesh) |
Nodes on the partitioning interface is partitioned into two groups using a PETSc partitioner for each pair of processors. More... | |
Public Attributes | |
std::map< subdomain_id_type, processor_id_type > | subdomain_to_proc |
Before calling partition() or partition_range(), the user must assign all the Mesh subdomains to certain processors by adding them to this std::map. More... | |
Protected Member Functions | |
virtual void | _do_partition (MeshBase &mesh, const unsigned int n) override |
Partition the MeshBase into n subdomains. More... | |
void | single_partition (MeshBase &mesh) |
Trivially "partitions" the mesh for one processor. More... | |
void | single_partition_range (MeshBase::element_iterator it, MeshBase::element_iterator end) |
Slightly generalized version of single_partition which acts on a range of elements defined by the pair of iterators (it, end). More... | |
virtual void | _do_repartition (MeshBase &mesh, const unsigned int n) |
This is the actual re-partitioning method which can be overridden in derived classes. More... | |
virtual void | _find_global_index_by_pid_map (const MeshBase &mesh) |
Construct contiguous global indices for the current partitioning. More... | |
virtual void | build_graph (const MeshBase &mesh) |
Build a dual graph for partitioner. More... | |
void | assign_partitioning (const MeshBase &mesh, const std::vector< dof_id_type > &parts) |
Assign the computed partitioning to the mesh. More... | |
Protected Attributes | |
ErrorVector * | _weights |
The weights that might be used for partitioning. More... | |
std::unordered_map< dof_id_type, dof_id_type > | _global_index_by_pid_map |
Maps active element ids into a contiguous range, as needed by parallel partitioner. More... | |
std::vector< dof_id_type > | _n_active_elem_on_proc |
The number of active elements on each processor. More... | |
std::vector< std::vector< dof_id_type > > | _dual_graph |
A dual graph corresponds to the mesh, and it is typically used in paritioner. More... | |
std::vector< Elem * > | _local_id_to_elem |
Static Protected Attributes | |
static const dof_id_type | communication_blocksize |
The blocksize to use when doing blocked parallel communication. More... | |
The MappedSubdomainPartitioner
partitions the elements based on their subdomain ids.
The user must set up the values in the public subdomain_to_proc map in order to specify which subdomains should be partitioned onto which processors. More than one subdomain can be partitioned onto a given processor, but every subdomain must be assigned to exactly 1 processor.
Definition at line 42 of file mapped_subdomain_partitioner.h.
|
default |
Ctors, assignment operators, and destructor are all explicitly defaulted for this class.
|
default |
|
default |
|
virtualdefault |
|
overrideprotectedvirtual |
Partition the MeshBase
into n
subdomains.
Implements libMesh::Partitioner.
|
protectedvirtualinherited |
This is the actual re-partitioning method which can be overridden in derived classes.
Reimplemented in libMesh::ParmetisPartitioner.
Definition at line 237 of file partitioner.h.
References libMesh::Partitioner::_do_partition().
|
protectedvirtualinherited |
Construct contiguous global indices for the current partitioning.
The global indices are ordered part-by-part
|
protectedinherited |
Assign the computed partitioning to the mesh.
|
virtualinherited |
Attach weights that can be used for partitioning.
This ErrorVector should be exactly the same on every processor and should have mesh->max_elem_id() entries.
Reimplemented in libMesh::MetisPartitioner.
Definition at line 203 of file partitioner.h.
|
protectedvirtualinherited |
Build a dual graph for partitioner.
Reimplemented in libMesh::ParmetisPartitioner.
|
overridevirtual |
Implements libMesh::Partitioner.
Definition at line 60 of file mapped_subdomain_partitioner.h.
|
default |
|
default |
|
virtualinherited |
Partitions the MeshBase
into n
parts by setting processor_id() on Nodes and Elems.
|
virtualinherited |
Partitions the MeshBase
into mesh.n_processors()
by setting processor_id() on Nodes and Elems.
|
overridevirtual |
Called by the SubdomainPartitioner to partition elements in the range (it, end).
Reimplemented from libMesh::Partitioner.
|
staticinherited |
These functions assign processor IDs to newly-created elements (in parallel) which are currently assigned to processor 0.
|
staticinherited |
|
staticinherited |
On the partitioning interface, a surface is shared by two and only two processors.
Try to find which pair of processors corresponds to which surfaces, and store their nodes.
|
inherited |
Repartitions the MeshBase
into n
parts.
(Some partitioning algorithms can repartition more efficiently than computing a new partitioning from scratch.) The default behavior is to simply call this->partition(mesh,n).
|
inherited |
Repartitions the MeshBase
into mesh.n_processors()
parts.
This is required since some partitioning algorithms can repartition more efficiently than computing a new partitioning from scratch.
|
staticinherited |
Nodes on the partitioning interface is clustered into two groups BFS (Breadth First Search)scheme for per pair of processors.
|
staticinherited |
Nodes on the partitioning interface is linearly assigned to each pair of processors.
|
staticinherited |
Nodes on the partitioning interface is partitioned into two groups using a PETSc partitioner for each pair of processors.
|
staticinherited |
This function is called after partitioning to set the processor IDs for the nodes.
By definition, a Node's processor ID is the minimum processor ID for all of the elements which share the node.
|
staticinherited |
This function is called after partitioning to set the processor IDs for the inactive parent elements.
A parent's processor ID is the same as its first child.
|
protectedinherited |
Trivially "partitions" the mesh for one processor.
Simply loops through the elements and assigns all of them to processor 0. Is is provided as a separate function so that derived classes may use it without reimplementing it.
|
protectedinherited |
Slightly generalized version of single_partition which acts on a range of elements defined by the pair of iterators (it, end).
|
protectedinherited |
A dual graph corresponds to the mesh, and it is typically used in paritioner.
A vertex represents an element, and its neighbors are the element neighbors.
Definition at line 288 of file partitioner.h.
|
protectedinherited |
Maps active element ids into a contiguous range, as needed by parallel partitioner.
Definition at line 272 of file partitioner.h.
|
protectedinherited |
Definition at line 291 of file partitioner.h.
|
protectedinherited |
The number of active elements on each processor.
Definition at line 281 of file partitioner.h.
|
protectedinherited |
The weights that might be used for partitioning.
Definition at line 267 of file partitioner.h.
Referenced by libMesh::MetisPartitioner::attach_weights().
|
staticprotectedinherited |
The blocksize to use when doing blocked parallel communication.
This limits the maximum vector size which can be used in a single communication step.
Definition at line 244 of file partitioner.h.
std::map<subdomain_id_type, processor_id_type> libMesh::MappedSubdomainPartitioner::subdomain_to_proc |
Before calling partition() or partition_range(), the user must assign all the Mesh subdomains to certain processors by adding them to this std::map.
For example: subdomain_to_proc[1] = 0; subdomain_to_proc[2] = 0; subdomain_to_proc[3] = 0; subdomain_to_proc[4] = 1; subdomain_to_proc[5] = 1; subdomain_to_proc[6] = 2; Would partition the mesh onto three processors, with subdomains 1, 2, and 3 on processor 0, subdomains 4 and 5 on processor 1, and subdomain 6 on processor 2.
Definition at line 79 of file mapped_subdomain_partitioner.h.