Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
mesh_3d.cpp File Reference

3D mesh construction and geometry. More...

#include "mesh.h"
#include "mesh_block.h"
#include <algorithm>
#include <cmath>
#include <map>
#include <stdexcept>

Functions

const std::vector< std::vector< uint8_t > > & cell_local_faces (uint32_t n_nodes)
 Local faces of a positively oriented 3D cell with n_nodes nodes (4 tetrahedron, 5 pyramid, 6 prism, 8 hexahedron; Gmsh/VTK node order), each ordered so its right-hand normal points out of the cell.
 
void cell_tetrahedra (const std::vector< std::array< double, 3 > > &nodes, std::vector< std::array< std::array< double, 3 >, 4 > > &tets)
 Decompose a 3D cell (node coordinates in Gmsh/VTK order, positively oriented) into tetrahedra: each face is fanned around its vertex average and joined to the cell's vertex average. This is the decomposition that defines the mesh's cell volumes and centroids.
 

Detailed Description

3D mesh construction and geometry.

Author
Matthew Bonanni (mbona.nosp@m.nni0.nosp@m.01@gm.nosp@m.ail..nosp@m.com)
Version
0.1
Date
2026-10-02

Function Documentation

◆ cell_local_faces()

const std::vector< std::vector< uint8_t > > & cell_local_faces ( uint32_t  n_nodes)

Local faces of a positively oriented 3D cell with n_nodes nodes (4 tetrahedron, 5 pyramid, 6 prism, 8 hexahedron; Gmsh/VTK node order), each ordered so its right-hand normal points out of the cell.

◆ cell_tetrahedra()

void cell_tetrahedra ( const std::vector< std::array< double, 3 > > &  nodes,
std::vector< std::array< std::array< double, 3 >, 4 > > &  tets 
)

Decompose a 3D cell (node coordinates in Gmsh/VTK order, positively oriented) into tetrahedra: each face is fanned around its vertex average and joined to the cell's vertex average. This is the decomposition that defines the mesh's cell volumes and centroids.