BoundaryCorrection.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <memory>
8 #include <pup.h>
9 
10 #include "Evolution/Systems/GeneralizedHarmonic/BoundaryCorrections/BoundaryCorrection.hpp"
11 #include "Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryCorrections/BoundaryCorrection.hpp"
13 #include "Utilities/Gsl.hpp"
14 #include "Utilities/TMPL.hpp"
15 
16 /// Boundary corrections/numerical fluxes
18 /// \cond
19 template <typename DerivedGhCorrection, typename DerivedValenciaCorrection>
21 /// \endcond
22 
23 namespace detail {
24 template <typename GhList, typename ValenciaList>
25 struct AllProductCorrections;
26 
27 template <typename GhList, typename... ValenciaCorrections>
28 struct AllProductCorrections<GhList, tmpl::list<ValenciaCorrections...>> {
29  using type = tmpl::flatten<tmpl::list<
30  tmpl::transform<GhList, tmpl::bind<ProductOfCorrections, tmpl::_1,
31  tmpl::pin<ValenciaCorrections>>>...>>;
32 };
33 } // namespace detail
34 
35 /*!
36  * \brief The base class used to make boundary corrections factory createable so
37  * they can be specified in the input file.
38  */
39 class BoundaryCorrection : public PUP::able {
40  public:
41  BoundaryCorrection() = default;
42  BoundaryCorrection(const BoundaryCorrection&) = default;
43  BoundaryCorrection& operator=(const BoundaryCorrection&) = default;
45  BoundaryCorrection& operator=(BoundaryCorrection&&) = default;
46  ~BoundaryCorrection() override = default;
47 
48  /// \cond
49  explicit BoundaryCorrection(CkMigrateMessage* msg) noexcept
50  : PUP::able(msg) {}
52  /// \endcond
53 
54  using creatable_classes = typename detail::AllProductCorrections<
56  3_st>::creatable_classes,
57  typename grmhd::ValenciaDivClean::BoundaryCorrections::
58  BoundaryCorrection::creatable_classes>::type;
59 
60  virtual std::unique_ptr<BoundaryCorrection> get_clone() const noexcept = 0;
61 };
62 } // namespace grmhd::GhValenciaDivClean::BoundaryCorrections
CharmPupable.hpp
GeneralizedHarmonic::BoundaryCorrections::BoundaryCorrection
The base class used to make boundary corrections factory createable so they can be specified in the i...
Definition: BoundaryCorrection.hpp:25
grmhd::GhValenciaDivClean::BoundaryCorrections::BoundaryCorrection
The base class used to make boundary corrections factory createable so they can be specified in the i...
Definition: BoundaryCorrection.hpp:39
cstddef
grmhd::GhValenciaDivClean::BoundaryCorrections
Boundary corrections/numerical fluxes.
Definition: BoundaryCorrection.hpp:17
WRAPPED_PUPable_abstract
#define WRAPPED_PUPable_abstract(className)
Wraps the Charm++ macro, see the Charm++ documentation.
Definition: CharmPupable.hpp:41
memory
Gsl.hpp
grmhd::GhValenciaDivClean::BoundaryCorrections::ProductOfCorrections
Apply a boundary condition to the combined Generalized Harmonic (GH) and Valencia GRMHD system using ...
Definition: ProductOfCorrections.hpp:137
std::unique_ptr
TMPL.hpp