/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/FV/assembler/reconstruction_cache.hh Source File#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/FV/assembler/reconstruction_cache.hh Source File
DiFfRG
Discretization Framework for functional Renormalization Group flows
reconstruction_cache.hh
Go to the documentation of this file.
1#pragma once
2
4
9
10#include <algorithm>
11#include <array>
12#include <autodiff/forward/real/real.hpp>
13#include <cmath>
14#include <cstddef>
15#include <deal.II/base/numbers.h>
16#include <deal.II/base/point.h>
17#include <deal.II/base/tensor.h>
18#include <deal.II/base/types.h>
19#include <utility>
20#include <vector>
21
22namespace DiFfRG
23{
24 namespace FV
25 {
26 namespace KurganovTadmor
27 {
28 namespace internal
29 {
30 template <int dim, typename NumberType, size_t n_components>
32
33 template <int dim, typename NumberType, size_t n_components>
35
36 template <int dim, typename NumberType, size_t n_components> struct BoundaryStencilData;
37
39
40 template <int dim, typename NumberType, size_t n_components>
42
43 template <int dim> struct BoundaryStencilIndex {
44 static_assert(dim == 1, "Boundary stencil indices currently support only dim=1.");
45 };
46
47 template <> struct BoundaryStencilIndex<1> {
48 static constexpr size_t lower_outer = 0;
49 static constexpr size_t lower_inner = 1;
50 static constexpr size_t physical_cell = 2;
51 static constexpr size_t upper_inner = 3;
52 static constexpr size_t upper_outer = 4;
53 };
54
71
72 template <int dim, typename NumberType, size_t n_components>
73 FaceReconstructionState<dim, NumberType, n_components>
75 {
77 reversed.u_minus = state.u_plus;
78 reversed.u_plus = state.u_minus;
79 reversed.center_grad_minus = state.center_grad_plus;
80 reversed.center_grad_plus = state.center_grad_minus;
81 reversed.face_grad_minus = state.face_grad_plus;
82 reversed.face_grad_plus = state.face_grad_minus;
83 reversed.diffusion_u_minus = state.diffusion_u_plus;
84 reversed.diffusion_u_plus = state.diffusion_u_minus;
85 reversed.diffusion_grad_minus = state.diffusion_grad_plus;
86 reversed.diffusion_grad_plus = state.diffusion_grad_minus;
87 reversed.diffusion_u = state.diffusion_u;
88 reversed.diffusion_grad = state.diffusion_grad;
89 reversed.third_derivatives_minus = state.third_derivatives_plus;
90 reversed.third_derivatives_plus = state.third_derivatives_minus;
91 return reversed;
92 }
93
94 template <int dim, typename NumberType, size_t n_components> struct CellData {
95 dealii::Point<dim> x;
96 std::array<NumberType, n_components> u;
97 std::array<dealii::types::global_dof_index, n_components> dof_indices;
98 };
99
100 template <int dim, size_t n_components> struct CellGeometryDofs {
101 dealii::Point<dim> x;
102 std::array<dealii::types::global_dof_index, n_components> dof_indices;
103 };
104
105 template <int dim, typename NumberType, size_t n_components> struct NeighborData {
106 static constexpr size_t n_faces = 2 * dim;
107 std::array<dealii::Point<dim>, n_faces> x;
108 std::array<std::array<NumberType, n_components>, n_faces> u;
109 std::array<std::array<dealii::types::global_dof_index, n_components>, n_faces> dof_indices;
110 };
111
112 template <int dim, size_t n_components> struct NeighborTopologyData {
113 static constexpr size_t n_faces = 2 * dim;
114 std::array<dealii::Point<dim>, n_faces> x;
115 std::array<std::array<dealii::types::global_dof_index, n_components>, n_faces> dof_indices;
116 };
117
118 template <int dim, typename NumberType, size_t n_components> struct CellStencilData {
119 static constexpr size_t n_faces = 2 * dim;
122 std::array<dealii::types::boundary_id, n_faces> boundary_ids;
123 std::array<dealii::Point<dim>, n_faces> face_centers;
124 };
125
126 template <int dim, typename NumberType, size_t n_components> struct SolutionReconstructionCache {
127 static constexpr size_t n_faces = 2 * dim;
128 std::vector<CellStencilData<dim, NumberType, n_components>> cell_stencils;
129 std::vector<std::array<FaceReconstructionState<dim, NumberType, n_components>, n_faces>>
131 std::vector<std::array<bool, n_faces>> face_reconstruction_valid;
133 };
134
135 template <int dim, size_t n_components> struct CellStencilTopologyData {
136 static constexpr size_t n_faces = 2 * dim;
139 std::array<dealii::types::boundary_id, n_faces> boundary_ids;
140 std::array<dealii::Point<dim>, n_faces> face_centers;
141 };
142
143 template <int dim, typename NumberType, size_t n_components>
144 std::array<NumberType, n_components> reconstruct_u(const std::array<NumberType, n_components> &u_center,
145 const dealii::Point<dim> &center,
146 const dealii::Point<dim> &x,
148 {
149 AssertDimension(u_center.size(), n_components);
150 std::array<NumberType, n_components> result;
151 for (size_t c = 0; c < n_components; ++c) {
152 result[c] = u_center[c];
153 result[c] += dealii::scalar_product(u_grad[c], x - center);
154 }
155 return result;
156 }
157
158 template <int dim, typename NumberType, size_t n_components> struct FourPointStencil {
159 std::array<dealii::Point<dim>, 4> x{};
160 std::array<std::array<NumberType, n_components>, 4> u{};
161 };
162
163 template <int dim, typename NumberType, size_t n_components>
165 {
166 static_assert(dim == 1, "Third-derivative FV stencils currently support only dim=1.");
167
168 std::array<size_t, 4> order = {0, 1, 2, 3};
169 std::sort(order.begin(), order.end(),
170 [&](const size_t left, const size_t right) { return stencil.x[left][0] < stencil.x[right][0]; });
171
172 auto x_sorted = stencil.x;
173 auto u_sorted = stencil.u;
174 for (size_t i = 0; i < order.size(); ++i) {
175 x_sorted[i] = stencil.x[order[i]];
176 u_sorted[i] = stencil.u[order[i]];
177 }
178 stencil.x = x_sorted;
179 stencil.u = u_sorted;
180 }
181
182 template <int dim, typename NumberType, size_t n_components>
185 const CellStencilData<dim, NumberType, n_components> &plus_stencil, const dealii::Point<dim> &x_q)
186 {
187 static_assert(dim == 1, "Third-derivative FV stencils currently support only dim=1.");
188
189 const auto outer_face = [&](const CellStencilData<dim, NumberType, n_components> &stencil) {
190 return stencil.cell.x[0] < x_q[0] ? 0U : 1U;
191 };
192
194 const auto minus_outer = outer_face(minus_stencil);
195 const auto plus_outer = outer_face(plus_stencil);
196 result.x = {minus_stencil.neighbors.x[minus_outer], minus_stencil.cell.x, plus_stencil.cell.x,
197 plus_stencil.neighbors.x[plus_outer]};
198 result.u = {minus_stencil.neighbors.u[minus_outer], minus_stencil.cell.u, plus_stencil.cell.u,
199 plus_stencil.neighbors.u[plus_outer]};
201 return result;
202 }
203
204 template <int dim, typename NumberType, size_t n_components>
207 {
208 static_assert(dim == 1, "Third-derivative boundary stencils currently support only dim=1.");
209
210 using BoundaryIndex = BoundaryStencilIndex<dim>;
212 if (boundary_stencil.lower_boundary) {
213 result.x = {boundary_stencil.x[BoundaryIndex::lower_outer], boundary_stencil.x[BoundaryIndex::lower_inner],
214 boundary_stencil.x[BoundaryIndex::physical_cell],
215 boundary_stencil.x[BoundaryIndex::upper_inner]};
216 result.u = {boundary_stencil.u[BoundaryIndex::lower_outer], boundary_stencil.u[BoundaryIndex::lower_inner],
217 boundary_stencil.u[BoundaryIndex::physical_cell],
218 boundary_stencil.u[BoundaryIndex::upper_inner]};
219 } else {
220 result.x = {boundary_stencil.x[BoundaryIndex::lower_inner],
221 boundary_stencil.x[BoundaryIndex::physical_cell],
222 boundary_stencil.x[BoundaryIndex::upper_inner], boundary_stencil.x[BoundaryIndex::upper_outer]};
223 result.u = {boundary_stencil.u[BoundaryIndex::lower_inner],
224 boundary_stencil.u[BoundaryIndex::physical_cell],
225 boundary_stencil.u[BoundaryIndex::upper_inner], boundary_stencil.u[BoundaryIndex::upper_outer]};
226 }
228 return result;
229 }
230
231 template <int dim, typename NumberType, size_t n_components>
235 {
236 using DiffusionReconstructor =
238 return DiffusionReconstructor::template compute_face_state<n_components>(minus_stencil, plus_stencil);
239 }
240
241 template <int dim, typename NumberType, size_t n_components>
242 std::array<ReconstructionDerivativeData<dim, NumberType, n_components>, 2>
244 const DiffusionFaceState<dim, autodiff::Real<1, NumberType>, n_components> &state)
245 {
246 using DiffusionReconstructor =
248 return DiffusionReconstructor::template extract_derivatives<n_components>(state);
249 }
250
251 template <int dim, typename NumberType, size_t n_components, typename VectorType>
253 const VectorType &solution_global,
255 {
256 data.x = topology.x;
257 data.dof_indices = topology.dof_indices;
258 for (unsigned int i = 0; i < n_components; ++i)
259 data.u[i] = solution_global(topology.dof_indices[i]);
260 }
261
262 template <def::HasReconstructor Reconstructor, int dim, typename NumberType, size_t n_components,
263 typename DiffusionReconstructor =
267 const CellStencilData<dim, NumberType, n_components> &plus_stencil, const dealii::Point<dim> &x_q)
268 {
270 state.center_grad_minus = Reconstructor::template compute_gradient<n_components>(
271 minus_stencil.cell.x, minus_stencil.cell.u, minus_stencil.neighbors.x, minus_stencil.neighbors.u);
272 state.center_grad_plus = Reconstructor::template compute_gradient<n_components>(
273 plus_stencil.cell.x, plus_stencil.cell.u, plus_stencil.neighbors.x, plus_stencil.neighbors.u);
274 state.face_grad_minus = Reconstructor::template compute_gradient_at_point<n_components>(
275 minus_stencil.cell.x, x_q, minus_stencil.cell.u, minus_stencil.neighbors.x, minus_stencil.neighbors.u);
276 state.face_grad_plus = Reconstructor::template compute_gradient_at_point<n_components>(
277 plus_stencil.cell.x, x_q, plus_stencil.cell.u, plus_stencil.neighbors.x, plus_stencil.neighbors.u);
278 state.u_minus = reconstruct_u(minus_stencil.cell.u, minus_stencil.cell.x, x_q, state.center_grad_minus);
279 state.u_plus = reconstruct_u(plus_stencil.cell.u, plus_stencil.cell.x, x_q, state.center_grad_plus);
280 const auto diffusion_state =
281 DiffusionReconstructor::template compute_face_state<n_components>(minus_stencil, plus_stencil);
282 state.diffusion_u_minus = diffusion_state.u_minus;
283 state.diffusion_u_plus = diffusion_state.u_plus;
284 state.diffusion_grad_minus = diffusion_state.grad_minus;
285 state.diffusion_grad_plus = diffusion_state.grad_plus;
286 state.diffusion_u = diffusion_state.u;
287 state.diffusion_grad = diffusion_state.grad;
288 if constexpr (dim == 1) {
289 const auto third_derivative_stencil =
290 make_interior_third_derivative_stencil(minus_stencil, plus_stencil, x_q);
291 const auto third_derivatives = Reconstructor::template compute_third_derivatives_at_face<n_components>(
292 third_derivative_stencil.x, third_derivative_stencil.u);
293 state.third_derivatives_minus = third_derivatives;
294 state.third_derivatives_plus = third_derivatives;
295 }
296 return state;
297 }
298
299 template <def::HasReconstructor Reconstructor, int dim, typename NumberType, size_t n_components>
300 std::array<NumberType, n_components> reconstruct_u_derivative(
301 const std::array<autodiff::Real<1, NumberType>, n_components> &u_center,
302 const dealii::Point<dim> &center, const dealii::Point<dim> &x,
303 const std::array<dealii::Point<dim>, 2 * dim> &x_n,
304 const std::array<std::array<autodiff::Real<1, NumberType>, n_components>, 2 * dim> &u_n)
305 {
306 const auto u_grad_deriv =
307 Reconstructor::template compute_gradient_derivative<n_components>(center, u_center, x_n, u_n);
308 std::array<NumberType, n_components> result;
309 for (size_t c = 0; c < n_components; ++c) {
310 result[c] = derivative(u_center[c]);
311 result[c] += dealii::scalar_product(u_grad_deriv[c], x - center);
312 }
313 return result;
314 }
315
316 template <int dim, typename NumberType, size_t n_components>
317 bool is_lower_boundary_stencil(const std::array<dealii::Point<dim>, 2 * dim + 3> &x_stencil,
318 const dealii::Point<dim> &x_face)
319 {
320 static_assert(dim == 1, "Paper-style boundary stencil orientation currently supports only dim=1.");
321
322 return x_face[0] <= x_stencil[BoundaryStencilIndex<dim>::physical_cell][0];
323 }
324
325 template <int dim, typename NumberType, size_t n_components> struct BoundaryStencilData {
326 static constexpr size_t stencil_size = 2 * dim + 3;
327 std::array<dealii::Point<dim>, stencil_size> x{};
328 std::array<std::array<NumberType, n_components>, stencil_size> u{};
329 std::array<std::array<dealii::types::global_dof_index, n_components>, stencil_size> dof_indices{};
330 bool lower_boundary = true;
331 unsigned int cell_face = 0;
332 dealii::Point<dim> face_center{};
336 };
337
338 template <int dim, size_t n_components> struct BoundaryStencilTopologyData {
339 static constexpr size_t stencil_size = 2 * dim + 3;
340 std::array<dealii::Point<dim>, stencil_size> x{};
341 std::array<std::array<dealii::types::global_dof_index, n_components>, stencil_size> dof_indices{};
342 bool lower_boundary = true;
343 unsigned int cell_face = 0;
344 dealii::Point<dim> face_center{};
348 };
349
350 template <int dim, typename NumberType, size_t n_components> struct BoundaryReconstructionStencilData {
351 static constexpr size_t n_faces = 2 * dim;
353 std::array<BoundaryStencilData<dim, NumberType, n_components>, n_faces> tangential_ghost_neighbors{};
354 std::array<bool, n_faces> tangential_ghost_neighbor_valid{};
355 std::array<std::array<BoundaryStencilData<dim, NumberType, n_components>, 3>, n_faces>
357 std::array<bool, n_faces> corner_tangential_stencil_valid{};
358 };
359
360 template <int dim, size_t n_components> struct BoundaryReconstructionStencilTopologyData {
361 static constexpr size_t n_faces = 2 * dim;
363 std::array<BoundaryStencilTopologyData<dim, n_components>, n_faces> tangential_ghost_neighbors{};
364 std::array<bool, n_faces> tangential_ghost_neighbor_valid{};
365 std::array<std::array<BoundaryStencilTopologyData<dim, n_components>, 3>, n_faces>
367 std::array<bool, n_faces> corner_tangential_stencil_valid{};
368 };
369
370 template <typename BoundaryNumberType, int dim, size_t n_components, typename VectorType>
372 const BoundaryStencilTopologyData<dim, n_components> &topology, const VectorType &solution_global)
373 {
375 boundary_stencil.x = topology.x;
376 boundary_stencil.dof_indices = topology.dof_indices;
377 boundary_stencil.lower_boundary = topology.lower_boundary;
378 boundary_stencil.cell_face = topology.cell_face;
379 boundary_stencil.face_center = topology.face_center;
380 boundary_stencil.ghost_center = topology.ghost_center;
381 boundary_stencil.ghost_left = topology.ghost_left;
382 boundary_stencil.ghost_right = topology.ghost_right;
383 for (size_t stencil_index = 0; stencil_index < boundary_stencil.u.size(); ++stencil_index) {
384 for (size_t c = 0; c < n_components; ++c) {
385 const auto dof = topology.dof_indices[stencil_index][c];
386 boundary_stencil.u[stencil_index][c] =
387 dof == dealii::numbers::invalid_dof_index ? BoundaryNumberType{} :
388 BoundaryNumberType(solution_global(dof));
389 }
390 }
391 return boundary_stencil;
392 }
393
394 template <typename BoundaryNumberType, int dim, size_t n_components, typename VectorType>
395 BoundaryReconstructionStencilData<dim, BoundaryNumberType, n_components>
398 const VectorType &solution_global)
399 {
402 topology.primary, solution_global);
403 result.tangential_ghost_neighbor_valid = topology.tangential_ghost_neighbor_valid;
404 result.corner_tangential_stencil_valid = topology.corner_tangential_stencil_valid;
405 for (size_t face = 0; face < result.n_faces; ++face) {
406 if (result.tangential_ghost_neighbor_valid[face])
407 result.tangential_ghost_neighbors[face] =
409 topology.tangential_ghost_neighbors[face], solution_global);
410 if (result.corner_tangential_stencil_valid[face]) {
411 for (size_t stencil_index = 0; stencil_index < result.corner_tangential_stencils[face].size();
412 ++stencil_index) {
413 result.corner_tangential_stencils[face][stencil_index] =
415 topology.corner_tangential_stencils[face][stencil_index], solution_global);
416 }
417 }
418 }
419 return result;
420 }
421
422 template <int dim, typename NumberType, size_t n_components>
423 CellStencilData<dim, NumberType, n_components>
425 const size_t center_index, const size_t left_index, const size_t right_index)
426 {
427 static_assert(dim == 1, "Paper-style boundary side stencils currently support only dim=1.");
428
430 result.boundary_ids.fill(dealii::numbers::invalid_boundary_id);
431 result.face_centers = {};
432
433 result.cell.x = boundary_stencil.x[center_index];
434 result.cell.u = boundary_stencil.u[center_index];
435 result.cell.dof_indices = boundary_stencil.dof_indices[center_index];
436 result.neighbors.x[0] = boundary_stencil.x[left_index];
437 result.neighbors.x[1] = boundary_stencil.x[right_index];
438 result.neighbors.u[0] = boundary_stencil.u[left_index];
439 result.neighbors.u[1] = boundary_stencil.u[right_index];
440 result.neighbors.dof_indices[0] = boundary_stencil.dof_indices[left_index];
441 result.neighbors.dof_indices[1] = boundary_stencil.dof_indices[right_index];
442 return result;
443 }
444
445 template <int dim, typename NumberType, size_t n_components>
446 CellStencilData<dim, NumberType, n_components>
448 {
449 static_assert(dim == 1, "Paper-style physical boundary side stencils currently support only dim=1.");
450
454 }
455
456 template <int dim, typename NumberType, size_t n_components>
457 CellStencilData<dim, NumberType, n_components>
459 {
460 static_assert(dim == 1, "Paper-style ghost boundary side stencils currently support only dim=1.");
461
462 return make_boundary_side_stencil<dim>(boundary_stencil, boundary_stencil.ghost_center,
463 boundary_stencil.ghost_left, boundary_stencil.ghost_right);
464 }
465
466 template <int dim, typename NumberType, size_t n_components>
469 const CellStencilData<dim, NumberType, n_components> & /*physical_stencil*/,
470 const dealii::Point<dim> & /*x_q*/)
471 requires(dim == 1)
472 {}
473
474 template <int dim, typename NumberType, size_t n_components>
478 const dealii::Point<dim> &x_q)
479 requires(dim == 2)
480 {
481 const unsigned int axis = boundary_stencil.cell_face / 2;
482 const size_t ghost_center = boundary_stencil.lower_boundary ? def::BoundaryStencilIndex::lower_inner :
484 const size_t ghost_outer = boundary_stencil.lower_boundary ? def::BoundaryStencilIndex::lower_outer :
486 boundary_stencil.ghost_center = ghost_center;
487 boundary_stencil.ghost_left =
488 boundary_stencil.lower_boundary ? ghost_outer : def::BoundaryStencilIndex::physical_cell;
489 boundary_stencil.ghost_right =
490 boundary_stencil.lower_boundary ? def::BoundaryStencilIndex::physical_cell : ghost_outer;
491
492 const auto &physical_x = boundary_stencil.x[def::BoundaryStencilIndex::physical_cell];
493 const double delta = std::abs(physical_x[axis] - x_q[axis]);
494 const double direction = boundary_stencil.lower_boundary ? -1.0 : 1.0;
495 boundary_stencil.x[ghost_center] = physical_x;
496 boundary_stencil.x[ghost_center][axis] = physical_x[axis] + direction * 2.0 * delta;
497 boundary_stencil.x[ghost_outer] = physical_x;
498 boundary_stencil.x[ghost_outer][axis] = physical_x[axis] + direction * 4.0 * delta;
499
500 (void)physical_stencil;
501 }
502
503 template <typename Model, int dim, typename NumberType, size_t n_components>
506 const Model &model)
507 {
508 prepare_boundary_reconstruction_stencil(boundary_stencil, cell_stencil, boundary_stencil.face_center);
509 const bool boundary_supported =
510 model.apply_boundary_stencil(boundary_stencil.u, boundary_stencil.x, boundary_stencil.face_center);
511 AssertThrow(boundary_supported,
512 dealii::ExcMessage("KT boundary stencil was rejected by the model boundary policy."));
513 }
514
515 template <typename Model, typename NumberType, size_t n_components>
517 const BoundaryReconstructionStencilData<2, NumberType, n_components> &boundary_reconstruction_stencil,
518 const unsigned int result_face, const CellStencilData<2, NumberType, n_components> &physical_stencil,
519 const Model &model)
520 {
521 using namespace def::BoundaryStencilIndex;
522 std::array<BoundaryStencilData<2, NumberType, n_components>, 3> tangential_stencils =
523 boundary_reconstruction_stencil.corner_tangential_stencils[result_face];
524 for (auto &tangential_stencil : tangential_stencils)
525 apply_boundary_reconstruction_stencil(tangential_stencil, physical_stencil, model);
526
528 const auto &primary = boundary_reconstruction_stencil.primary;
529 normal_stencil.lower_boundary = primary.lower_boundary;
530 normal_stencil.cell_face = primary.cell_face;
531 normal_stencil.face_center = primary.face_center;
532 normal_stencil.ghost_center = primary.ghost_center;
533 normal_stencil.ghost_left = primary.ghost_left;
534 normal_stencil.ghost_right = primary.ghost_right;
535 for (auto &dofs : normal_stencil.dof_indices)
536 dofs.fill(dealii::numbers::invalid_dof_index);
537
538 const unsigned int normal_axis = primary.cell_face / 2;
539 const unsigned int tangential_axis = 1U - normal_axis;
540 normal_stencil.x[physical_cell] = tangential_stencils[0].x[tangential_stencils[0].ghost_center];
541 normal_stencil.u[physical_cell] = tangential_stencils[0].u[tangential_stencils[0].ghost_center];
542 normal_stencil.dof_indices[physical_cell] =
543 tangential_stencils[0].dof_indices[tangential_stencils[0].ghost_center];
544 normal_stencil.face_center[tangential_axis] = normal_stencil.x[physical_cell][tangential_axis];
545
546 const size_t inner_index = primary.lower_boundary ? upper_inner : lower_inner;
547 const size_t outer_index = primary.lower_boundary ? upper_outer : lower_outer;
548 normal_stencil.x[inner_index] = tangential_stencils[1].x[tangential_stencils[1].ghost_center];
549 normal_stencil.u[inner_index] = tangential_stencils[1].u[tangential_stencils[1].ghost_center];
550 normal_stencil.dof_indices[inner_index] =
551 tangential_stencils[1].dof_indices[tangential_stencils[1].ghost_center];
552 normal_stencil.x[outer_index] = tangential_stencils[2].x[tangential_stencils[2].ghost_center];
553 normal_stencil.u[outer_index] = tangential_stencils[2].u[tangential_stencils[2].ghost_center];
554 normal_stencil.dof_indices[outer_index] =
555 tangential_stencils[2].dof_indices[tangential_stencils[2].ghost_center];
556
557 apply_boundary_reconstruction_stencil(normal_stencil, physical_stencil, model);
558 return normal_stencil;
559 }
560
561 template <int dim, typename NumberType, size_t n_components>
569
570 template <int dim, typename NumberType, size_t n_components>
574 requires(dim == 2)
575 {
576 CellStencilData<dim, NumberType, n_components> result = physical_stencil;
577 const unsigned int normal_face = boundary_stencil.cell_face;
578 result.neighbors.x[normal_face] = boundary_stencil.x[boundary_stencil.ghost_center];
579 result.neighbors.u[normal_face] = boundary_stencil.u[boundary_stencil.ghost_center];
580 result.neighbors.dof_indices[normal_face] =
581 boundary_stencil.dof_indices[boundary_stencil.ghost_center];
582 return result;
583 }
584
585 template <int dim, typename NumberType, size_t n_components>
593
594 template <int dim, typename NumberType, size_t n_components>
598 requires(dim == 2)
599 {
600 (void)boundary_stencil;
601 (void)physical_stencil;
602 AssertThrow(false,
603 dealii::ExcMessage(
604 "KT 2D ghost boundary side stencils require model-owned tangential ghost support."));
605 return {};
606 }
607
608 template <typename Model, typename NumberType, size_t n_components>
610 const BoundaryReconstructionStencilData<2, NumberType, n_components> &boundary_reconstruction_stencil,
611 const CellStencilData<2, NumberType, n_components> &physical_stencil, const Model &model)
612 {
613 using namespace def::BoundaryStencilIndex;
614 const auto &boundary_stencil = boundary_reconstruction_stencil.primary;
616 result.boundary_ids.fill(dealii::numbers::invalid_boundary_id);
617 result.face_centers = {};
618
619 result.cell.x = boundary_stencil.x[boundary_stencil.ghost_center];
620 result.cell.u = boundary_stencil.u[boundary_stencil.ghost_center];
621 result.cell.dof_indices = boundary_stencil.dof_indices[boundary_stencil.ghost_center];
622
623 const unsigned int axis = boundary_stencil.cell_face / 2;
624 const unsigned int tangential_axis = 1U - axis;
625 const unsigned int normal_minus = 2 * axis;
626 const unsigned int normal_plus = normal_minus + 1;
627 const unsigned int tangential_minus = 2 * tangential_axis;
628 const unsigned int tangential_plus = tangential_minus + 1;
629
630 const size_t normal_outer = boundary_stencil.lower_boundary ? boundary_stencil.ghost_left :
631 boundary_stencil.ghost_right;
632 if (boundary_stencil.lower_boundary) {
633 result.neighbors.x[normal_minus] = boundary_stencil.x[normal_outer];
634 result.neighbors.u[normal_minus] = boundary_stencil.u[normal_outer];
635 result.neighbors.dof_indices[normal_minus] = boundary_stencil.dof_indices[normal_outer];
636 result.neighbors.x[normal_plus] = boundary_stencil.x[physical_cell];
637 result.neighbors.u[normal_plus] = boundary_stencil.u[physical_cell];
638 result.neighbors.dof_indices[normal_plus] = boundary_stencil.dof_indices[physical_cell];
639 } else {
640 result.neighbors.x[normal_minus] = boundary_stencil.x[physical_cell];
641 result.neighbors.u[normal_minus] = boundary_stencil.u[physical_cell];
642 result.neighbors.dof_indices[normal_minus] = boundary_stencil.dof_indices[physical_cell];
643 result.neighbors.x[normal_plus] = boundary_stencil.x[normal_outer];
644 result.neighbors.u[normal_plus] = boundary_stencil.u[normal_outer];
645 result.neighbors.dof_indices[normal_plus] = boundary_stencil.dof_indices[normal_outer];
646 }
647
648 const auto set_model_tangential_neighbor = [&](const unsigned int result_face) {
650 if (boundary_reconstruction_stencil.tangential_ghost_neighbor_valid[result_face]) {
651 neighbor_stencil = boundary_reconstruction_stencil.tangential_ghost_neighbors[result_face];
652 apply_boundary_reconstruction_stencil(neighbor_stencil, physical_stencil, model);
653 } else {
654 AssertThrow(boundary_reconstruction_stencil.corner_tangential_stencil_valid[result_face],
655 dealii::ExcMessage("KT 2D boundary reconstruction is missing tangential ghost support."));
656 neighbor_stencil = make_composed_corner_boundary_stencil(boundary_reconstruction_stencil, result_face,
657 physical_stencil, model);
658 }
659 result.neighbors.x[result_face] = neighbor_stencil.x[neighbor_stencil.ghost_center];
660 result.neighbors.u[result_face] = neighbor_stencil.u[neighbor_stencil.ghost_center];
661 result.neighbors.dof_indices[result_face] =
662 neighbor_stencil.dof_indices[neighbor_stencil.ghost_center];
663 };
664
665 set_model_tangential_neighbor(tangential_minus);
666 set_model_tangential_neighbor(tangential_plus);
667
668 return result;
669 }
670
671 template <typename Model, typename NumberType, size_t n_components>
674 CellStencilData<1, NumberType, n_components> &cell_stencil, const unsigned int face_index,
675 const dealii::Point<1> &x_q, const Model &model)
676 {
677 const bool boundary_supported = model.apply_boundary_stencil(boundary_stencil.u, boundary_stencil.x, x_q);
678 AssertThrow(
679 boundary_supported,
680 dealii::ExcMessage("KT boundary stencil was rejected while populating a boundary-adjacent cell stencil."));
681
682 cell_stencil.neighbors.x[face_index] = boundary_stencil.x[boundary_stencil.ghost_center];
683 cell_stencil.neighbors.u[face_index] = boundary_stencil.u[boundary_stencil.ghost_center];
684 cell_stencil.neighbors.dof_indices[face_index] =
685 boundary_stencil.dof_indices[boundary_stencil.ghost_center];
686 }
687
688 template <typename Model, typename NumberType, size_t n_components>
691 CellStencilData<2, NumberType, n_components> &cell_stencil, const unsigned int face_index,
692 const dealii::Point<2> &x_q, const Model &model)
693 {
694 boundary_stencil.face_center = x_q;
695 prepare_boundary_reconstruction_stencil(boundary_stencil, cell_stencil, x_q);
696
697 const bool boundary_supported = model.apply_boundary_stencil(boundary_stencil.u, boundary_stencil.x, x_q);
698 AssertThrow(
699 boundary_supported,
700 dealii::ExcMessage("KT boundary stencil was rejected while populating a boundary-adjacent cell stencil."));
701
702 cell_stencil.neighbors.x[face_index] = boundary_stencil.x[boundary_stencil.ghost_center];
703 cell_stencil.neighbors.u[face_index] = boundary_stencil.u[boundary_stencil.ghost_center];
704 cell_stencil.neighbors.dof_indices[face_index] =
705 boundary_stencil.dof_indices[boundary_stencil.ghost_center];
706 }
707
708 template <typename Model, typename NumberType, size_t n_components>
709 std::pair<CellStencilData<1, NumberType, n_components>, CellStencilData<1, NumberType, n_components>>
712 const CellStencilData<1, NumberType, n_components> &physical_cell_stencil,
713 const dealii::Point<1> &x_q, const Model &model)
714 {
715 prepare_boundary_reconstruction_stencil(boundary_stencil, physical_cell_stencil, x_q);
716
717 const bool boundary_supported = model.apply_boundary_stencil(boundary_stencil.u, boundary_stencil.x, x_q);
718 AssertThrow(boundary_supported,
719 dealii::ExcMessage("KT boundary stencil was rejected by the model boundary policy."));
720
721 return {make_physical_boundary_side_stencil(boundary_stencil, physical_cell_stencil),
722 make_ghost_boundary_side_stencil(boundary_stencil, physical_cell_stencil)};
723 }
724
725 template <typename Model, typename NumberType, size_t n_components>
726 std::pair<CellStencilData<1, NumberType, n_components>, CellStencilData<1, NumberType, n_components>>
729 const CellStencilData<1, NumberType, n_components> &physical_cell_stencil,
730 const dealii::Point<1> &x_q, const Model &model)
731 {
732 return make_model_boundary_reconstruction_side_stencils(boundary_reconstruction_stencil.primary,
733 physical_cell_stencil, x_q, model);
734 }
735
736 template <typename Model, typename NumberType, size_t n_components>
737 std::pair<CellStencilData<2, NumberType, n_components>, CellStencilData<2, NumberType, n_components>>
740 const CellStencilData<2, NumberType, n_components> &physical_cell_stencil,
741 const dealii::Point<2> &x_q, const Model &model)
742 {
743 prepare_boundary_reconstruction_stencil(boundary_stencil, physical_cell_stencil, x_q);
744
745 const bool boundary_supported = model.apply_boundary_stencil(boundary_stencil.u, boundary_stencil.x, x_q);
746 AssertThrow(boundary_supported,
747 dealii::ExcMessage("KT boundary stencil was rejected by the model boundary policy."));
748
749 return {make_physical_boundary_side_stencil(boundary_stencil, physical_cell_stencil),
750 make_ghost_boundary_side_stencil(boundary_stencil, physical_cell_stencil)};
751 }
752
753 template <typename Model, typename NumberType, size_t n_components>
754 std::pair<CellStencilData<2, NumberType, n_components>, CellStencilData<2, NumberType, n_components>>
757 const CellStencilData<2, NumberType, n_components> &physical_cell_stencil,
758 const dealii::Point<2> &x_q, const Model &model)
759 {
760 boundary_reconstruction_stencil.primary.face_center = x_q;
761 apply_boundary_reconstruction_stencil(boundary_reconstruction_stencil.primary, physical_cell_stencil, model);
762
763 return {make_physical_boundary_side_stencil(boundary_reconstruction_stencil.primary, physical_cell_stencil),
764 make_ghost_boundary_side_stencil(boundary_reconstruction_stencil, physical_cell_stencil, model)};
765 }
766
767 template <def::HasReconstructor Reconstructor, typename Model, typename NumberType, size_t n_components>
770 const CellStencilData<1, NumberType, n_components> &physical_cell_stencil,
771 const dealii::Point<1> &x_q, const Model &model)
772 {
773 const auto [physical_stencil, ghost_stencil] =
774 make_model_boundary_reconstruction_side_stencils(boundary_stencil, physical_cell_stencil, x_q, model);
775 return compute_interior_face_reconstruction_state<Reconstructor>(physical_stencil, ghost_stencil, x_q);
776 }
777
778 template <def::HasReconstructor Reconstructor, typename Model, typename NumberType, size_t n_components>
781 const CellStencilData<1, NumberType, n_components> &physical_cell_stencil,
782 const dealii::Point<1> &x_q, const Model &model)
783 {
785 boundary_reconstruction_stencil.primary, physical_cell_stencil, x_q, model);
786 }
787
788 template <def::HasReconstructor Reconstructor, typename Model, typename NumberType, size_t n_components>
791 const CellStencilData<2, NumberType, n_components> &physical_cell_stencil,
792 const dealii::Point<2> &x_q, const Model &model)
793 {
794 const auto [physical_stencil, ghost_stencil] =
795 make_model_boundary_reconstruction_side_stencils(boundary_stencil, physical_cell_stencil, x_q, model);
796 return compute_interior_face_reconstruction_state<Reconstructor>(physical_stencil, ghost_stencil, x_q);
797 }
798
799 template <def::HasReconstructor Reconstructor, typename Model, typename NumberType, size_t n_components>
802 const CellStencilData<2, NumberType, n_components> &physical_cell_stencil,
803 const dealii::Point<2> &x_q, const Model &model)
804 {
805 const auto [physical_stencil, ghost_stencil] =
806 make_model_boundary_reconstruction_side_stencils(boundary_reconstruction_stencil, physical_cell_stencil,
807 x_q, model);
808 return compute_interior_face_reconstruction_state<Reconstructor>(physical_stencil, ghost_stencil, x_q);
809 }
810
811 template <int dim, typename NumberType, size_t n_components>
812 CellData<dim, autodiff::Real<1, NumberType>, n_components>
813 tag_cell_dofs(const CellData<dim, NumberType, n_components> &cell_data, dealii::types::global_dof_index dof_j)
814 {
815 using AD = autodiff::Real<1, NumberType>;
817 result.x = cell_data.x;
818 result.dof_indices = cell_data.dof_indices;
819 for (size_t c = 0; c < n_components; ++c) {
820 result.u[c] = AD(cell_data.u[c]);
821 if (cell_data.dof_indices[c] == dof_j) seed(result.u[c]);
822 }
823 return result;
824 }
825
826 template <int dim, typename NumberType, size_t n_components>
827 NeighborData<dim, autodiff::Real<1, NumberType>, n_components>
829 dealii::types::global_dof_index dof_j)
830 {
831 using AD = autodiff::Real<1, NumberType>;
833 result.x = neighbor_data.x;
834 result.dof_indices = neighbor_data.dof_indices;
835 for (size_t face = 0; face < NeighborData<dim, NumberType, n_components>::n_faces; ++face) {
836 for (size_t c = 0; c < n_components; ++c) {
837 result.u[face][c] = AD(neighbor_data.u[face][c]);
838 if (neighbor_data.dof_indices[face][c] == dof_j) seed(result.u[face][c]);
839 }
840 }
841 return result;
842 }
843
844 template <int dim, typename NumberType, size_t n_components>
845 CellStencilData<dim, autodiff::Real<1, NumberType>, n_components>
847 dealii::types::global_dof_index dof_j)
848 {
850 result.cell = tag_cell_dofs(cell_stencil.cell, dof_j);
851 result.neighbors = make_tagged_neighbors(cell_stencil.neighbors, dof_j);
852 result.boundary_ids = cell_stencil.boundary_ids;
853 result.face_centers = cell_stencil.face_centers;
854 return result;
855 }
856
857 template <int dim, typename NumberType, size_t n_components>
858 BoundaryStencilData<dim, autodiff::Real<1, NumberType>, n_components>
860 dealii::types::global_dof_index dof_j)
861 {
862 using AD = autodiff::Real<1, NumberType>;
864 result.x = boundary_stencil.x;
865 result.dof_indices = boundary_stencil.dof_indices;
866 result.lower_boundary = boundary_stencil.lower_boundary;
867 result.cell_face = boundary_stencil.cell_face;
868 result.ghost_center = boundary_stencil.ghost_center;
869 result.ghost_left = boundary_stencil.ghost_left;
870 result.ghost_right = boundary_stencil.ghost_right;
871 result.face_center = boundary_stencil.face_center;
872 for (size_t stencil_index = 0; stencil_index < boundary_stencil.u.size(); ++stencil_index) {
873 for (size_t c = 0; c < n_components; ++c) {
874 result.u[stencil_index][c] = AD(boundary_stencil.u[stencil_index][c]);
875 if (boundary_stencil.dof_indices[stencil_index][c] == dof_j) seed(result.u[stencil_index][c]);
876 }
877 }
878 return result;
879 }
880
881 template <int dim, typename NumberType, size_t n_components>
882 BoundaryReconstructionStencilData<dim, autodiff::Real<1, NumberType>, n_components>
884 const BoundaryReconstructionStencilData<dim, NumberType, n_components> &boundary_reconstruction_stencil,
885 dealii::types::global_dof_index dof_j)
886 {
888 result.primary =
889 tag_boundary_stencil_dofs<dim, NumberType, n_components>(boundary_reconstruction_stencil.primary, dof_j);
890 result.tangential_ghost_neighbor_valid = boundary_reconstruction_stencil.tangential_ghost_neighbor_valid;
891 result.corner_tangential_stencil_valid = boundary_reconstruction_stencil.corner_tangential_stencil_valid;
892 for (size_t face = 0; face < result.n_faces; ++face) {
893 if (result.tangential_ghost_neighbor_valid[face])
894 result.tangential_ghost_neighbors[face] = tag_boundary_stencil_dofs<dim, NumberType, n_components>(
895 boundary_reconstruction_stencil.tangential_ghost_neighbors[face], dof_j);
896 if (result.corner_tangential_stencil_valid[face]) {
897 for (size_t stencil_index = 0; stencil_index < result.corner_tangential_stencils[face].size();
898 ++stencil_index) {
899 result.corner_tangential_stencils[face][stencil_index] =
901 boundary_reconstruction_stencil.corner_tangential_stencils[face][stencil_index], dof_j);
902 }
903 }
904 }
905 return result;
906 }
907
908 } // namespace internal
909 } // namespace KurganovTadmor
910 } // namespace FV
911} // namespace DiFfRG
Definition corrected_weighted_least_squares_reconstructor.hh:25
Concept that any gradient-reconstruction strategy must satisfy.
Definition abstract_reconstructor.hh:22
FaceReconstructionState< 1, NumberType, n_components > compute_boundary_face_reconstruction_state(BoundaryStencilData< 1, NumberType, n_components > boundary_stencil, const CellStencilData< 1, NumberType, n_components > &physical_cell_stencil, const dealii::Point< 1 > &x_q, const Model &model)
Definition reconstruction_cache.hh:768
def::GradientType< dim, NumberType, n_components > GradientType
Definition reconstruction_cache.hh:31
CellStencilData< dim, NumberType, n_components > make_ghost_boundary_side_stencil(const BoundaryStencilData< dim, NumberType, n_components > &boundary_stencil)
Definition reconstruction_cache.hh:458
BoundaryStencilData< dim, autodiff::Real< 1, NumberType >, n_components > tag_boundary_stencil_dofs(const BoundaryStencilData< dim, NumberType, n_components > &boundary_stencil, dealii::types::global_dof_index dof_j)
Definition reconstruction_cache.hh:859
std::pair< CellStencilData< 1, NumberType, n_components >, CellStencilData< 1, NumberType, n_components > > make_model_boundary_reconstruction_side_stencils(BoundaryStencilData< 1, NumberType, n_components > boundary_stencil, const CellStencilData< 1, NumberType, n_components > &physical_cell_stencil, const dealii::Point< 1 > &x_q, const Model &model)
Definition reconstruction_cache.hh:710
void sort_four_point_stencil(FourPointStencil< dim, NumberType, n_components > &stencil)
Definition reconstruction_cache.hh:164
CellData< dim, autodiff::Real< 1, NumberType >, n_components > tag_cell_dofs(const CellData< dim, NumberType, n_components > &cell_data, dealii::types::global_dof_index dof_j)
Definition reconstruction_cache.hh:813
bool is_lower_boundary_stencil(const std::array< dealii::Point< dim >, 2 *dim+3 > &x_stencil, const dealii::Point< dim > &x_face)
Definition reconstruction_cache.hh:317
std::array< ReconstructionDerivativeData< dim, NumberType, n_components >, 2 > extract_diffusion_face_derivatives(const DiffusionFaceState< dim, autodiff::Real< 1, NumberType >, n_components > &state)
Definition reconstruction_cache.hh:243
FaceReconstructionState< dim, NumberType, n_components > compute_interior_face_reconstruction_state(const CellStencilData< dim, NumberType, n_components > &minus_stencil, const CellStencilData< dim, NumberType, n_components > &plus_stencil, const dealii::Point< dim > &x_q)
Definition reconstruction_cache.hh:265
BoundaryReconstructionStencilData< dim, autodiff::Real< 1, NumberType >, n_components > tag_boundary_reconstruction_stencil_dofs(const BoundaryReconstructionStencilData< dim, NumberType, n_components > &boundary_reconstruction_stencil, dealii::types::global_dof_index dof_j)
Definition reconstruction_cache.hh:883
void apply_boundary_reconstruction_stencil(BoundaryStencilData< dim, NumberType, n_components > &boundary_stencil, const CellStencilData< dim, NumberType, n_components > &cell_stencil, const Model &model)
Definition reconstruction_cache.hh:504
BoundaryStencilData< dim, BoundaryNumberType, n_components > fill_boundary_stencil_from_topology(const BoundaryStencilTopologyData< dim, n_components > &topology, const VectorType &solution_global)
Definition reconstruction_cache.hh:371
CellStencilData< dim, autodiff::Real< 1, NumberType >, n_components > tag_cell_stencil_dofs(const CellStencilData< dim, NumberType, n_components > &cell_stencil, dealii::types::global_dof_index dof_j)
Definition reconstruction_cache.hh:846
CellStencilData< dim, NumberType, n_components > make_physical_boundary_side_stencil(const BoundaryStencilData< dim, NumberType, n_components > &boundary_stencil)
Definition reconstruction_cache.hh:447
FourPointStencil< dim, NumberType, n_components > make_boundary_third_derivative_stencil(const BoundaryStencilData< dim, NumberType, n_components > &boundary_stencil)
Definition reconstruction_cache.hh:205
void populate_boundary_neighbor_from_model_stencil(BoundaryStencilData< 1, NumberType, n_components > &boundary_stencil, CellStencilData< 1, NumberType, n_components > &cell_stencil, const unsigned int face_index, const dealii::Point< 1 > &x_q, const Model &model)
Definition reconstruction_cache.hh:672
def::ThirdDerivativeType< dim, NumberType, n_components > ThirdDerivativeType
Definition reconstruction_cache.hh:34
NeighborData< dim, autodiff::Real< 1, NumberType >, n_components > make_tagged_neighbors(const NeighborData< dim, NumberType, n_components > &neighbor_data, dealii::types::global_dof_index dof_j)
Definition reconstruction_cache.hh:828
FaceReconstructionState< dim, NumberType, n_components > reverse_face_reconstruction(const FaceReconstructionState< dim, NumberType, n_components > &state)
Definition reconstruction_cache.hh:74
FourPointStencil< dim, NumberType, n_components > make_interior_third_derivative_stencil(const CellStencilData< dim, NumberType, n_components > &minus_stencil, const CellStencilData< dim, NumberType, n_components > &plus_stencil, const dealii::Point< dim > &x_q)
Definition reconstruction_cache.hh:183
DiffusionFaceState< dim, NumberType, n_components > compute_diffusion_face_state(const CellStencilData< dim, NumberType, n_components > &minus_stencil, const CellStencilData< dim, NumberType, n_components > &plus_stencil)
Definition reconstruction_cache.hh:232
std::array< NumberType, n_components > reconstruct_u(const std::array< NumberType, n_components > &u_center, const dealii::Point< dim > &center, const dealii::Point< dim > &x, const GradientType< dim, NumberType, n_components > &u_grad)
Definition reconstruction_cache.hh:144
BoundaryStencilData< 2, NumberType, n_components > make_composed_corner_boundary_stencil(const BoundaryReconstructionStencilData< 2, NumberType, n_components > &boundary_reconstruction_stencil, const unsigned int result_face, const CellStencilData< 2, NumberType, n_components > &physical_stencil, const Model &model)
Definition reconstruction_cache.hh:516
void fill_cell_data_from_topology(const CellGeometryDofs< dim, n_components > &topology, const VectorType &solution_global, CellData< dim, NumberType, n_components > &data)
Definition reconstruction_cache.hh:252
BoundaryReconstructionStencilData< dim, BoundaryNumberType, n_components > fill_boundary_reconstruction_stencil_from_topology(const BoundaryReconstructionStencilTopologyData< dim, n_components > &topology, const VectorType &solution_global)
Definition reconstruction_cache.hh:396
void prepare_boundary_reconstruction_stencil(BoundaryStencilData< dim, NumberType, n_components > &, const CellStencilData< dim, NumberType, n_components > &, const dealii::Point< dim > &)
Definition reconstruction_cache.hh:467
std::array< NumberType, n_components > reconstruct_u_derivative(const std::array< autodiff::Real< 1, NumberType >, n_components > &u_center, const dealii::Point< dim > &center, const dealii::Point< dim > &x, const std::array< dealii::Point< dim >, 2 *dim > &x_n, const std::array< std::array< autodiff::Real< 1, NumberType >, n_components >, 2 *dim > &u_n)
Definition reconstruction_cache.hh:300
CellStencilData< dim, NumberType, n_components > make_boundary_side_stencil(const BoundaryStencilData< dim, NumberType, n_components > &boundary_stencil, const size_t center_index, const size_t left_index, const size_t right_index)
Definition reconstruction_cache.hh:424
constexpr size_t upper_outer
Definition fv_boundaries.hh:29
constexpr size_t lower_outer
Definition fv_boundaries.hh:25
constexpr size_t upper_inner
Definition fv_boundaries.hh:28
constexpr size_t lower_inner
Definition fv_boundaries.hh:26
constexpr size_t physical_cell
Definition fv_boundaries.hh:27
std::array< dealii::Tensor< 1, dim, NumberType >, n_components > GradientType
Per-component gradient type: one Tensor<1,dim> per solution component.
Definition types.hh:17
std::array< dealii::Tensor< 3, dim, NumberType >, n_components > ThirdDerivativeType
Per-component third spatial derivative type.
Definition types.hh:23
Definition complex_math.hh:10
BoundaryStencilData< dim, NumberType, n_components > primary
Definition reconstruction_cache.hh:352
std::array< bool, n_faces > corner_tangential_stencil_valid
Definition reconstruction_cache.hh:357
std::array< bool, n_faces > tangential_ghost_neighbor_valid
Definition reconstruction_cache.hh:354
std::array< std::array< BoundaryStencilData< dim, NumberType, n_components >, 3 >, n_faces > corner_tangential_stencils
Definition reconstruction_cache.hh:356
static constexpr size_t n_faces
Definition reconstruction_cache.hh:351
std::array< BoundaryStencilData< dim, NumberType, n_components >, n_faces > tangential_ghost_neighbors
Definition reconstruction_cache.hh:353
std::array< BoundaryStencilTopologyData< dim, n_components >, n_faces > tangential_ghost_neighbors
Definition reconstruction_cache.hh:363
BoundaryStencilTopologyData< dim, n_components > primary
Definition reconstruction_cache.hh:362
std::array< bool, n_faces > corner_tangential_stencil_valid
Definition reconstruction_cache.hh:367
static constexpr size_t n_faces
Definition reconstruction_cache.hh:361
std::array< bool, n_faces > tangential_ghost_neighbor_valid
Definition reconstruction_cache.hh:364
std::array< std::array< BoundaryStencilTopologyData< dim, n_components >, 3 >, n_faces > corner_tangential_stencils
Definition reconstruction_cache.hh:366
Definition reconstruction_cache.hh:325
unsigned int cell_face
Definition reconstruction_cache.hh:331
std::array< dealii::Point< dim >, stencil_size > x
Definition reconstruction_cache.hh:327
static constexpr size_t stencil_size
Definition reconstruction_cache.hh:326
bool lower_boundary
Definition reconstruction_cache.hh:330
size_t ghost_center
Definition reconstruction_cache.hh:333
size_t ghost_right
Definition reconstruction_cache.hh:335
dealii::Point< dim > face_center
Definition reconstruction_cache.hh:332
std::array< std::array< dealii::types::global_dof_index, n_components >, stencil_size > dof_indices
Definition reconstruction_cache.hh:329
size_t ghost_left
Definition reconstruction_cache.hh:334
std::array< std::array< NumberType, n_components >, stencil_size > u
Definition reconstruction_cache.hh:328
bool lower_boundary
Definition reconstruction_cache.hh:342
std::array< std::array< dealii::types::global_dof_index, n_components >, stencil_size > dof_indices
Definition reconstruction_cache.hh:341
std::array< dealii::Point< dim >, stencil_size > x
Definition reconstruction_cache.hh:340
static constexpr size_t stencil_size
Definition reconstruction_cache.hh:339
size_t ghost_center
Definition reconstruction_cache.hh:345
unsigned int cell_face
Definition reconstruction_cache.hh:343
size_t ghost_left
Definition reconstruction_cache.hh:346
dealii::Point< dim > face_center
Definition reconstruction_cache.hh:344
size_t ghost_right
Definition reconstruction_cache.hh:347
Definition reconstruction_cache.hh:94
std::array< NumberType, n_components > u
Definition reconstruction_cache.hh:96
std::array< dealii::types::global_dof_index, n_components > dof_indices
Definition reconstruction_cache.hh:97
dealii::Point< dim > x
Definition reconstruction_cache.hh:95
Definition reconstruction_cache.hh:100
dealii::Point< dim > x
Definition reconstruction_cache.hh:101
std::array< dealii::types::global_dof_index, n_components > dof_indices
Definition reconstruction_cache.hh:102
Definition reconstruction_cache.hh:118
static constexpr size_t n_faces
Definition reconstruction_cache.hh:119
NeighborData< dim, NumberType, n_components > neighbors
Definition reconstruction_cache.hh:121
CellData< dim, NumberType, n_components > cell
Definition reconstruction_cache.hh:120
std::array< dealii::types::boundary_id, n_faces > boundary_ids
Definition reconstruction_cache.hh:122
std::array< dealii::Point< dim >, n_faces > face_centers
Definition reconstruction_cache.hh:123
static constexpr size_t n_faces
Definition reconstruction_cache.hh:136
std::array< dealii::types::boundary_id, n_faces > boundary_ids
Definition reconstruction_cache.hh:139
NeighborTopologyData< dim, n_components > neighbors
Definition reconstruction_cache.hh:138
CellGeometryDofs< dim, n_components > cell
Definition reconstruction_cache.hh:137
std::array< dealii::Point< dim >, n_faces > face_centers
Definition reconstruction_cache.hh:140
ThirdDerivativeType< dim, NumberType, n_components > third_derivatives_minus
Definition reconstruction_cache.hh:68
GradientType< dim, NumberType, n_components > face_grad_plus
Definition reconstruction_cache.hh:61
std::array< NumberType, n_components > u_minus
Definition reconstruction_cache.hh:56
GradientType< dim, NumberType, n_components > center_grad_minus
Definition reconstruction_cache.hh:58
GradientType< dim, NumberType, n_components > diffusion_grad_plus
Definition reconstruction_cache.hh:65
std::array< NumberType, n_components > diffusion_u_plus
Definition reconstruction_cache.hh:63
GradientType< dim, NumberType, n_components > diffusion_grad_minus
Definition reconstruction_cache.hh:64
std::array< NumberType, n_components > diffusion_u
Definition reconstruction_cache.hh:66
GradientType< dim, NumberType, n_components > face_grad_minus
Definition reconstruction_cache.hh:60
std::array< NumberType, n_components > diffusion_u_minus
Definition reconstruction_cache.hh:62
GradientType< dim, NumberType, n_components > center_grad_plus
Definition reconstruction_cache.hh:59
std::array< NumberType, n_components > u_plus
Definition reconstruction_cache.hh:57
ThirdDerivativeType< dim, NumberType, n_components > third_derivatives_plus
Definition reconstruction_cache.hh:69
GradientType< dim, NumberType, n_components > diffusion_grad
Definition reconstruction_cache.hh:67
Definition reconstruction_cache.hh:158
std::array< dealii::Point< dim >, 4 > x
Definition reconstruction_cache.hh:159
std::array< std::array< NumberType, n_components >, 4 > u
Definition reconstruction_cache.hh:160
Definition reconstruction_cache.hh:105
static constexpr size_t n_faces
Definition reconstruction_cache.hh:106
std::array< dealii::Point< dim >, n_faces > x
Definition reconstruction_cache.hh:107
std::array< std::array< NumberType, n_components >, n_faces > u
Definition reconstruction_cache.hh:108
std::array< std::array< dealii::types::global_dof_index, n_components >, n_faces > dof_indices
Definition reconstruction_cache.hh:109
std::array< std::array< dealii::types::global_dof_index, n_components >, n_faces > dof_indices
Definition reconstruction_cache.hh:115
static constexpr size_t n_faces
Definition reconstruction_cache.hh:113
std::array< dealii::Point< dim >, n_faces > x
Definition reconstruction_cache.hh:114
std::vector< std::array< bool, n_faces > > face_reconstruction_valid
Definition reconstruction_cache.hh:131
std::vector< CellStencilData< dim, NumberType, n_components > > cell_stencils
Definition reconstruction_cache.hh:128
bool topology_initialized
Definition reconstruction_cache.hh:132
static constexpr size_t n_faces
Definition reconstruction_cache.hh:127
std::vector< std::array< FaceReconstructionState< dim, NumberType, n_components >, n_faces > > face_reconstructions
Definition reconstruction_cache.hh:130
Definition corrected_weighted_least_squares_reconstructor.hh:15