MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::MeshPart Class Reference

Class containing a minimal description of a part (a subset of the elements) of a Mesh and its connectivity to other parts. More...

#include <mesh.hpp>

Collaboration diagram for mfem::MeshPart:
[legend]

Classes

struct  Entity
 
struct  EntityHelper
 

Public Member Functions

void Print (std::ostream &os) const
 Write the MeshPart to a stream using the parallel format "MFEM mesh v1.2".
 
MeshGetMesh ()
 Construct a serial Mesh object from the MeshPart.
 

Public Attributes

int dimension
 Reference space dimension of the elements.
 
int space_dimension
 Dimension of the physical space into which the MeshPart is embedded.
 
int num_vertices
 Number of vertices.
 
int num_elements
 Number of elements with reference space dimension equal to 'dimension'.
 
int num_bdr_elements
 Number of boundary elements with reference space dimension equal to 'dimension'-1.
 
Array< int > entity_to_vertex [Geometry::NumGeom]
 
Array< int > tet_refine_flags
 Store the refinement flags for tetraheral elements. If all tets have zero refinement flags then this array is empty, i.e. has size 0.
 
Array< int > element_map
 
Array< int > boundary_map
 Optional re-ordering for the boundary elements, similar to 'element_map'.
 
Array< int > attributes
 
Array< int > bdr_attributes
 
Array< real_tvertex_coordinates
 
std::unique_ptr< Meshmesh
 
std::unique_ptr< FiniteElementSpacenodal_fes
 
std::unique_ptr< GridFunctionnodes
 
Connectivity to other MeshPart objects
int num_parts
 Total number of MeshParts.
 
int my_part_id
 Index of the part described by this MeshPart: 0 <= 'my_part_id' < 'num_parts'.
 
Table my_groups
 
Table group_shared_entity_to_vertex [Geometry::NumGeom]
 

Detailed Description

Class containing a minimal description of a part (a subset of the elements) of a Mesh and its connectivity to other parts.

The main purpose of this class is to facilitate the partitioning of serial meshes (in serial, i.e. on one processor) and save the parts in parallel MFEM mesh format.

Another potential futrure purpose of this class could be to facilitate exchange of MeshParts between MPI ranks for repartitioning purposes. It can also potentially be used to implement parallel mesh I/O functions with partitionings that have number of parts different from the number of MPI tasks.

Note
Parts of NURBS or non-conforming meshes cannot be fully described by this class alone with its current data members. Such extensions may be added in the future.

Definition at line 2478 of file mesh.hpp.

Member Function Documentation

◆ GetMesh()

Mesh & mfem::MeshPart::GetMesh ( )

Construct a serial Mesh object from the MeshPart.

The nodes of 'mesh' are NOT initialized by this method, however, the nodal FE space and nodal GridFunction can be created and then attached to the 'mesh'. The Mesh is constructed only if 'mesh' is empty, otherwise the method simply returns the object held by 'mesh'.

Definition at line 13518 of file mesh.cpp.

◆ Print()

void mfem::MeshPart::Print ( std::ostream & os) const

Write the MeshPart to a stream using the parallel format "MFEM mesh v1.2".

Definition at line 13338 of file mesh.cpp.

Member Data Documentation

◆ attributes

Array<int> mfem::MeshPart::attributes

Element attributes. Ordered using the "natural" element ordering defined by the array 'element_map'. The size of this array is 'num_elements'.

Definition at line 2561 of file mesh.hpp.

◆ bdr_attributes

Array<int> mfem::MeshPart::bdr_attributes

Boundary element attributes. Ordered using the "natural" boundary element ordering defined by the array 'boundary_map'. The size of this array is 'num_bdr_elements'.

Definition at line 2568 of file mesh.hpp.

◆ boundary_map

Array<int> mfem::MeshPart::boundary_map

Optional re-ordering for the boundary elements, similar to 'element_map'.

Definition at line 2555 of file mesh.hpp.

◆ dimension

int mfem::MeshPart::dimension

Reference space dimension of the elements.

Definition at line 2496 of file mesh.hpp.

◆ element_map

Array<int> mfem::MeshPart::element_map

Terminology: "by-type" element/boundary ordering: ordered by Geometry::Type and within each Geometry::Type 'geom' ordered as in 'entity_to_vertex[geom]'.

Optional re-ordering of the elements that will be used by (Par)Mesh objects constructed from this MeshPart. This array maps "natural" element ids (used by the Mesh/ParMesh objects) to "by-type" element ids (see above):

"by-type" element id = element_map["natural" element id]

The size of the array is either 'num_elements' or 0 when no re-ordering is needed (then "by-type" id == "natural" id).

Definition at line 2552 of file mesh.hpp.

◆ entity_to_vertex

Array<int> mfem::MeshPart::entity_to_vertex[Geometry::NumGeom]

Each 'entity_to_vertex[geom]' describes the entities of Geometry::Type 'geom' in terms of their vertices. The number of entities of type 'geom' is:

num_entities[geom] = size('entity_to_vertex[geom]')/num_vertices[geom]

