MonotisedCentral.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 <memory>
10 #include <utility>
11 
12 #include "DataStructures/DataBox/PrefixHelpers.hpp"
14 #include "DataStructures/FixedHashMap.hpp"
16 #include "Domain/Structure/MaxNumberOfNeighbors.hpp"
17 #include "Domain/Tags.hpp"
18 #include "Evolution/DgSubcell/Tags/Inactive.hpp"
19 #include "Evolution/DgSubcell/Tags/Mesh.hpp"
20 #include "Evolution/DgSubcell/Tags/NeighborData.hpp"
21 #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp"
22 #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp"
23 #include "Options/Options.hpp"
25 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
26 #include "PointwiseFunctions/Hydro/Tags.hpp"
27 #include "Utilities/TMPL.hpp"
28 
29 /// \cond
30 class DataVector;
31 template <size_t Dim>
32 class Direction;
33 template <size_t Dim>
34 class Element;
35 template <size_t Dim>
36 class ElementId;
37 namespace EquationsOfState {
38 template <bool IsRelativistic, size_t ThermodynamicDim>
39 class EquationOfState;
40 } // namespace EquationsOfState
41 template <size_t Dim>
42 class Mesh;
43 namespace gsl {
44 template <typename T>
45 class not_null;
46 } // namespace gsl
47 namespace PUP {
48 class er;
49 } // namespace PUP
50 template <typename TagsList>
51 class Variables;
52 /// \endcond
53 
55 /*!
56  * \brief Monotised central reconstruction. See
57  * ::fd::reconstruction::monotised_central() for details.
58  */
60  private:
61  using prims_to_reconstruct_tags =
62  tmpl::list<hydro::Tags::RestMassDensity<DataVector>,
67 
68  public:
69  static constexpr size_t dim = 3;
70 
71  using options = tmpl::list<>;
72  static constexpr Options::String help{
73  "Monotised central reconstruction scheme using primitive variables."};
74 
75  MonotisedCentralPrim() = default;
76  MonotisedCentralPrim(MonotisedCentralPrim&&) noexcept = default;
77  MonotisedCentralPrim& operator=(MonotisedCentralPrim&&) noexcept = default;
79  MonotisedCentralPrim& operator=(const MonotisedCentralPrim&) = default;
80  ~MonotisedCentralPrim() override = default;
81 
82  explicit MonotisedCentralPrim(CkMigrateMessage* msg) noexcept;
83 
84  WRAPPED_PUPable_decl_base_template(Reconstructor, MonotisedCentralPrim);
85 
86  auto get_clone() const noexcept -> std::unique_ptr<Reconstructor> override;
87 
88  void pup(PUP::er& p) override;
89 
90  size_t ghost_zone_size() const noexcept override { return 2; }
91 
92  using reconstruction_argument_tags =
93  tmpl::list<::Tags::Variables<hydro::grmhd_tags<DataVector>>,
95  evolution::dg::subcell::Tags::
96  NeighborDataForReconstructionAndRdmpTci<dim>,
98 
99  template <size_t ThermodynamicDim, typename TagsList>
100  void reconstruct(
101  gsl::not_null<std::array<Variables<TagsList>, dim>*> vars_on_lower_face,
102  gsl::not_null<std::array<Variables<TagsList>, dim>*> vars_on_upper_face,
103  const Variables<hydro::grmhd_tags<DataVector>>& volume_prims,
105  const Element<dim>& element,
106  const FixedHashMap<
110  boost::hash<std::pair<Direction<dim>, ElementId<dim>>>>&
111  neighbor_data,
112  const Mesh<dim>& subcell_mesh) const noexcept;
113 
114  /// Called by an element doing DG when the neighbor is doing subcell.
115  template <size_t ThermodynamicDim, typename TagsList>
117  gsl::not_null<Variables<TagsList>*> vars_on_face,
118  const Variables<hydro::grmhd_tags<DataVector>>& subcell_volume_prims,
120  const Element<dim>& element,
121  const FixedHashMap<
125  boost::hash<std::pair<Direction<dim>, ElementId<dim>>>>&
126  neighbor_data,
127  const Mesh<dim>& subcell_mesh,
128  const Direction<dim> direction_to_reconstruct) const noexcept;
129 };
130 
131 bool operator==(const MonotisedCentralPrim& /*lhs*/,
132  const MonotisedCentralPrim& /*rhs*/) noexcept;
133 
134 bool operator!=(const MonotisedCentralPrim& lhs,
135  const MonotisedCentralPrim& rhs) noexcept;
136 } // namespace grmhd::ValenciaDivClean::fd
EquationsOfState
Contains all equations of state, including base class.
Definition: DarkEnergyFluid.hpp:26
hydro::Tags::Pressure
The fluid pressure .
Definition: Tags.hpp:119
maximum_number_of_neighbors
constexpr size_t maximum_number_of_neighbors(const size_t dim)
Definition: MaxNumberOfNeighbors.hpp:15
CharmPupable.hpp
utility
EquationsOfState::EquationOfState
Base class for equations of state depending on whether or not the system is relativistic,...
Definition: EquationOfState.hpp:63
std::pair
Options.hpp
Tags.hpp
domain::Tags::Element
Definition: Tags.hpp:97
hydro::Tags::DivergenceCleaningField
The divergence-cleaning field .
Definition: Tags.hpp:48
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
cstddef
array
grmhd::ValenciaDivClean::fd::Reconstructor
The base class from which all reconstruction schemes must inherit.
Definition: Reconstructor.hpp:20
grmhd::ValenciaDivClean::fd::MonotisedCentralPrim
Monotised central reconstruction. See fd::reconstruction::monotised_central() for details.
Definition: MonotisedCentral.hpp:59
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
grmhd::ValenciaDivClean::fd::MonotisedCentralPrim::reconstruct_fd_neighbor
void reconstruct_fd_neighbor(gsl::not_null< Variables< TagsList > * > vars_on_face, const Variables< hydro::grmhd_tags< DataVector >> &subcell_volume_prims, const EquationsOfState::EquationOfState< true, 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) const noexcept
Called by an element doing DG when the neighbor is doing subcell.
memory
evolution::dg::subcell::Tags::Mesh
The mesh on the subcells.
Definition: Mesh.hpp:19
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
hydro::Tags::LorentzFactorTimesSpatialVelocity
The Lorentz factor times the spatial velocity .
Definition: Tags.hpp:185
TypeAliases.hpp
hydro::Tags::EquationOfStateBase
Base tag for the equation of state.
Definition: Tags.hpp:53
Options::String
const char *const String
The string used in option structs.
Definition: Options.hpp:32
hydro::Tags::MagneticField
The magnetic field measured by an Eulerian observer, where is the normal to the spatial hypersurfac...
Definition: Tags.hpp:80
FixedHashMap
A hash table with a compile-time specified maximum size and ability to efficiently handle perfect has...
Definition: FixedHashMap.hpp:82
std::unique_ptr
Prefixes.hpp
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecPiecewisePolynomial.hpp:11
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13