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"
13 #include "Domain/Structure/MaxNumberOfNeighbors.hpp"
14 
15 /// \cond
16 template <typename TagsList>
17 class Variables;
18 namespace gsl {
19 template <typename>
20 class not_null;
21 } // namespace gsl
22 template <size_t Dim>
23 class Direction;
24 template <size_t Dim>
25 class ElementId;
26 template <size_t Dim>
27 class Element;
28 template <size_t Dim>
29 class Mesh;
30 namespace evolution::dg::subcell {
31 class NeighborData;
32 } // namespace evolution::dg::subcell
33 namespace EquationsOfState {
34 template <bool IsRelativistic, size_t ThermodynamicDim>
35 class EquationOfState;
36 } // namespace EquationsOfState
37 /// \endcond
38 
40 /*!
41  * \brief Reconstructs \f$\rho, p, u_i, B^i\f$, and \f$\Phi\f$, then computes
42  * the Lorentz factor, upper spatial velocity, specific internal energy,
43  * specific enthalpy, and the conserved variables. All results are written into
44  * `vars_on_lower_face` and `vars_on_upper_face`.
45  */
46 template <typename PrimsTags, typename TagsList, size_t ThermodynamicDim,
47  typename F>
49  gsl::not_null<std::array<Variables<TagsList>, 3>*> vars_on_lower_face,
50  gsl::not_null<std::array<Variables<TagsList>, 3>*> vars_on_upper_face,
51  const F& reconstruct, const Variables<PrimsTags>& volume_prims,
53  const Element<3>& element,
57  boost::hash<std::pair<Direction<3>, ElementId<3>>>>
58  neighbor_data,
59  const Mesh<3>& subcell_mesh, size_t ghost_zone_size) noexcept;
60 
61 /*!
62  * \brief Reconstructs the mass density, velocity, and pressure, then computes
63  * the specific internal energy and conserved variables. All results are written
64  * into `vars_on_face`.
65  *
66  * This is used on DG elements to reconstruct their subcell neighbors' solution
67  * on the shared faces.
68  */
69 template <typename TagsList, typename PrimsTags, size_t ThermodynamicDim,
70  typename F0, typename F1>
72  gsl::not_null<Variables<TagsList>*> vars_on_face,
73  const F0& reconstruct_lower_neighbor, const F1& reconstruct_upper_neighbor,
74  const Variables<PrimsTags>& subcell_volume_prims,
76  const Element<3>& element,
80  boost::hash<std::pair<Direction<3>, ElementId<3>>>>
81  neighbor_data,
82  const Mesh<3>& subcell_mesh, const Direction<3>& direction_to_reconstruct,
83  const size_t ghost_zone_size) noexcept;
84 } // namespace grmhd::ValenciaDivClean::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
grmhd::ValenciaDivClean::fd
Finite difference functionality for the ValenciaDivClean form of the GRMHD equations.
Definition: FiniteDifference.hpp:9
Direction
Definition: Direction.hpp:23
Element
Definition: Element.hpp:29
ElementId
An ElementId uniquely labels an Element.
Definition: ElementId.hpp:51
grmhd::ValenciaDivClean::fd::reconstruct_prims_work
void reconstruct_prims_work(gsl::not_null< std::array< Variables< TagsList >, 3 > * > vars_on_lower_face, gsl::not_null< std::array< Variables< TagsList >, 3 > * > vars_on_upper_face, const F &reconstruct, const Variables< PrimsTags > &volume_prims, const EquationsOfState::EquationOfState< true, ThermodynamicDim > &eos, const Element< 3 > &element, const FixedHashMap< maximum_number_of_neighbors(3)+1, std::pair< Direction< 3 >, ElementId< 3 >>, evolution::dg::subcell::NeighborData, boost::hash< std::pair< Direction< 3 >, ElementId< 3 >>>> neighbor_data, const Mesh< 3 > &subcell_mesh, size_t ghost_zone_size) noexcept
Reconstructs , and , then computes the Lorentz factor, upper spatial velocity, specific internal ener...
grmhd::ValenciaDivClean::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< true, ThermodynamicDim > &eos, const Element< 3 > &element, const FixedHashMap< maximum_number_of_neighbors(3)+1, std::pair< Direction< 3 >, ElementId< 3 >>, evolution::dg::subcell::NeighborData, boost::hash< std::pair< Direction< 3 >, ElementId< 3 >>>> neighbor_data, const Mesh< 3 > &subcell_mesh, const Direction< 3 > &direction_to_reconstruct, const size_t ghost_zone_size) noexcept
Reconstructs the mass density, velocity, and pressure, then computes the specific internal energy and...
cstddef
array
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
TypeAliases.hpp
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