OGS
|
Mesh partitioner.
Definition at line 58 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 (const bool is_mixed_high_order_linear_elems) |
std::vector< Partition > | partitionOtherMesh (MeshLib::Mesh const &mesh, bool const is_mixed_high_order_linear_elems) const |
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 |
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 (const bool is_mixed_high_order_linear_elems) |
void | processPartition (std::size_t const part_id, const bool is_mixed_high_order_linear_elems) |
Private Attributes | |
std::vector< Partition > | _partitions |
Data for all partitions. More... | |
MeshLib::Properties | _partitioned_properties |
Properties where values at ghost nodes and extra nodes are inserted. More... | |
std::unique_ptr< MeshLib::Mesh > | _mesh |
Pointer to a mesh object. More... | |
std::vector< std::size_t > | _nodes_global_ids |
Global IDs of all nodes after partitioning. More... | |
std::vector< std::size_t > | _nodes_partition_ids |
Partition IDs of each nodes. More... | |
Definition at line 61 of file NodeWiseMeshPartitioner.h.
|
inline |
num_partitions | Number of partitions, |
mesh | Pointer to a mesh object. |
Definition at line 68 of file NodeWiseMeshPartitioner.h.
|
inline |
Definition at line 115 of file NodeWiseMeshPartitioner.h.
References _mesh.
Referenced by MeshLib::addPropertyToMesh(), MeshLib::getOrCreateMeshProperty(), main(), and partitionOtherMesh().
void ApplicationUtils::NodeWiseMeshPartitioner::partitionByMETIS | ( | const bool | is_mixed_high_order_linear_elems | ) |
Partition by node.
is_mixed_high_order_linear_elems | Flag to indicate whether the elements of a mesh can be used for both linear and high order interpolation |
Definition at line 547 of file NodeWiseMeshPartitioner.cpp.
References _mesh, _partitioned_properties, _partitions, INFO(), ApplicationUtils::markDuplicateGhostCells(), ApplicationUtils::partitionProperties(), processPartition(), and renumberNodeIndices().
Referenced by main().
std::vector< Partition > ApplicationUtils::NodeWiseMeshPartitioner::partitionOtherMesh | ( | MeshLib::Mesh const & | mesh, |
bool const | is_mixed_high_order_linear_elems | ||
) | const |
Definition at line 664 of file NodeWiseMeshPartitioner.cpp.
References _nodes_partition_ids, _partitions, MathLib::LinAlg::copy(), ApplicationUtils::findElementsInPartition(), ApplicationUtils::findGhostNodesInPartition(), ApplicationUtils::findRegularNodesInPartition(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNodes(), MeshLib::Mesh::getNumberOfBaseNodes(), MeshLib::Mesh::getNumberOfNodes(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), INFO(), ApplicationUtils::markDuplicateGhostCells(), mesh(), and MeshLib::Node.
Referenced by main().
|
private |
Definition at line 274 of file NodeWiseMeshPartitioner.cpp.
References _mesh, _nodes_partition_ids, _partitions, MathLib::LinAlg::copy(), ApplicationUtils::findElementsInPartition(), ApplicationUtils::findGhostNodesInPartition(), and ApplicationUtils::findRegularNodesInPartition().
Referenced by partitionByMETIS().
void ApplicationUtils::NodeWiseMeshPartitioner::renumberBulkElementIdsProperty | ( | MeshLib::PropertyVector< std::size_t > *const | bulk_element_ids_pv, |
std::vector< Partition > const & | local_partitions | ||
) | const |
Renumber the bulk_element_ids property for each partition to match the partitioned bulk mesh elements.
Definition at line 606 of file NodeWiseMeshPartitioner.cpp.
References _partitions.
Referenced by main().
void ApplicationUtils::NodeWiseMeshPartitioner::renumberBulkNodeIdsProperty | ( | MeshLib::PropertyVector< std::size_t > *const | bulk_node_ids, |
std::vector< Partition > const & | local_partitions | ||
) | const |
Renumber the bulk_node_ids property for each partition to match the partitioned bulk mesh nodes.
Definition at line 564 of file NodeWiseMeshPartitioner.cpp.
References _partitions.
Referenced by main().
|
private |
is_mixed_high_order_linear_elems | Flag to indicate whether the elements of a mesh can be used for both linear and high order interpolation |
Definition at line 724 of file NodeWiseMeshPartitioner.cpp.
References _nodes_global_ids, and _partitions.
Referenced by partitionByMETIS().
|
inline |
Definition at line 109 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 1078 of file NodeWiseMeshPartitioner.cpp.
References _nodes_global_ids, _partitioned_properties, _partitions, MeshLib::Cell, 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 1097 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 125 of file NodeWiseMeshPartitioner.h.
Referenced by mesh(), partitionByMETIS(), and processPartition().
|
private |
Global IDs of all nodes after partitioning.
Definition at line 128 of file NodeWiseMeshPartitioner.h.
Referenced by renumberNodeIndices(), write(), and writeOtherMesh().
|
private |
Partition IDs of each nodes.
Definition at line 131 of file NodeWiseMeshPartitioner.h.
Referenced by partitionOtherMesh(), processPartition(), and resetPartitionIdsForNodes().
|
private |
Properties where values at ghost nodes and extra nodes are inserted.
Definition at line 122 of file NodeWiseMeshPartitioner.h.
Referenced by partitionByMETIS(), and write().
|
private |
Data for all partitions.
Definition at line 119 of file NodeWiseMeshPartitioner.h.
Referenced by partitionByMETIS(), partitionOtherMesh(), processPartition(), renumberBulkElementIdsProperty(), renumberBulkNodeIdsProperty(), renumberNodeIndices(), and write().