mod_mesh_types Module

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:

  1. cell_t: Holds volumetric data and node connectivity. It represents the primary control volume.
  2. face_t: The fundamental entity for flux evaluation. Manages owner/neighbor relationships and boundary associations.
  3. patch_t: Groups faces into named boundary regions (e.g., "Inlet", "Outlet") for application of Boundary Conditions.
  4. 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

Uses

  • module~~mod_mesh_types~~UsesGraph module~mod_mesh_types mod_mesh_types module~mod_kinds mod_kinds module~mod_mesh_types->module~mod_kinds iso_fortran_env iso_fortran_env module~mod_kinds->iso_fortran_env

Used by

  • module~~mod_mesh_types~~UsedByGraph module~mod_mesh_types mod_mesh_types module~mod_bc mod_bc module~mod_bc->module~mod_mesh_types module~mod_energy mod_energy module~mod_energy->module~mod_mesh_types module~mod_energy->module~mod_bc module~mod_fields mod_fields module~mod_energy->module~mod_fields module~mod_mpi_flow mod_mpi_flow module~mod_energy->module~mod_mpi_flow module~mod_fields->module~mod_mesh_types module~mod_fields->module~mod_bc module~mod_flow_projection mod_flow_projection module~mod_flow_projection->module~mod_mesh_types module~mod_flow_projection->module~mod_bc module~mod_flow_projection->module~mod_fields module~mod_flow_projection->module~mod_mpi_flow module~mod_transport_properties mod_transport_properties module~mod_flow_projection->module~mod_transport_properties module~mod_mesh_io mod_mesh_io module~mod_mesh_io->module~mod_mesh_types module~mod_mpi_flow->module~mod_mesh_types module~mod_output mod_output module~mod_output->module~mod_mesh_types module~mod_output->module~mod_energy module~mod_output->module~mod_fields module~mod_output->module~mod_flow_projection module~mod_output->module~mod_mpi_flow module~mod_species mod_species module~mod_output->module~mod_species module~mod_output->module~mod_transport_properties module~mod_species->module~mod_mesh_types module~mod_species->module~mod_bc module~mod_species->module~mod_fields module~mod_species->module~mod_flow_projection module~mod_species->module~mod_mpi_flow module~mod_species->module~mod_transport_properties module~mod_transport_properties->module~mod_mesh_types module~mod_transport_properties->module~mod_mpi_flow program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->module~mod_mesh_types program~lowmach_react_hex->module~mod_bc program~lowmach_react_hex->module~mod_energy program~lowmach_react_hex->module~mod_fields program~lowmach_react_hex->module~mod_flow_projection program~lowmach_react_hex->module~mod_mesh_io program~lowmach_react_hex->module~mod_mpi_flow program~lowmach_react_hex->module~mod_output program~lowmach_react_hex->module~mod_species program~lowmach_react_hex->module~mod_transport_properties

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: max_cell_faces = 6

Maximum number of faces per cell. Fixed at 6 for hexahedral meshes.


Derived Types

type, public ::  cell_t

Hexahedral cell data structure. Contains local geometric properties and node-based connectivity.

Components

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

type, public ::  face_t

Mesh face data structure. Faces are the primary entities for flux calculation. Each face is associated with an 'owner' and potentially a 'neighbor' cell.

Components

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

type, public ::  mesh_t

Top-level mesh container. This structure holds all geometric data and connectivity arrays for the entire computational domain.

Components

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(:,:)

type, public ::  patch_t

Boundary patch data structure. Patches group faces together to allow bulk application of boundary conditions (e.g., all faces in the "inlet" patch).

Components

Type Visibility Attributes Name Initial
integer, public, allocatable :: face_ids(:)
integer, public :: id = 0
character(len=name_len), public :: name = ""
integer, public :: nfaces = 0

Subroutines

public subroutine mesh_finalize(m)

Safely deallocates all heap-allocated arrays in the mesh structure.

Read more…

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(inout) :: m

The mesh object to be cleared.