Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
face_reconstruction.h
Go to the documentation of this file.
1
12#ifndef FACE_RECONSTRUCTION_H
13#define FACE_RECONSTRUCTION_H
14
15#include <array>
16#include <memory>
17#include <unordered_map>
18#include <vector>
19
20#include <toml.hpp>
21
22#include "common_typedef.h"
23#include "mesh.h"
24#include "quadrature.h"
25#include "boundary.h"
26#include "gradient.h"
27#include "log.h"
28#include "teno.h"
29
32 MUSCL,
33 TENO,
34};
35
36static const std::unordered_map<std::string, FaceReconstructionType> FACE_RECONSTRUCTION_TYPES = {
40};
41
42static const std::unordered_map<FaceReconstructionType, std::string> FACE_RECONSTRUCTION_NAMES = {
46};
47
51class GrowingBuffer;
52
54 public:
59
63 virtual ~FaceReconstruction();
64
68 virtual void init(const toml::value & input) = 0;
69
73 virtual logging::Items summary() const;
74
79 void set_mesh(std::shared_ptr<Mesh> mesh);
80
86
92
97 virtual uint8_t n_face_quadrature_points() const = 0;
98
105 virtual void calc_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
106 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution) = 0;
107
114 virtual std::vector<uint32_t> cells_independent_of_halo(uint32_t n_owned) const;
115
127 virtual void calc_cell_face_values(const Kokkos::DefaultExecutionSpace & exec,
128 Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
129 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution,
130 Kokkos::View<uint32_t *> cells);
131
133 virtual void finish_cell_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
134 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution);
135
142 virtual bool cell_gradients(Kokkos::View<rtype *[N_CONSERVATIVE]> /*solution*/,
143 Kokkos::View<rtype *[N_CONSERVATIVE][N_DIM]> /*gradients*/,
144 uint32_t /*n_cells*/) {
145 return false;
146 }
147
156 virtual void axisymmetric_source(Kokkos::View<rtype *[N_CONSERVATIVE]> /*solution*/,
157 Kokkos::View<rtype *, Kokkos::LayoutStride> /*mu*/,
158 Kokkos::View<rtype *> /*source*/, uint32_t /*n_cells*/) {}
159
169 void init_face_quadrature_3d(uint8_t degree);
170
177
179 // 3D, and 2D curved meshes: (face, q, dim) and (face, q). Weights sum to 2 per face
180 // (twice the area over face_area on curved faces) and are zero on padding points
181 Kokkos::View<rtype ***> face_quad_points;
182 Kokkos::View<rtype **> face_quad_weights;
183 Kokkos::View<rtype ***> face_quad_normals; // curved meshes: (face, q, dim) unit normals out of cell 0
184 protected:
186 std::shared_ptr<Mesh> mesh;
188 private:
189};
190
192 public:
196 FirstOrder();
197
201 ~FirstOrder();
202
206 void init(const toml::value & input) override;
207
212 uint8_t n_face_quadrature_points() const override;
213
220 void calc_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
221 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution) override;
222 protected:
223 private:
224};
225
226enum class LimiterType {
227 NONE,
230};
231
232static const std::unordered_map<std::string, LimiterType> LIMITER_TYPES = {
233 {"none", LimiterType::NONE},
234 {"barth_jespersen", LimiterType::BARTH_JESPERSEN},
235 {"venkatakrishnan", LimiterType::VENKATAKRISHNAN},
236};
237
238static const std::unordered_map<LimiterType, std::string> LIMITER_NAMES = {
239 {LimiterType::NONE, "none"},
240 {LimiterType::BARTH_JESPERSEN, "barth_jespersen"},
241 {LimiterType::VENKATAKRISHNAN, "venkatakrishnan"},
242};
243
248class MUSCL : public FaceReconstruction {
249 public:
250 MUSCL();
251 ~MUSCL();
252 void init(const toml::value & input) override;
253 logging::Items summary() const override;
254 uint8_t n_face_quadrature_points() const override;
255 void calc_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
256 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution) override;
257 std::vector<uint32_t> cells_independent_of_halo(uint32_t n_owned) const override;
258 void calc_cell_face_values(const Kokkos::DefaultExecutionSpace & exec,
259 Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
260 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution,
261 Kokkos::View<uint32_t *> cells) override;
262 void finish_cell_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
263 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution) override;
264
267 Kokkos::View<rtype *[N_CONSERVATIVE][N_DIM]> gradients;
268 Kokkos::View<rtype *[N_CONSERVATIVE]> limiters;
269 LSQVertexGradientFunctor gradient; // Its linear vertex fit serves tetrahedra
270};
271
282class TENO : public FaceReconstruction {
283 public:
284 TENO();
285 ~TENO();
286 void init(const toml::value & input) override;
287 logging::Items summary() const override;
288 uint8_t n_face_quadrature_points() const override;
289 void calc_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
290 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution) override;
291 std::vector<uint32_t> cells_independent_of_halo(uint32_t n_owned) const override;
292 void calc_cell_face_values(const Kokkos::DefaultExecutionSpace & exec,
293 Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
294 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution,
295 Kokkos::View<uint32_t *> cells) override;
296 void finish_cell_face_values(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
297 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution) override;
298 bool cell_gradients(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
299 Kokkos::View<rtype *[N_CONSERVATIVE][N_DIM]> gradients, uint32_t n_cells) override;
300 void axisymmetric_source(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
301 Kokkos::View<rtype *, Kokkos::LayoutStride> mu, Kokkos::View<rtype *> source,
302 uint32_t n_cells) override;
303
311 rtype C_T = -1.0; // Fixed cutoff; negative selects the adaptive cutoff
312 bool characteristic = true;
313 bool bound_preserving = false;
314 // Stencils take mirror images across curved wall and symmetry faces too
315 // (across their planes); by default they stay one-sided there
316 bool curved_mirrors = false;
317 // Largest degree of the central polynomials of cells whose stencils reach a
318 // curved wall without mirror images: one-sided fits of higher degree grow there
321 uint8_t slice_shift = teno::SLICE_SHIFT; // log2 of the cells per slice of the packed stencils
322 // Pseudo-inverses stored in single precision (opt-in: halves the
323 // largest tables, and changes results at single-precision round-off)
324 bool single_tables = false;
325
326 // Per-cell precomputed data, for the reconstructed cells [0, n_reconstructed)
327 Kokkos::View<rtype *> scale; // h = sqrt(V)
328 Kokkos::View<rtype **> basis_mean; // (cell, l): mean of phi_l over the cell
329 Kokkos::View<uint16_t *> stencil_large_size; // (cell)
330 teno::PackedStencils stencil_large; // pseudo-inverse width: nk
331 Kokkos::View<uint16_t **> stencil_small_size; // (cell, face); 0 if stencil invalid
332 teno::PackedStencils stencil_small; // the faces' stencils one after another; width NK_SMALL
333 Kokkos::View<rtype **> si_matrix; // 2D: (cell, upper_index(l, m)): symmetric
334 teno::Moments moments; // 3D: (cell, k), from which the troubled passes form it
336 Kokkos::View<rtype *> troubled; // (local cell): sigma, for diagnostics
337 Kokkos::View<rtype ***> troubled_coeffs; // (queue slot, l, var): scratch for the troubled passes
338 Kokkos::View<rtype ****> troubled_small_coeffs; // (queue slot, sector, l, var): scratch for the troubled passes
339 // Queued cells per round of the troubled passes, as a fraction of the
340 // reconstructed cells (scratch slots); later rounds recompute the
341 // central coefficients the smooth pass could not keep
342 rtype troubled_capacity = N_DIM == 3 ? 0.5 : 1.0;
343 Kokkos::View<uint32_t *> troubled_cells; // queue of troubled cells
344 Kokkos::View<uint32_t> n_troubled;
345 // Vertex-neighbor layers each reconstructed cell's stencil search visited
346 // (host); a distributed run needs this many complete layers around the cell
347 std::vector<uint8_t> gather_depth;
348 // Axisymmetric runs: rule on the reference triangle (q, [xi, eta, w]) of the geometric source
349 Kokkos::View<rtype *[3]> cell_rule;
350 // Device memory of the packed stencils when they were streamed to the device (CUDA)
351 std::vector<std::shared_ptr<GrowingBuffer>> table_memory;
352
357 struct Stencils {
358 std::vector<uint64_t> offsets; // (cell + 1)
359 std::vector<int32_t> cells;
360 std::vector<int32_t> faces;
361 };
362 Stencils large_stencils() const;
363
365 std::vector<uint8_t> stencil_cells() const;
366
372 std::array<double, 9> stencil_metric(uint32_t i) const;
373
379 static uint8_t cached_halo_layers(const toml::value & input);
380
386 void save_cache(uint8_t halo_layers = 0);
387
396 void rebuild_cells(const std::vector<uint32_t> & cells);
397
403 std::vector<uint32_t> cells_within_reach(const std::vector<uint32_t> & changed) const;
404
405 // 3D setup: on the host only (tests), and the cells per device batch (0: from the device memory)
406 bool setup_on_host = false;
408
409 // Gas mixtures: the flow block is reconstructed in primitive variables
410 // W with characteristic projections on the primitive system, whose
411 // sound speed comes from each cell's frozen gamma; troubled cells are
412 // also found by jumps of the mixture molar mass; and the stencil
413 // choice of the entropy field on each face side (SELECT_LARGE or a
414 // bitmask of the kept sector stencils) is left for the species
415 static constexpr uint8_t SELECT_LARGE = 0xFF;
416 bool primitive = false;
417 Kokkos::View<rtype *, Kokkos::LayoutStride> cell_gamma; // (cell)
418 Kokkos::View<rtype *> cell_molar_mass; // (cell)
419 Kokkos::View<uint8_t **> selection; // (face, side)
420
422 void set_mixture(Kokkos::View<rtype *, Kokkos::LayoutStride> gamma, Kokkos::View<rtype *> molar_mass);
423
424 private:
425 template <uint8_t DEG, bool PRIM, typename TABLE>
426 void launch_source(Kokkos::View<rtype *[N_CONSERVATIVE]> solution, Kokkos::View<rtype *, Kokkos::LayoutStride> mu,
427 Kokkos::View<rtype *> source, uint32_t n_cells);
428 template <uint8_t DEG, bool PRIM, typename TABLE>
429 void launch_gradients(Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
430 Kokkos::View<rtype *[N_CONSERVATIVE][N_DIM]> gradients, uint32_t n_cells);
431 template <uint8_t DEG, bool PRIM, typename TABLE>
432 void launch_reconstruction(const Kokkos::DefaultExecutionSpace & exec,
433 Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
434 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution,
435 Kokkos::View<uint32_t *> cells, bool troubled_pass);
436 void dispatch(const Kokkos::DefaultExecutionSpace & exec, Kokkos::View<rtype *[N_CONSERVATIVE]> solution,
437 Kokkos::View<rtype **[2][N_CONSERVATIVE]> face_solution, Kokkos::View<uint32_t *> cells,
438 bool troubled_pass);
439
440 void read_options(const toml::value & input);
441 void compute_stencils_and_matrices(const std::vector<uint32_t> * subset = nullptr);
442 void compute_stencils_and_matrices_3d(const std::vector<uint32_t> * subset);
443 void allocate_scratch();
444 uint64_t options_key() const;
445 uint64_t cache_key() const;
446 bool load_cache();
447 void round_to_single();
448
449 std::string cache_file; // this rank's
450 bool cache_single = false; // pseudo-inverses and smoothness-indicator matrices (3D: moments) cached in single precision
451 bool cache_loaded = false;
452
453 uint32_t largest_stencil = 0; // Largest central stencil on any rank (cells)
454 int64_t n_sector_unavailable = -1; // Small sector stencils cut by boundaries, -1 if unknown
455 std::string cache_status; // Stencil cache outcome, empty without a cache file
456 std::string setup_status; // Where and how fast the tables were set up
457 std::string setup_producer = "host"; // Execution space that set up the tables, or "host"
458};
459
460#endif // FACE_RECONSTRUCTION_H
Boundary conditions.
Definition face_reconstruction.h:53
Kokkos::View< rtype *** > face_quad_points
Definition face_reconstruction.h:181
virtual 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)
Reconstruct the listed cells' sides of their faces, on the given execution space instance,...
Definition face_reconstruction.cpp:46
virtual ~FaceReconstruction()
Destroy the Face Reconstruction object.
Definition face_reconstruction.cpp:34
virtual std::vector< uint32_t > cells_independent_of_halo(uint32_t n_owned) const
Cells below n_owned whose reconstruction reads no cell at or above n_owned, so that calc_cell_face_va...
Definition face_reconstruction.cpp:42
Quadrature quadrature_face
Definition face_reconstruction.h:178
void init_face_quadrature_3d(uint8_t degree)
Set up per-face quadrature (3D): Dunavant rules on triangles and Gauss rules mapped bilinearly onto q...
Definition face_reconstruction.cpp:68
std::shared_ptr< Mesh > mesh
Definition face_reconstruction.h:186
FaceReconstructionType get_type() const
Get the face reconstruction type.
Definition face_reconstruction.h:91
virtual logging::Items summary() const
Display lines for the run log.
Definition face_reconstruction.cpp:38
FaceReconstructionType type
Definition face_reconstruction.h:185
virtual void finish_cell_face_values(Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution)
Complete the face values after calc_cell_face_values().
Definition face_reconstruction.cpp:54
virtual bool cell_gradients(Kokkos::View< rtype *[N_CONSERVATIVE]>, Kokkos::View< rtype *[N_CONSERVATIVE][N_DIM]>, uint32_t)
Gradients of W = [rho, u, p] at the centroids of the first n_cells cells from the reconstruction poly...
Definition face_reconstruction.h:142
virtual void calc_face_values(Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution)=0
Reconstruct the face values.
Kokkos::View< rtype *** > face_quad_normals
Definition face_reconstruction.h:183
void set_mesh(std::shared_ptr< Mesh > mesh)
Set the mesh.
Definition face_reconstruction.cpp:60
void init_face_quadrature_2d_curved()
Curved meshes in 2D: per-face quadrature points, weights and normals for quadrature_face's Gauss rule...
Definition face_reconstruction.cpp:211
FaceReconstruction()
Construct a new Face Reconstruction object.
Definition face_reconstruction.cpp:30
virtual uint8_t n_face_quadrature_points() const =0
Get the number of quadrature points per face.
BoundaryData boundaries
Definition face_reconstruction.h:187
void set_boundaries(const BoundaryData &boundaries)
Set the boundary data used for ghost states.
Definition face_reconstruction.cpp:64
virtual void axisymmetric_source(Kokkos::View< rtype *[N_CONSERVATIVE]>, Kokkos::View< rtype *, Kokkos::LayoutStride >, Kokkos::View< rtype * >, uint32_t)
Axisymmetric runs: for each of the first n_cells cells whose reconstruction has a smooth polynomial,...
Definition face_reconstruction.h:156
virtual void init(const toml::value &input)=0
Initialize the face reconstruction.
Kokkos::View< rtype ** > face_quad_weights
Definition face_reconstruction.h:182
Definition face_reconstruction.h:191
void init(const toml::value &input) override
Initialize the first order face reconstruction.
Definition face_reconstruction.cpp:267
uint8_t n_face_quadrature_points() const override
Get the number of quadrature points per face.
Definition face_reconstruction.cpp:273
FirstOrder()
Construct a new First Order object.
Definition face_reconstruction.cpp:258
~FirstOrder()
Destroy the First Order object.
Definition face_reconstruction.cpp:263
void calc_face_values(Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution) override
Reconstruct the face values.
Definition face_reconstruction.cpp:313
Device memory at a fixed address whose backing grows as it fills: a reserved virtual address range wi...
Definition growing_buffer.h:26
Second-order MUSCL reconstruction of W = [rho, u_x, u_y, p] using least-squares gradients and a slope...
Definition face_reconstruction.h:248
void calc_face_values(Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution) override
Reconstruct the face values.
Definition face_reconstruction.cpp:575
logging::Items summary() const override
Display lines for the run log.
Definition face_reconstruction.cpp:343
Kokkos::View< rtype *[N_CONSERVATIVE][N_DIM]> gradients
Definition face_reconstruction.h:267
MUSCL()
Definition face_reconstruction.cpp:319
void init(const toml::value &input) override
Initialize the face reconstruction.
Definition face_reconstruction.cpp:328
~MUSCL()
Definition face_reconstruction.cpp:324
LSQVertexGradientFunctor gradient
Definition face_reconstruction.h:269
rtype venkat_K
Definition face_reconstruction.h:266
Kokkos::View< rtype *[N_CONSERVATIVE]> limiters
Definition face_reconstruction.h:268
uint8_t n_face_quadrature_points() const override
Get the number of quadrature points per face.
Definition face_reconstruction.cpp:349
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_va...
Definition face_reconstruction.cpp:536
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,...
Definition face_reconstruction.cpp:557
LimiterType limiter
Definition face_reconstruction.h:265
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().
Definition face_reconstruction.cpp:573
Definition quadrature.h:34
High-order TENO-E reconstruction on unstructured meshes (Liang, Shyy & Fu, J. Sci....
Definition face_reconstruction.h:282
Kokkos::View< rtype **** > troubled_small_coeffs
Definition face_reconstruction.h:338
Kokkos::View< rtype * > troubled
Definition face_reconstruction.h:336
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 poly...
Definition teno.cpp:2992
bool curved_mirrors
Definition face_reconstruction.h:316
rtype max_condition
Definition face_reconstruction.h:320
Kokkos::View< rtype *, Kokkos::LayoutStride > cell_gamma
Definition face_reconstruction.h:417
Kokkos::View< uint16_t ** > stencil_small_size
Definition face_reconstruction.h:331
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 c...
Definition teno.cpp:3409
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_va...
Definition teno.cpp:3026
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,...
Definition teno.cpp:3051
rtype troubled_capacity
Definition face_reconstruction.h:342
Kokkos::View< rtype ** > basis_mean
Definition face_reconstruction.h:328
bool primitive
Definition face_reconstruction.h:416
rtype C_T
Definition face_reconstruction.h:311
void calc_face_values(Kokkos::View< rtype *[N_CONSERVATIVE]> solution, Kokkos::View< rtype **[2][N_CONSERVATIVE]> face_solution) override
Reconstruct the face values.
Definition teno.cpp:3020
Kokkos::View< rtype * > cell_molar_mass
Definition face_reconstruction.h:418
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 op...
Definition teno.cpp:3396
uint8_t degree
Definition face_reconstruction.h:304
Stencils large_stencils() const
Definition teno.cpp:3311
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).
Definition teno.cpp:2984
std::vector< uint8_t > gather_depth
Definition face_reconstruction.h:347
bool setup_on_host
Definition face_reconstruction.h:406
Kokkos::View< rtype * > scale
Definition face_reconstruction.h:327
void rebuild_cells(const std::vector< uint32_t > &cells)
Recompute the tables of the given reconstructed cells and keep every other cell's,...
Definition teno.cpp:3262
uint16_t n_stencil_large
Definition face_reconstruction.h:306
uint16_t n_stencil_small
Definition face_reconstruction.h:307
TENO()
Definition teno.cpp:1167
~TENO()
Definition teno.cpp:1171
std::vector< std::shared_ptr< GrowingBuffer > > table_memory
Definition face_reconstruction.h:351
teno::PackedStencils stencil_large
Definition face_reconstruction.h:330
rtype sigma_upper
Definition face_reconstruction.h:310
logging::Items summary() const override
Display lines for the run log.
Definition teno.cpp:1249
bool characteristic
Definition face_reconstruction.h:312
uint8_t n_face_quadrature_points() const override
Get the number of quadrature points per face.
Definition teno.cpp:1270
std::vector< uint8_t > stencil_cells() const
Local cells that some stencil (central or sector) of a reconstructed cell reads.
Definition teno.cpp:3330
Kokkos::View< uint32_t * > troubled_cells
Definition face_reconstruction.h:343
Kokkos::View< uint8_t ** > selection
Definition face_reconstruction.h:419
uint8_t slice_shift
Definition face_reconstruction.h:321
rtype stencil_factor
Definition face_reconstruction.h:308
teno::PackedStencils stencil_small
Definition face_reconstruction.h:332
Kokkos::View< uint16_t * > stencil_large_size
Definition face_reconstruction.h:329
teno::Moments moments
Definition face_reconstruction.h:334
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,...
Definition teno.cpp:2967
Kokkos::View< rtype *[3]> cell_rule
Definition face_reconstruction.h:349
static constexpr uint8_t SELECT_LARGE
Definition face_reconstruction.h:415
bool bound_preserving
Definition face_reconstruction.h:313
bool single_tables
Definition face_reconstruction.h:324
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 ve...
Definition teno.cpp:3281
Kokkos::View< uint32_t > n_troubled
Definition face_reconstruction.h:344
Kokkos::View< rtype ** > si_matrix
Definition face_reconstruction.h:333
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 ...
Definition teno.cpp:3256
teno::SmoothnessTerms si_terms
Definition face_reconstruction.h:335
void init(const toml::value &input) override
Initialize the face reconstruction.
Definition teno.cpp:1215
Kokkos::View< rtype *** > troubled_coeffs
Definition face_reconstruction.h:337
uint8_t curved_wall_degree
Definition face_reconstruction.h:319
rtype sigma_threshold
Definition face_reconstruction.h:309
uint8_t n_dof_large
Definition face_reconstruction.h:305
uint32_t setup_batch_cells
Definition face_reconstruction.h:407
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().
Definition teno.cpp:3058
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
Typedefs for common types.
float rtype
Definition common_typedef.h:39
#define N_DIM
Definition common_typedef.h:28
#define N_CONSERVATIVE
Definition common_typedef.h:29
FaceReconstructionType
Definition face_reconstruction.h:30
LimiterType
Definition face_reconstruction.h:226
Cell gradient reconstruction.
Console output: rank-0 info lines, aligned sections and tables, warnings and errors on stderr,...
Mesh class declaration.
std::vector< std::pair< std::string, std::string > > Items
Key-value lines of a setup section, in display order.
Definition log.h:27
constexpr uint8_t SLICE_SHIFT
log2 of the cells per slice of PackedStencils: 32 on GPUs, so that a warp reads consecutive words,...
Definition teno.h:54
Kokkos::View< double **, Kokkos::LayoutRight > Moments
(cell, k): central moments of each cell, mean of ((x - x_c) / h_c)^a ... (3D).
Definition teno.h:118
Quadrature class declaration.
Device-side lookup from faces to boundary conditions.
Definition boundary.h:229
Gradient over all vertex neighbors plus the boundary ghost states of the cell's own boundary faces,...
Definition gradient.h:233
Stencil cells and mirror faces of every reconstructed cell, row by row (host copy,...
Definition face_reconstruction.h:357
std::vector< int32_t > faces
Definition face_reconstruction.h:360
std::vector< int32_t > cells
Definition face_reconstruction.h:359
std::vector< uint64_t > offsets
Definition face_reconstruction.h:358
Per-cell stencils of different sizes, stored without padding to the largest one in the mesh....
Definition teno.h:66
The terms of the smoothness-indicator matrix (3D): entry e (upper_index(l, m)) is sum_t weight(t) mom...
Definition teno.h:126
Device helpers for the TENO-E reconstruction.
Kokkos::View< uint32_t *, Space > cells
Definition teno_setup.cpp:682