OGS
|
Mesh partitioner.
Definition at line 64 of file NodeWiseMeshPartitioner.h.
#include <NodeWiseMeshPartitioner.h>
Public Types | |
using | IntegerType = long |
Public Member Functions | |
NodeWiseMeshPartitioner (const IntegerType num_partitions, std::unique_ptr< MeshLib::Mesh > &&mesh) | |
void | partitionByMETIS () |
Partition by node. | |
std::vector< Partition > | partitionOtherMesh (MeshLib::Mesh const &mesh) const |
void | renumberBulkIdsProperty (std::vector< Partition > const &partitions, MeshLib::Properties &partitioned_properties) |
void | write (const std::string &file_name_base) |
void | writeOtherMesh (std::string const &output_filename_base, std::vector< Partition > const &partitions, MeshLib::Properties const &partitioned_properties) const |
void | resetPartitionIdsForNodes (std::vector< std::size_t > &&node_partition_ids) |
MeshLib::Mesh const & | mesh () const |
Private Member Functions | |
void | renumberNodeIndices () |
void | renumberBulkNodeIdsProperty (MeshLib::PropertyVector< std::size_t > *const bulk_node_ids, std::vector< Partition > const &local_partitions) const |
void | renumberBulkElementIdsProperty (MeshLib::PropertyVector< std::size_t > *const bulk_element_ids_pv, std::vector< Partition > const &local_partitions) const |
Private Attributes | |
std::vector< Partition > | _partitions |
Data for all partitions. | |
MeshLib::Properties | _partitioned_properties |
Properties where values at ghost nodes and extra nodes are inserted. | |
std::unique_ptr< MeshLib::Mesh > | _mesh |
Pointer to a mesh object. | |
std::vector< std::size_t > | _nodes_global_ids |
Global IDs of all nodes after partitioning. | |
std::vector< std::size_t > | _nodes_partition_ids |
Partition IDs of each nodes. | |
Definition at line 67 of file NodeWiseMeshPartitioner.h.
|
inline |
num_partitions | Number of partitions, |
mesh | Pointer to a mesh object. |
Definition at line 74 of file NodeWiseMeshPartitioner.h.
|
inline |
Definition at line 107 of file NodeWiseMeshPartitioner.h.
References _mesh.
Referenced by main(), and partitionOtherMesh().
void ApplicationUtils::NodeWiseMeshPartitioner::partitionByMETIS | ( | ) |
Partition by node.
Definition at line 738 of file NodeWiseMeshPartitioner.cpp.
References _mesh, _nodes_partition_ids, _partitioned_properties, _partitions, ApplicationUtils::checkFieldPropertyVectorSize(), ApplicationUtils::partitionMesh(), ApplicationUtils::partitionProperties(), renumberBulkIdsProperty(), and renumberNodeIndices().
Referenced by main().
std::vector< Partition > ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh | ( | MeshLib::Mesh const & | mesh | ) | const |
Definition at line 882 of file NodeWiseMeshPartitioner.cpp.
References _nodes_partition_ids, _partitions, MeshLib::getBulkIDString(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), mesh(), MeshLib::Node, and ApplicationUtils::partitionMesh().
Referenced by main().
|
private |
Renumber the bulk_element_ids property for each partition to match the partitioned bulk mesh elements.
Definition at line 824 of file NodeWiseMeshPartitioner.cpp.
References _partitions.
Referenced by renumberBulkIdsProperty().
void ApplicationUtils::NodeWiseMeshPartitioner::renumberBulkIdsProperty | ( | std::vector< Partition > const & | partitions, |
MeshLib::Properties & | partitioned_properties ) |
Definition at line 756 of file NodeWiseMeshPartitioner.cpp.
References MeshLib::Cell, MeshLib::getBulkIDString(), MeshLib::Properties::getPropertyVector(), MeshLib::Properties::hasPropertyVector(), MeshLib::Node, renumberBulkElementIdsProperty(), and renumberBulkNodeIdsProperty().
Referenced by main(), and partitionByMETIS().
|
private |
Renumber the bulk_node_ids property for each partition to match the partitioned bulk mesh nodes.
Definition at line 782 of file NodeWiseMeshPartitioner.cpp.
References _partitions.
Referenced by renumberBulkIdsProperty().
|
private |
Definition at line 898 of file NodeWiseMeshPartitioner.cpp.
References _nodes_global_ids, and _partitions.
Referenced by partitionByMETIS().
|
inline |
Definition at line 101 of file NodeWiseMeshPartitioner.h.
References _nodes_partition_ids.
Referenced by main().
void ApplicationUtils::NodeWiseMeshPartitioner::write | ( | const std::string & | file_name_base | ) |
Write the partitions into binary files
file_name_base | The prefix of the file name. |
Definition at line 1230 of file NodeWiseMeshPartitioner.cpp.
References _nodes_global_ids, _partitioned_properties, _partitions, MeshLib::Cell, MeshLib::IntegrationPoint, MeshLib::Node, ApplicationUtils::writeConfigData(), ApplicationUtils::writeElements(), ApplicationUtils::writeNodes(), and ApplicationUtils::writeProperties().
Referenced by main().
void ApplicationUtils::NodeWiseMeshPartitioner::writeOtherMesh | ( | std::string const & | output_filename_base, |
std::vector< Partition > const & | partitions, | ||
MeshLib::Properties const & | partitioned_properties ) const |
Definition at line 1251 of file NodeWiseMeshPartitioner.cpp.
References _nodes_global_ids, MeshLib::Cell, MeshLib::Node, ApplicationUtils::writeConfigData(), ApplicationUtils::writeElements(), ApplicationUtils::writeNodes(), and ApplicationUtils::writeProperties().
Referenced by main().
|
private |
Pointer to a mesh object.
Definition at line 117 of file NodeWiseMeshPartitioner.h.
Referenced by mesh(), and partitionByMETIS().
|
private |
Global IDs of all nodes after partitioning.
Definition at line 120 of file NodeWiseMeshPartitioner.h.
Referenced by renumberNodeIndices(), write(), and writeOtherMesh().
|
private |
Partition IDs of each nodes.
Definition at line 123 of file NodeWiseMeshPartitioner.h.
Referenced by partitionByMETIS(), partitionOtherMesh(), and resetPartitionIdsForNodes().
|
private |
Properties where values at ghost nodes and extra nodes are inserted.
Definition at line 114 of file NodeWiseMeshPartitioner.h.
Referenced by partitionByMETIS(), and write().
|
private |
Data for all partitions.
Definition at line 111 of file NodeWiseMeshPartitioner.h.
Referenced by partitionByMETIS(), partitionOtherMesh(), renumberBulkElementIdsProperty(), renumberBulkNodeIdsProperty(), renumberNodeIndices(), and write().