Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <array>
7 : #include <cstddef>
8 : #include <memory>
9 : #include <utility>
10 :
11 : #include "DataStructures/DataBox/Prefixes.hpp"
12 : #include "DataStructures/Tensor/TypeAliases.hpp"
13 : #include "DataStructures/VariablesTag.hpp"
14 : #include "Domain/Structure/DirectionalIdMap.hpp"
15 : #include "Domain/Structure/Element.hpp"
16 : #include "Domain/Tags.hpp"
17 : #include "Evolution/DgSubcell/Tags/GhostDataForReconstruction.hpp"
18 : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
19 : #include "Evolution/Systems/ScalarAdvection/FiniteDifference/Reconstructor.hpp"
20 : #include "Evolution/Systems/ScalarAdvection/Tags.hpp"
21 : #include "Options/String.hpp"
22 : #include "Utilities/TMPL.hpp"
23 :
24 : /// \cond
25 : class DataVector;
26 : template <size_t Dim>
27 : class Direction;
28 : template <size_t Dim>
29 : class Element;
30 : template <size_t Dim>
31 : class ElementId;
32 : template <size_t Dim>
33 : class Mesh;
34 : template <typename TagsList>
35 : class Variables;
36 : namespace gsl {
37 : template <typename>
38 : class not_null;
39 : } // namespace gsl
40 : namespace PUP {
41 : class er;
42 : } // namespace PUP
43 : namespace evolution::dg::subcell {
44 : class GhostData;
45 : } // namespace evolution::dg::subcell
46 : /// \endcond
47 :
48 : namespace ScalarAdvection::fd {
49 : /*!
50 : * \brief Monotonised central reconstruction. See
51 : * ::fd::reconstruction::monotonised_central() for details.
52 : */
53 : template <size_t Dim>
54 1 : class MonotonisedCentral : public Reconstructor<Dim> {
55 : private:
56 0 : using volume_vars_tags = tmpl::list<ScalarAdvection::Tags::U>;
57 :
58 : public:
59 0 : using options = tmpl::list<>;
60 0 : static constexpr Options::String help{
61 : "Monotonised central reconstruction scheme."};
62 :
63 0 : MonotonisedCentral() = default;
64 0 : MonotonisedCentral(MonotonisedCentral&&) = default;
65 0 : MonotonisedCentral& operator=(MonotonisedCentral&&) = default;
66 0 : MonotonisedCentral(const MonotonisedCentral&) = default;
67 0 : MonotonisedCentral& operator=(const MonotonisedCentral&) = default;
68 0 : ~MonotonisedCentral() override = default;
69 :
70 0 : void pup(PUP::er& p) override;
71 :
72 : /// \cond
73 : explicit MonotonisedCentral(CkMigrateMessage* msg);
74 : WRAPPED_PUPable_decl_base_template(Reconstructor<Dim>, MonotonisedCentral);
75 : /// \endcond
76 :
77 0 : auto get_clone() const -> std::unique_ptr<Reconstructor<Dim>> override;
78 :
79 0 : size_t ghost_zone_size() const override { return 2; }
80 :
81 0 : using reconstruction_argument_tags =
82 : tmpl::list<::Tags::Variables<volume_vars_tags>,
83 : domain::Tags::Element<Dim>,
84 : evolution::dg::subcell::Tags::GhostDataForReconstruction<Dim>,
85 : evolution::dg::subcell::Tags::Mesh<Dim>>;
86 :
87 : template <typename TagsList>
88 0 : void reconstruct(
89 : gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_lower_face,
90 : gsl::not_null<std::array<Variables<TagsList>, Dim>*> vars_on_upper_face,
91 : const Variables<tmpl::list<ScalarAdvection::Tags::U>>& volume_vars,
92 : const Element<Dim>& element,
93 : const DirectionalIdMap<Dim, evolution::dg::subcell::GhostData>&
94 : ghost_data,
95 : const Mesh<Dim>& subcell_mesh) const;
96 :
97 : template <typename TagsList>
98 0 : void reconstruct_fd_neighbor(
99 : gsl::not_null<Variables<TagsList>*> vars_on_face,
100 : const Variables<tmpl::list<ScalarAdvection::Tags::U>>& volume_vars,
101 : const Element<Dim>& element,
102 : const DirectionalIdMap<Dim, evolution::dg::subcell::GhostData>&
103 : ghost_data,
104 : const Mesh<Dim>& subcell_mesh,
105 : const Direction<Dim> direction_to_reconstruct) const;
106 : };
107 :
108 : template <size_t Dim>
109 0 : bool operator==(const MonotonisedCentral<Dim>& /*lhs*/,
110 : const MonotonisedCentral<Dim>& /*rhs*/);
111 :
112 : template <size_t Dim>
113 0 : bool operator!=(const MonotonisedCentral<Dim>& lhs,
114 : const MonotonisedCentral<Dim>& rhs);
115 : } // namespace ScalarAdvection::fd
|