Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstddef>
7 : #include <memory>
8 : #include <string>
9 : #include <unordered_map>
10 :
11 : #include "DataStructures/Tensor/TypeAliases.hpp"
12 :
13 : /// \cond
14 : class DataVector;
15 : template <size_t Dim>
16 : class Index;
17 : template <size_t Dim, typename Frame>
18 : class ElementMap;
19 : namespace gsl {
20 : template <typename T>
21 : class not_null;
22 : } // namespace gsl
23 : namespace Frame {
24 : struct Inertial;
25 : struct Grid;
26 : } // namespace Frame
27 : namespace domain {
28 : template <typename SourceFrame, typename TargetFrame, size_t Dim>
29 : class CoordinateMapBase;
30 : namespace FunctionsOfTime {
31 : class FunctionOfTime;
32 : } // namespace FunctionsOfTime
33 : } // namespace domain
34 : /// \endcond
35 :
36 : namespace evolution::dg::subcell {
37 : /// @{
38 : /*!
39 : * \brief Compute and add the 2nd-order flux divergence on a Cartesian mesh to
40 : * the cell-centered time derivatives.
41 : */
42 1 : void add_cartesian_flux_divergence(gsl::not_null<DataVector*> dt_var,
43 : double one_over_delta,
44 : const DataVector& det_inv_jacobian,
45 : const DataVector& boundary_correction,
46 : const Index<1>& subcell_extents,
47 : size_t dimension);
48 :
49 1 : void add_cartesian_flux_divergence(gsl::not_null<DataVector*> dt_var,
50 : double one_over_delta,
51 : const DataVector& det_inv_jacobian,
52 : const DataVector& boundary_correction,
53 : const Index<2>& subcell_extents,
54 : size_t dimension);
55 :
56 1 : void add_cartesian_flux_divergence(gsl::not_null<DataVector*> dt_var,
57 : double one_over_delta,
58 : const DataVector& det_inv_jacobian,
59 : const DataVector& boundary_correction,
60 : const Index<3>& subcell_extents,
61 : size_t dimension);
62 : /// @}
63 :
64 : /*!
65 : * \brief Compute and add the 2nd-order flux divergence on a Cartesian mesh to
66 : * the cell-centered time derivatives when some of the bases are Cartoon.
67 : *
68 : * \details Symmetries of your spacetime, used in the cartoon method, allow
69 : * the replacement of derivatives perpendicular to the computational domain by
70 : * scaled components of that same tensor. Specifically, for a spherically
71 : * symmetric system, this allows
72 : * \f[
73 : * \partial_t u + \partial_x F^x + \partial_y F^y + \partial_z F^z \Rightarrow
74 : * \partial_t u + \frac{1}{x^2} \partial_x \left( x^2 F^x \right),
75 : * \f]
76 : * and for an axially symmetric system,
77 : * \f[
78 : * \partial_t u + \partial_x F^x + \partial_y F^y + \partial_z F^z \Rightarrow
79 : * \partial_t u + \frac{1}{x} \partial_x \left( x F^x \right) + \partial_y F^y.
80 : * \f]
81 : *
82 : * \note This function will assume your basis is Cartoon by `subcell_extents ==
83 : * 1` in that dimension (only allowed in the second or third dimension).
84 : */
85 1 : void add_cartoon_cartesian_flux_divergence(
86 : gsl::not_null<DataVector*> dt_var, double one_over_delta,
87 : const DataVector& det_inv_jacobian, const DataVector& boundary_correction,
88 : const Index<3>& subcell_extents, size_t dimension,
89 : const tnsr::I<DataVector, 3, Frame::Inertial>& inertial_coords,
90 : const ElementMap<3, Frame::Grid>& logical_to_grid_map,
91 : const ::domain::CoordinateMapBase<Frame::Grid, Frame::Inertial, 3>&
92 : grid_to_inertial_map,
93 : double time,
94 : const std::unordered_map<
95 : std::string,
96 : std::unique_ptr<::domain::FunctionsOfTime::FunctionOfTime>>&
97 : functions_of_time);
98 : } // namespace evolution::dg::subcell
|