Dirichlet.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <limits>
7 #include <memory>
8 #include <optional>
9 #include <string>
10 
13 #include "Domain/BoundaryConditions/BoundaryCondition.hpp"
14 #include "Evolution/BoundaryConditions/Type.hpp"
15 #include "Evolution/Systems/Burgers/BoundaryConditions/BoundaryCondition.hpp"
16 #include "Evolution/Systems/Burgers/Tags.hpp"
17 #include "Options/Options.hpp"
19 #include "Utilities/Gsl.hpp"
20 #include "Utilities/TMPL.hpp"
21 
22 /// \cond
24 class Dirichlet;
25 } // namespace Burgers::boundary_conditions
26 class DataVector;
27 namespace PUP {
28 class er;
29 } // namespace PUP
30 template <typename>
31 class Variables;
32 /// \endcond
33 
35 class Dirichlet final : public BoundaryCondition {
36  private:
37  using flux_tag =
39 
40  public:
41  struct U {
42  using type = double;
43  static constexpr Options::String help{"The value for U on the boundary"};
44  };
45 
46  using options = tmpl::list<U>;
47  static constexpr Options::String help{
48  "Dirichlet boundary condition setting the value of U to "
49  "a time-independent constant."};
50 
51  Dirichlet(double u_value) noexcept;
52 
53  Dirichlet() = default;
54  Dirichlet(Dirichlet&&) noexcept = default;
55  Dirichlet& operator=(Dirichlet&&) noexcept = default;
56  Dirichlet(const Dirichlet&) = default;
57  Dirichlet& operator=(const Dirichlet&) = default;
58  ~Dirichlet() override = default;
59 
60  explicit Dirichlet(CkMigrateMessage* msg) noexcept;
61 
62  WRAPPED_PUPable_decl_base_template(BoundaryCondition, Dirichlet);
63 
64  auto get_clone() const noexcept -> std::unique_ptr<
65  domain::BoundaryConditions::BoundaryCondition> override;
66 
67  static constexpr evolution::BoundaryConditions::Type bc_type =
68  evolution::BoundaryConditions::Type::Ghost;
69 
70  void pup(PUP::er& p) override;
71 
72  using dg_interior_evolved_variables_tags = tmpl::list<>;
73  using dg_interior_temporary_tags = tmpl::list<>;
74  using dg_gridless_tags = tmpl::list<>;
75 
76  std::optional<std::string> dg_ghost(
77  gsl::not_null<Scalar<DataVector>*> u,
78  gsl::not_null<tnsr::I<DataVector, 1, Frame::Inertial>*> flux_u,
79  const std::optional<
80  tnsr::I<DataVector, 1, Frame::Inertial>>& /*face_mesh_velocity*/,
81  const tnsr::i<DataVector, 1, Frame::Inertial>& /*normal_covector*/)
82  const noexcept;
83 
84  private:
85  void dg_ghost_impl(
86  gsl::not_null<tnsr::I<DataVector, 1, Frame::Inertial>*> flux,
87  gsl::not_null<Scalar<DataVector>*> u) const noexcept;
88 
89  double u_value_ = std::numeric_limits<double>::signaling_NaN();
90 };
91 } // namespace Burgers::BoundaryConditions
Burgers::BoundaryConditions::Dirichlet
Definition: Dirichlet.hpp:35
CharmPupable.hpp
Frame::Inertial
Definition: IndexType.hpp:44
evolution
Functionality for evolving hyperbolic partial differential equations.
Definition: AddMeshVelocityNonconservative.hpp:29
Options.hpp
Burgers::BoundaryConditions
Boundary conditions for the Burgers system.
Definition: BoundaryCondition.hpp:21
elliptic::BoundaryConditionType::Dirichlet
@ Dirichlet
Dirichlet boundary conditions like .
Tags::Flux
Prefix indicating a flux.
Definition: Prefixes.hpp:40
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:46
memory
tnsr
Type aliases to construct common Tensors.
Definition: TypeAliases.hpp:31
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
limits
Gsl.hpp
TypeAliases.hpp
Options::String
const char *const String
The string used in option structs.
Definition: Options.hpp:32
Frame
Definition: IndexType.hpp:36
Burgers::BoundaryConditions::Dirichlet::U
Definition: Dirichlet.hpp:41
Burgers::BoundaryConditions::BoundaryCondition
The base class off of which all boundary conditions must inherit.
Definition: BoundaryCondition.hpp:23
optional
Prefixes.hpp
gsl
Implementations from the Guideline Support Library.
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:11
TMPL.hpp
string