|
Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website |
High-order TENO-E reconstruction on unstructured meshes (Liang, Shyy & Fu, J. Sci. Comput. 104:1, 2025; see docs/numerics/teno_e.md). More...
#include <face_reconstruction.h>
Classes | |
| struct | Stencils |
| Stencil cells and mirror faces of every reconstructed cell, row by row (host copy, for diagnostics). More... | |
Public Member Functions | |
| TENO () | |
| ~TENO () | |
| void | init (const toml::value &input) override |
| Initialize the face reconstruction. | |
| logging::Items | summary () const override |
| Display lines for the run log. | |
| uint8_t | n_face_quadrature_points () const override |
| Get the number of quadrature points per face. | |
| void | calc_face_values (Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution) override |
| Reconstruct the face values. | |
| std::vector< uint32_t > | cells_independent_of_halo (uint32_t n_owned) const override |
| Cells below n_owned whose reconstruction reads no cell at or above n_owned, so that calc_cell_face_values can reconstruct them before the halo is filled. Empty if this reconstruction cannot be split by cells. | |
| void | calc_cell_face_values (const Kokkos::DefaultExecutionSpace &exec, Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution, Kokkos::View< uint32_t * > cells) override |
| Reconstruct the listed cells' sides of their faces, on the given execution space instance, as far as each cell can on its own (see cells_independent_of_halo()). Once every reconstructed cell went through this and those instances are fenced, finish_cell_face_values() completes the face values. | |
| void | finish_cell_face_values (Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution) override |
| Complete the face values after calc_cell_face_values(). | |
| bool | cell_gradients (Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype *[N_CONSERVATIVE][N_DIM]> gradients, uint32_t n_cells) override |
| Gradients of W = [rho, u, p] at the centroids of the first n_cells cells from the reconstruction polynomials, if the scheme has higher-order ones than least squares on face neighbors. | |
| void | axisymmetric_source (Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype *, Kokkos::LayoutStride > mu, Kokkos::View< rtype * > source, uint32_t n_cells) override |
| Axisymmetric runs: for each of the first n_cells cells whose reconstruction has a smooth polynomial, replace source(c) by int (p - tau_thetatheta) dA over the planar cell, with p and the velocity of the polynomial at cell quadrature points and the cell viscosity mu(c) (inviscid if mu is empty). Other cells keep their source, which the caller set from cell values. | |
| Stencils | large_stencils () const |
| std::vector< uint8_t > | stencil_cells () const |
| Local cells that some stencil (central or sector) of a reconstructed cell reads. | |
| std::array< double, 9 > | stencil_metric (uint32_t i) const |
| Metric (3 x 3, row-major) in which the stencil candidates of cell i are ranked by distance (3D): the identity unless the mesh spacing around the cell is markedly anisotropic. | |
| void | save_cache (uint8_t halo_layers=0) |
| Write the precomputed data to the cache file, unless init() loaded it from there. A distributed run calls this once its halo is final, with its halo layers. | |
| void | rebuild_cells (const std::vector< uint32_t > &cells) |
| Recompute the tables of the given reconstructed cells and keep every other cell's, after the mesh geometry changed (node coordinates moved, geometry recomputed and on the device). Each cell's tables are a function of the mesh alone, so with the cells of cells_within_reach() the result is bitwise that of a full setup. | |
| std::vector< uint32_t > | cells_within_reach (const std::vector< uint32_t > &changed) const |
| Reconstructed cells whose stencil searches reach any of the given cells (within their gather_depth vertex-neighbor layers), i.e. whose tables depend on those cells' geometry. | |
| void | set_mixture (Kokkos::View< rtype *, Kokkos::LayoutStride > gamma, Kokkos::View< rtype * > molar_mass) |
| Switch to the mixture variant with these per-cell views (filled every stage). | |
Public Member Functions inherited from FaceReconstruction | |
| FaceReconstruction () | |
| Construct a new Face Reconstruction object. | |
| virtual | ~FaceReconstruction () |
| Destroy the Face Reconstruction object. | |
| void | set_mesh (std::shared_ptr< Mesh > mesh) |
| Set the mesh. | |
| void | set_boundaries (const BoundaryData &boundaries) |
| Set the boundary data used for ghost states. | |
| FaceReconstructionType | get_type () const |
| Get the face reconstruction type. | |
| void | init_face_quadrature_3d (uint8_t degree) |
| Set up per-face quadrature (3D): Dunavant rules on triangles and Gauss rules mapped bilinearly onto quadrilaterals, exact for polynomials of the given degree on planar faces (degree <= 1 uses the face centroid). Also maps each quadrature point of a transmissive boundary face to the matching point of its image face (BoundaryData::face_image_quad). | |
| void | init_face_quadrature_2d_curved () |
| Curved meshes in 2D: per-face quadrature points, weights and normals for quadrature_face's Gauss rule on every face, the curved faces' mapped onto their curves (nothing otherwise). | |
Static Public Member Functions | |
| static uint8_t | cached_halo_layers (const toml::value &input) |
| Halo layers recorded in this rank's cache file (0 if there is none, or it was made with other TENO options or rank count), so a distributed run can build its halo at that depth at once. | |
Static Public Attributes | |
| static constexpr uint8_t | SELECT_LARGE = 0xFF |
Additional Inherited Members | |
Protected Attributes inherited from FaceReconstruction | |
| FaceReconstructionType | type |
| std::shared_ptr< Mesh > | mesh |
| BoundaryData | boundaries |
High-order TENO-E reconstruction on unstructured meshes (Liang, Shyy & Fu, J. Sci. Comput. 104:1, 2025; see docs/numerics/teno_e.md).
Each cell carries one large central stencil (degree r) and one small degree-2 sector stencil per face. Cells flagged smooth by a density-based indicator use the large-stencil polynomial directly on the conservative variables; troubled cells perform TENO stencil selection on characteristic variables per face. Works on triangles and quadrilaterals.
| TENO::TENO | ( | ) |
| TENO::~TENO | ( | ) |
|
overridevirtual |
Axisymmetric runs: for each of the first n_cells cells whose reconstruction has a smooth polynomial, replace source(c) by int (p - tau_thetatheta) dA over the planar cell, with p and the velocity of the polynomial at cell quadrature points and the cell viscosity mu(c) (inviscid if mu is empty). Other cells keep their source, which the caller set from cell values.
Reimplemented from FaceReconstruction.
Halo layers recorded in this rank's cache file (0 if there is none, or it was made with other TENO options or rank count), so a distributed run can build its halo at that depth at once.
|
overridevirtual |
Reconstruct the listed cells' sides of their faces, on the given execution space instance, as far as each cell can on its own (see cells_independent_of_halo()). Once every reconstructed cell went through this and those instances are fenced, finish_cell_face_values() completes the face values.
| exec | Execution space instance to launch on. |
| solution | Cell states W = [rho, u_x, u_y, p]. |
| face_solution | Face states W, as in calc_face_values. |
| cells | Local cells to reconstruct (not empty). |
Reimplemented from FaceReconstruction.
|
overridevirtual |
Reconstruct the face values.
| solution | Cell states W = [rho, u_x, u_y, p]. |
| face_solution | Face states W, indexed (face, quadrature point, side, variable). Side 1 of boundary faces is left untouched. |
Implements FaceReconstruction.
|
overridevirtual |
Gradients of W = [rho, u, p] at the centroids of the first n_cells cells from the reconstruction polynomials, if the scheme has higher-order ones than least squares on face neighbors.
Reimplemented from FaceReconstruction.
Cells below n_owned whose reconstruction reads no cell at or above n_owned, so that calc_cell_face_values can reconstruct them before the halo is filled. Empty if this reconstruction cannot be split by cells.
Reimplemented from FaceReconstruction.
Reconstructed cells whose stencil searches reach any of the given cells (within their gather_depth vertex-neighbor layers), i.e. whose tables depend on those cells' geometry.
|
overridevirtual |
Complete the face values after calc_cell_face_values().
Reimplemented from FaceReconstruction.
Initialize the face reconstruction.
Implements FaceReconstruction.
| TENO::Stencils TENO::large_stencils | ( | ) | const |
|
overridevirtual |
Get the number of quadrature points per face.
Implements FaceReconstruction.
Recompute the tables of the given reconstructed cells and keep every other cell's, after the mesh geometry changed (node coordinates moved, geometry recomputed and on the device). Each cell's tables are a function of the mesh alone, so with the cells of cells_within_reach() the result is bitwise that of a full setup.
Write the precomputed data to the cache file, unless init() loaded it from there. A distributed run calls this once its halo is final, with its halo layers.
| void TENO::set_mixture | ( | Kokkos::View< rtype *, Kokkos::LayoutStride > | gamma, |
| Kokkos::View< rtype * > | molar_mass | ||
| ) |
Switch to the mixture variant with these per-cell views (filled every stage).
| std::vector< uint8_t > TENO::stencil_cells | ( | ) | const |
Local cells that some stencil (central or sector) of a reconstructed cell reads.
Metric (3 x 3, row-major) in which the stencil candidates of cell i are ranked by distance (3D): the identity unless the mesh spacing around the cell is markedly anisotropic.
|
overridevirtual |
Display lines for the run log.
Reimplemented from FaceReconstruction.
| Kokkos::View<rtype **> TENO::basis_mean |
| rtype TENO::C_T = -1.0 |
| Kokkos::View<rtype *, Kokkos::LayoutStride> TENO::cell_gamma |
| Kokkos::View<rtype *> TENO::cell_molar_mass |
| Kokkos::View<rtype *[3]> TENO::cell_rule |
| uint8_t TENO::curved_wall_degree = 3 |
| uint8_t TENO::degree = 4 |
| std::vector<uint8_t> TENO::gather_depth |
| rtype TENO::max_condition = 1.0e8 |
| teno::Moments TENO::moments |
| uint8_t TENO::n_dof_large = 0 |
| uint16_t TENO::n_stencil_large = 0 |
| uint16_t TENO::n_stencil_small = 10 |
| Kokkos::View<uint32_t> TENO::n_troubled |
| Kokkos::View<rtype *> TENO::scale |
| Kokkos::View<uint8_t **> TENO::selection |
| uint32_t TENO::setup_batch_cells = 0 |
| Kokkos::View<rtype **> TENO::si_matrix |
| teno::SmoothnessTerms TENO::si_terms |
| uint8_t TENO::slice_shift = teno::SLICE_SHIFT |
| rtype TENO::stencil_factor = 2.0 |
| teno::PackedStencils TENO::stencil_large |
| Kokkos::View<uint16_t *> TENO::stencil_large_size |
| teno::PackedStencils TENO::stencil_small |
| Kokkos::View<uint16_t **> TENO::stencil_small_size |
| std::vector<std::shared_ptr<GrowingBuffer> > TENO::table_memory |
| Kokkos::View<rtype *> TENO::troubled |
| Kokkos::View<uint32_t *> TENO::troubled_cells |
| Kokkos::View<rtype ***> TENO::troubled_coeffs |
| Kokkos::View<rtype ****> TENO::troubled_small_coeffs |