MFEM v4.7.0
Finite element discretization library
|
Class that allows serial meshes to be partitioned into MeshPart objects, typically one MeshPart at a time, which can then be used to write the local mesh in parallel MFEM mesh format. More...
#include <mesh.hpp>
Public Member Functions | |
MeshPartitioner (Mesh &mesh_, int num_parts_, int *partitioning_=NULL, int part_method=1) | |
Construct a MeshPartitioner. | |
void | ExtractPart (int part_id, MeshPart &mesh_part) const |
Construct a MeshPart corresponding to the given part_id. | |
std::unique_ptr< FiniteElementSpace > | ExtractFESpace (MeshPart &mesh_part, const FiniteElementSpace &global_fespace) const |
Construct a local version of the given FiniteElementSpace global_fespace corresponding to the given mesh_part. | |
std::unique_ptr< GridFunction > | ExtractGridFunction (const MeshPart &mesh_part, const GridFunction &global_gf, FiniteElementSpace &local_fespace) const |
Construct a local version of the given GridFunction, global_gf, corresponding to the given mesh_part. The respective data is copied from global_gf to the returned local GridFunction. | |
Protected Attributes | |
Mesh & | mesh |
Array< int > | partitioning |
Table | part_to_element |
Table | part_to_boundary |
Table | edge_to_element |
Table | vertex_to_element |
Class that allows serial meshes to be partitioned into MeshPart objects, typically one MeshPart at a time, which can then be used to write the local mesh in parallel MFEM mesh format.
Sample usage of this class: partition a serial mesh and save it in parallel MFEM format:
This class can also be used to partition a mesh and GridFunction(s) and save them in parallel:
mfem::MeshPartitioner::MeshPartitioner | ( | Mesh & | mesh_, |
int | num_parts_, | ||
int * | partitioning_ = NULL, | ||
int | part_method = 1 ) |
Construct a MeshPartitioner.
[in] | mesh_ | Mesh to be partitioned into MeshParts. |
[in] | num_parts_ | Number of parts to partition the mesh into. |
[in] | partitioning_ | Partitioning array: for every element in the mesh gives the partition it belongs to; if NULL, partitioning will be generated internally by calling Mesh::GeneratePartitioning(). |
[in] | part_method | Partitioning method to be used in the call to Mesh::GeneratePartitioning() when the provided input partitioning is NULL. |
std::unique_ptr< FiniteElementSpace > mfem::MeshPartitioner::ExtractFESpace | ( | MeshPart & | mesh_part, |
const FiniteElementSpace & | global_fespace ) const |
Construct a local version of the given FiniteElementSpace global_fespace corresponding to the given mesh_part.
[in,out] | mesh_part | MeshPart on which to construct the local FiniteElementSpace; this object is generally modified by this call since it calls mesh_part.GetMesh() to ensure the local mesh is constructed. |
[in] | global_fespace | The global FiniteElementSpace that should be restricted to the mesh_part. |
std::unique_ptr< GridFunction > mfem::MeshPartitioner::ExtractGridFunction | ( | const MeshPart & | mesh_part, |
const GridFunction & | global_gf, | ||
FiniteElementSpace & | local_fespace ) const |
Construct a local version of the given GridFunction, global_gf, corresponding to the given mesh_part. The respective data is copied from global_gf to the returned local GridFunction.
[in] | mesh_part | MeshPart on which to construct the local GridFunction. |
[in] | global_gf | The global GridFunction that should be restricted to the mesh_part. |
[in,out] | local_fespace | The local FiniteElementSpace corresponding to mesh_part, e.g. constructed by the method ExtractFESpace(). |
void mfem::MeshPartitioner::ExtractPart | ( | int | part_id, |
MeshPart & | mesh_part ) const |