Mesh data structures and geometry definitions for hexahedral grids.
This module defines the core topological and geometric entities used by the finite-volume solver. The solver is specifically designed for hexahedral cells (8 nodes, 6 faces), and these structures encapsulate all necessary connectivity and metric information (volumes, areas, normals).
The mesh hierarchy is structured to support efficient flux-based computations:
cell_t: Holds volumetric data and node connectivity. It represents
the primary control volume.face_t: The fundamental entity for flux evaluation. Manages
owner/neighbor relationships and boundary associations.patch_t: Groups faces into named boundary regions (e.g., "Inlet",
"Outlet") for application of Boundary Conditions.mesh_t: The global container for all nodes, cells, and faces.Gmsh Hexahedron Node Ordering (8-node):
7 --------- 6
/| /|
4 --------- 5 |
| | | |
| 3 --------| 2
|/ |/
0 --------- 1
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | max_cell_faces | = | 6 |
Maximum number of faces per cell. Fixed at 6 for hexahedral meshes. |
Hexahedral cell data structure. Contains local geometric properties and node-based connectivity.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=rk), | public | :: | center(3) | = | zero | ||
| integer, | public | :: | id | = | 0 | ||
| integer, | public | :: | nodes(8) | = | 0 | ||
| real(kind=rk), | public | :: | volume | = | zero |
Mesh face data structure. Faces are the primary entities for flux calculation. Each face is associated with an 'owner' and potentially a 'neighbor' cell.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=rk), | public | :: | area | = | zero | ||
| real(kind=rk), | public | :: | center(3) | = | zero | ||
| integer, | public | :: | id | = | 0 | ||
| integer, | public | :: | neighbor | = | 0 | ||
| real(kind=rk), | public | :: | normal(3) | = | zero | ||
| integer, | public | :: | owner | = | 0 | ||
| integer, | public | :: | patch | = | 0 | ||
| integer, | public | :: | periodic_face | = | 0 | ||
| integer, | public | :: | periodic_neighbor | = | 0 |
Top-level mesh container. This structure holds all geometric data and connectivity arrays for the entire computational domain.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | allocatable | :: | cell_faces(:,:) | |||
| type(cell_t), | public, | allocatable | :: | cells(:) | |||
| type(face_t), | public, | allocatable | :: | faces(:) | |||
| integer, | public, | allocatable | :: | ncell_faces(:) | |||
| integer, | public | :: | ncells | = | 0 | ||
| integer, | public | :: | nfaces | = | 0 | ||
| integer, | public | :: | npatches | = | 0 | ||
| integer, | public | :: | npoints | = | 0 | ||
| type(patch_t), | public, | allocatable | :: | patches(:) | |||
| real(kind=rk), | public, | allocatable | :: | points(:,:) |
Boundary patch data structure. Patches group faces together to allow bulk application of boundary conditions (e.g., all faces in the "inlet" patch).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | allocatable | :: | face_ids(:) | |||
| integer, | public | :: | id | = | 0 | ||
| character(len=name_len), | public | :: | name | = | "" | ||
| integer, | public | :: | nfaces | = | 0 |
Safely deallocates all heap-allocated arrays in the mesh structure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(inout) | :: | m |
The mesh object to be cleared. |