The number of all elements, 'num_elements', is:

'num_elements' = sum_{dim[geom]=='dimension'} num_entities[geom]

and the number of all boundary elements, 'num_bdr_elements' is:

'num_bdr_elements' = sum_{dim[geom]=='dimension'-1} num_entities[geom]

Note that 'entity_to_vertex' does NOT describe all "faces" in the mesh part (i.e. all 'dimension'-1 entities) but only the boundary elements. Also, note that lower dimesional entities ('dimension'-2 and lower) are NOT described by the respective array, i.e. the array will be empty.

Definition at line 2531 of file mesh.hpp.

◆ group_shared_entity_to_vertex

Table mfem::MeshPart::group_shared_entity_to_vertex[Geometry::NumGeom]

Shared entities for this MeshPart are mesh entities of all dimensions less than 'dimension' that are generated by the elements of this MeshPart and at least one other MeshPart.

The Table 'group_shared_entity_to_vertex[geom]' defines, for each group, the shared entities of Geometry::Type 'geom'. Each row (corresponding to a "neighbor" group, as defined by 'my_groups') in the Table defines the shared entities in a way similar to the arrays 'entity_to_vertex[geom]'. The "local" group (with index 0) does not have any shared entities, so the 0-th row in the Table is always empty.

IMPORTANT: the descriptions of the groups in this MeshPart must match their descriptions in all neighboring MeshParts. This includes the ordering of the shared entities within the group, as well as the vertex ordering of each shared entity.

Definition at line 2642 of file mesh.hpp.

◆ mesh

std::unique_ptr<Mesh> mfem::MeshPart::mesh

Optional serial Mesh object constructed on demand using the method GetMesh(). One use case for it is when one wants to construct FE spaces and GridFunctions on the MeshPart for saving or MPI communication.

Definition at line 2586 of file mesh.hpp.

◆ my_groups

Table mfem::MeshPart::my_groups

A group G is a subset of the set { 0, 1, ..., 'num_parts'-1 } for which there is a mesh entity E (of any dimension) in the global mesh such that G is the set of the parts assigned (by the partitioning array) to the elements adjacent to E. The MeshPart describes only the "neighbor" groups, i.e. the groups that contain 'my_part_id'. The Table 'my_groups' defines the "neighbor" groups in terms of their part ids. In other words, it maps "neighbor" group ids to a (sorted) list of part ids. In particular, the number of "neighbor" groups is given by 'my_groups.Size()'. The "local" group { 'my_part_id' } has index 0 in 'my_groups'.

Definition at line 2623 of file mesh.hpp.

◆ my_part_id

int mfem::MeshPart::my_part_id

Index of the part described by this MeshPart: 0 <= 'my_part_id' < 'num_parts'.

Definition at line 2610 of file mesh.hpp.

◆ nodal_fes

std::unique_ptr<FiniteElementSpace> mfem::MeshPart::nodal_fes

Nodal FE space defined on 'mesh' used by the GridFunction 'nodes'. Uses the FE collection from the global nodal FE space.

Definition at line 2592 of file mesh.hpp.

◆ nodes

std::unique_ptr<GridFunction> mfem::MeshPart::nodes

'nodes': pointer to a GridFunction describing the physical location of the MeshPart. Used for describing high-order and periodic meshes. This GridFunction is defined on the FE space 'nodal_fes' which, in turn, is defined on the Mesh 'mesh'.

Definition at line 2600 of file mesh.hpp.

◆ num_bdr_elements

int mfem::MeshPart::num_bdr_elements

Number of boundary elements with reference space dimension equal to 'dimension'-1.

Definition at line 2509 of file mesh.hpp.

◆ num_elements

int mfem::MeshPart::num_elements

Number of elements with reference space dimension equal to 'dimension'.

Definition at line 2505 of file mesh.hpp.

◆ num_parts

int mfem::MeshPart::num_parts

Total number of MeshParts.

Definition at line 2606 of file mesh.hpp.

◆ num_vertices

int mfem::MeshPart::num_vertices

Number of vertices.

Definition at line 2502 of file mesh.hpp.

◆ space_dimension

int mfem::MeshPart::space_dimension

Dimension of the physical space into which the MeshPart is embedded.

Definition at line 2499 of file mesh.hpp.

◆ tet_refine_flags

Array<int> mfem::MeshPart::tet_refine_flags

Store the refinement flags for tetraheral elements. If all tets have zero refinement flags then this array is empty, i.e. has size 0.

Definition at line 2535 of file mesh.hpp.

◆ vertex_coordinates

Array<real_t> mfem::MeshPart::vertex_coordinates

Optional vertex coordinates. The size of the array is either

size = 'space_dimension' * 'num_vertices'

or 0 when the vertex coordinates are not used, i.e. when the MeshPart uses a nodal GridFunction to describe its location in physical space. This array uses Ordering::byVDIM: "X0,Y0,Z0, X1,Y1,Z1, ...".

Definition at line 2579 of file mesh.hpp.


The documentation for this class was generated from the following files: