|
Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website |
Mesh blocks: generated meshes, HDF5 mesh files. More...
#include "mesh_block.h"#include <algorithm>#include <cmath>#include <filesystem>#include <stdexcept>#include <Kokkos_Core.hpp>#include "comm.h"#include "input.h"#include "hdf5_util.h"Functions | |
| std::array< rtype, 2 > | wedge_node (rtype x, rtype y, rtype Ly) |
| Node (x, y) of the supersonic wedge mesh, moved from the box node (x, y). | |
| rtype | stretched_coordinate (uint32_t i, uint32_t n, rtype L, rtype beta) |
| Node i of n along a side of length L of a generated mesh, clustered toward both ends by the tanh stretching factor beta > 0: L / 2 (1 + tanh(beta (2 i / n - 1)) / tanh(beta)). | |
| Stretching | mesh_stretching (const toml::value &input) |
| [mesh] stretching: the tanh factor of each direction, 0 (uniform) if not given. | |
| MeshBlock | cartesian_2d_block (uint32_t nx, uint32_t ny, rtype Lx, rtype Ly, MeshType kind, int r, int p, const Stretching &stretching) |
| Part r of p of a generated 2D mesh (cartesian, cartesian_tri or wedge): near-equal blocks of its cells and nodes, numbered as Mesh::init_cart, init_cart_tri and init_wedge number them, and the boundary faces of those cells. | |
| std::array< uint64_t, 2 > | cartesian_3d_size (uint32_t nx, uint32_t ny, uint32_t nz, MeshType kind) |
| Total cell and node counts of a generated 3D box. | |
| MeshBlock | cartesian_3d_block (uint32_t nx, uint32_t ny, uint32_t nz, rtype Lx, rtype Ly, rtype Lz, MeshType kind, uint64_t first_cell, uint64_t end_cell, uint64_t first_node, uint64_t end_node, const Stretching &stretching) |
| A generated 3D box (see Mesh::init_cart_3d): the cells [first_cell, end_cell) and nodes [first_node, end_node) in the global numbering of the whole box, and the boundary faces of those cells. | |
| bool | is_hdf5_mesh (const std::string &filename) |
| Whether a mesh file name denotes an HDF5 mesh file (.h5 or .hdf5). | |
| MeshBlock | read_mesh_block (const toml::value &input) |
| This rank's block of the mesh described by the [mesh] table (collective): an HDF5 mesh file (.h5), a Gmsh file, or a generated mesh. Generated meshes number cells and nodes exactly as Mesh::init. A Gmsh file is read whole by every rank, so large meshes should be converted to HDF5 first. | |
| bool | have_hdf5 () |
| Whether this build reads and writes HDF5 mesh files. | |
| bool | have_parallel_hdf5 () |
| Whether several ranks can write one HDF5 mesh file together. | |
| void | write_mesh_h5 (const std::string &, const MeshBlock &) |
| Write the mesh whose blocks the ranks hold, in rank order, to an HDF5 mesh file (collective; several ranks need parallel HDF5). | |
| MeshBlock | read_mesh_h5 (const std::string &filename, bool) |
| Read this rank's block of an HDF5 mesh file (collective): cells, nodes and boundary faces split evenly in global order. With whole, this rank reads the whole file on its own (not collective). | |
Mesh blocks: generated meshes, HDF5 mesh files.
| MeshBlock cartesian_2d_block | ( | uint32_t | nx, |
| uint32_t | ny, | ||
| rtype | Lx, | ||
| rtype | Ly, | ||
| MeshType | kind, | ||
| int | r, | ||
| int | p, | ||
| const Stretching & | stretching | ||
| ) |
Part r of p of a generated 2D mesh (cartesian, cartesian_tri or wedge): near-equal blocks of its cells and nodes, numbered as Mesh::init_cart, init_cart_tri and init_wedge number them, and the boundary faces of those cells.
| MeshBlock cartesian_3d_block | ( | uint32_t | nx, |
| uint32_t | ny, | ||
| uint32_t | nz, | ||
| rtype | Lx, | ||
| rtype | Ly, | ||
| rtype | Lz, | ||
| MeshType | kind, | ||
| uint64_t | first_cell, | ||
| uint64_t | end_cell, | ||
| uint64_t | first_node, | ||
| uint64_t | end_node, | ||
| const Stretching & | stretching | ||
| ) |
A generated 3D box (see Mesh::init_cart_3d): the cells [first_cell, end_cell) and nodes [first_node, end_node) in the global numbering of the whole box, and the boundary faces of those cells.
| std::array< uint64_t, 2 > cartesian_3d_size | ( | uint32_t | nx, |
| uint32_t | ny, | ||
| uint32_t | nz, | ||
| MeshType | kind | ||
| ) |
Total cell and node counts of a generated 3D box.
| bool have_hdf5 | ( | ) |
Whether this build reads and writes HDF5 mesh files.
| bool have_parallel_hdf5 | ( | ) |
Whether several ranks can write one HDF5 mesh file together.
| bool is_hdf5_mesh | ( | const std::string & | filename | ) |
Whether a mesh file name denotes an HDF5 mesh file (.h5 or .hdf5).
| Stretching mesh_stretching | ( | const toml::value & | input | ) |
[mesh] stretching: the tanh factor of each direction, 0 (uniform) if not given.
This rank's block of the mesh described by the [mesh] table (collective): an HDF5 mesh file (.h5), a Gmsh file, or a generated mesh. Generated meshes number cells and nodes exactly as Mesh::init. A Gmsh file is read whole by every rank, so large meshes should be converted to HDF5 first.
| MeshBlock read_mesh_h5 | ( | const std::string & | filename, |
| bool | whole | ||
| ) |
Read this rank's block of an HDF5 mesh file (collective): cells, nodes and boundary faces split evenly in global order. With whole, this rank reads the whole file on its own (not collective).
Node i of n along a side of length L of a generated mesh, clustered toward both ends by the tanh stretching factor beta > 0: L / 2 (1 + tanh(beta (2 i / n - 1)) / tanh(beta)).
| std::array< rtype, 2 > wedge_node | ( | rtype | x, |
| rtype | y, | ||
| rtype | Ly | ||
| ) |
Node (x, y) of the supersonic wedge mesh, moved from the box node (x, y).
| void write_mesh_h5 | ( | const std::string & | filename, |
| const MeshBlock & | block | ||
| ) |
Write the mesh whose blocks the ranks hold, in rank order, to an HDF5 mesh file (collective; several ranks need parallel HDF5).