ReconstructWork.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <array>
7 #include <boost/functional/hash.hpp>
8 #include <cstddef>
9 #include <utility>
10 
11 #include "DataStructures/FixedHashMap.hpp"
12 #include "Domain/Structure/MaxNumberOfNeighbors.hpp"
13 
14 /// \cond
15 template <typename TagsList>
16 class Variables;
17 namespace gsl {
18 template <typename>
19 class not_null;
20 } // namespace gsl
21 template <size_t Dim>
22 class Direction;
23 template <size_t Dim>
24 class ElementId;
25 template <size_t Dim>
26 class Element;
27 template <size_t Dim>
28 class Mesh;
29 namespace evolution::dg::subcell {
30 class NeighborData;
31 } // namespace evolution::dg::subcell
32 namespace EquationsOfState {
33 template <bool IsRelativistic, size_t ThermodynamicDim>
34 class EquationOfState;
35 } // namespace EquationsOfState
36 /// \endcond
37 
38 namespace NewtonianEuler::fd {
39 /*!
40  * \brief Reconstructs the mass density, velocity, and pressure, then computes
41  * the specific internal energy and conserved variables. All results are written
42  * into `vars_on_lower_face` and `vars_on_upper_face`.
43  */
44 template <typename PrimsTags, typename TagsList, size_t Dim,
45  size_t ThermodynamicDim, typename F>
47  gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_lower_face,
48  gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_upper_face,
49  const F& reconstruct, const Variables<PrimsTags>& volume_prims,
51  const Element<Dim>& element,
56  neighbor_data,
57  const Mesh<Dim>& subcell_mesh, size_t ghost_zone_size) noexcept;
58 
59 /*!
60  * \brief Reconstructs the mass density, velocity, and pressure, then computes
61  * the specific internal energy and conserved variables. All results are written
62  * into `vars_on_face`.
63  *
64  * This is used on DG elements to reconstruct their subcell neighbors' solution
65  * on the shared faces.
66  */
67 template <typename TagsList, typename PrimsTags, size_t Dim,
68  size_t ThermodynamicDim, typename F0, typename F1>
70  gsl::not_null<Variables<TagsList>*> vars_on_face,
71  const F0& reconstruct_lower_neighbor, const F1& reconstruct_upper_neighbor,
72  const Variables<PrimsTags>& subcell_volume_prims,
74  const Element<Dim>& element,
79  neighbor_data,
80  const Mesh<Dim>& subcell_mesh,
81  const Direction<Dim>& direction_to_reconstruct,
82  size_t ghost_zone_size) noexcept;
83 } // namespace NewtonianEuler::fd
EquationsOfState
Contains all equations of state, including base class.
Definition: DarkEnergyFluid.hpp:26
maximum_number_of_neighbors
constexpr size_t maximum_number_of_neighbors(const size_t dim)
Definition: MaxNumberOfNeighbors.hpp:15
utility
EquationsOfState::EquationOfState
Base class for equations of state depending on whether or not the system is relativistic,...
Definition: EquationOfState.hpp:63
std::pair
NewtonianEuler::fd::reconstruct_fd_neighbor_work
void reconstruct_fd_neighbor_work(gsl::not_null< Variables< TagsList > * > vars_on_face, const F0 &reconstruct_lower_neighbor, const F1 &reconstruct_upper_neighbor, const Variables< PrimsTags > &subcell_volume_prims, const EquationsOfState::EquationOfState< false, ThermodynamicDim > &eos, const Element< Dim > &element, const FixedHashMap< maximum_number_of_neighbors(Dim)+1, std::pair< Direction< Dim >, ElementId< Dim >>, evolution::dg::subcell::NeighborData, boost::hash< std::pair< Direction< Dim >, ElementId< Dim >>>> neighbor_data, const Mesh< Dim > &subcell_mesh, const Direction< Dim > &direction_to_reconstruct, size_t ghost_zone_size) noexcept
Reconstructs the mass density, velocity, and pressure, then computes the specific internal energy and...
NewtonianEuler::fd::reconstruct_prims_work
void reconstruct_prims_work(gsl::not_null< std::array< Variables< TagsList >, Dim > * > vars_on_lower_face, gsl::not_null< std::array< Variables< TagsList >, Dim > * > vars_on_upper_face, const F &reconstruct, const Variables< PrimsTags > &volume_prims, const EquationsOfState::EquationOfState< false, ThermodynamicDim > &eos, const Element< Dim > &element, const FixedHashMap< maximum_number_of_neighbors(Dim)+1, std::pair< Direction< Dim >, ElementId< Dim >>, evolution::dg::subcell::NeighborData, boost::hash< std::pair< Direction< Dim >, ElementId< Dim >>>> neighbor_data, const Mesh< Dim > &subcell_mesh, size_t ghost_zone_size) noexcept
Reconstructs the mass density, velocity, and pressure, then computes the specific internal energy and...
Direction
Definition: Direction.hpp:23
Element
Definition: Element.hpp:29
ElementId
An ElementId uniquely labels an Element.
Definition: ElementId.hpp:51
cstddef
array
NewtonianEuler::fd
Finite difference functionality for Newtonian Euler.
Definition: AoWeno.hpp:25
Mesh
Holds the number of grid points, basis, and quadrature in each direction of the computational grid.
Definition: Mesh.hpp:49
evolution::dg::subcell::NeighborData
Holds neighbor data needed for the TCI and reconstruction.
Definition: NeighborData.hpp:24
evolution::dg::subcell
Implementation of a generic finite volume/conservative finite difference subcell limiter.
Definition: Actions.hpp:6
FixedHashMap
A hash table with a compile-time specified maximum size and ability to efficiently handle perfect has...
Definition: FixedHashMap.hpp:82
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecPiecewisePolynomial.hpp:11
evolution::dg::subcell::fd::reconstruct
DataVector reconstruct(const DataVector &subcell_u_times_projected_det_jac, const Mesh< Dim > &dg_mesh, const Index< Dim > &subcell_extents) noexcept
reconstruct the variable subcell_u_times_projected_det_jac onto the DG grid dg_mesh.
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13