SpECTRE Documentation Coverage Report
 Current view: top level - Evolution/Systems/Burgers/BoundaryCorrections - Rusanov.hpp Hit Total Coverage Commit: edb1b5199a4a86c269aedbb831767801169f3e8a Lines: 1 19 5.3 % Date: 2021-04-19 16:23:01 Legend: Lines: hit not hit
  Line data Source code  1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include 7 : #include 8 : 9 : #include "DataStructures/DataBox/Prefixes.hpp" 10 : #include "DataStructures/Tensor/TypeAliases.hpp" 11 : #include "Evolution/Systems/Burgers/BoundaryCorrections/BoundaryCorrection.hpp" 12 : #include "Evolution/Systems/Burgers/Tags.hpp" 13 : #include "NumericalAlgorithms/DiscontinuousGalerkin/Formulation.hpp" 14 : #include "Options/Options.hpp" 15 : #include "Parallel/CharmPupable.hpp" 16 : #include "Utilities/TMPL.hpp" 17 : 18 : /// \cond 19 : class DataVector; 20 : namespace gsl { 21 : template 22 : class not_null; 23 : } // namespace gsl 24 : namespace PUP { 25 : class er; 26 : } // namespace PUP 27 : /// \endcond 28 : 29 : namespace Burgers::BoundaryCorrections { 30 : /*! 31 : * \brief A Rusanov/local Lax-Friedrichs Riemann solver 32 : * 33 : * Let \f$U\f$ be the evolved variable, \f$F^i\f$ the flux, and \f$n_i\f$ be 34 : * the outward directed unit normal to the interface. Denoting \f$F := n_i 35 : * F^i\f$, the %Rusanov boundary correction is 36 : * 37 : * \f{align*} 38 : * G_\text{Rusanov} = \frac{F_\text{int} - F_\text{ext}}{2} - 39 : * \frac{\text{max}\left(|U_\text{int}|, |U_\text{ext}|\right)}{2} 40 : * \left(U_\text{ext} - U_\text{int}\right), 41 : * \f} 42 : * 43 : * where "int" and "ext" stand for interior and exterior. The minus sign in 44 : * front of the \f$F_{\text{ext}}\f$ is necessary because the outward directed 45 : * normal of the neighboring element has the opposite sign, i.e. 46 : * \f$n_i^{\text{ext}}=-n_i^{\text{int}}\f$. 47 : * 48 : * \note In the strong form the dg_boundary_terms function returns 49 : * \f$G - F_\text{int}\f$ 50 : */ 51 1 : class Rusanov final : public BoundaryCorrection { 52 : private: 53 0 : struct AbsCharSpeed : db::SimpleTag { 54 0 : using type = Scalar; 55 : }; 56 : 57 : public: 58 0 : using options = tmpl::list<>; 59 0 : static constexpr Options::String help = { 60 : "Computes the Rusanov or local Lax-Friedrichs boundary correction term " 61 : "for the Burgers system."}; 62 : 63 0 : Rusanov() = default; 64 0 : Rusanov(const Rusanov&) = default; 65 0 : Rusanov& operator=(const Rusanov&) = default; 66 0 : Rusanov(Rusanov&&) = default; 67 0 : Rusanov& operator=(Rusanov&&) = default; 68 0 : ~Rusanov() override = default; 69 : 70 : /// \cond 71 : explicit Rusanov(CkMigrateMessage* msg) noexcept; 72 : using PUP::able::register_constructor; 73 : WRAPPED_PUPable_decl_template(Rusanov); // NOLINT 74 : /// \endcond 75 0 : void pup(PUP::er& p) override; // NOLINT 76 : 77 0 : std::unique_ptr get_clone() const noexcept override; 78 : 79 0 : using dg_package_field_tags = 80 : tmpl::list, AbsCharSpeed>; 81 0 : using dg_package_data_temporary_tags = tmpl::list<>; 82 0 : using dg_package_data_volume_tags = tmpl::list<>; 83 : 84 0 : static double dg_package_data( 85 : gsl::not_null*> packaged_u, 86 : gsl::not_null*> packaged_normal_dot_flux, 87 : gsl::not_null*> packaged_abs_char_speed, 88 : const Scalar& u, 89 : const tnsr::I& flux_u, 90 : const tnsr::i& normal_covector, 91 : const std::optional>& 92 : mesh_velocity, 93 : const std::optional>& 94 : normal_dot_mesh_velocity) noexcept; 95 : 96 0 : static void dg_boundary_terms( 97 : gsl::not_null*> boundary_correction_u, 98 : const Scalar& u_int, 99 : const Scalar& normal_dot_flux_u_int, 100 : const Scalar& abs_char_speed_int, 101 : const Scalar& u_ext, 102 : const Scalar& normal_dot_flux_u_ext, 103 : const Scalar& abs_char_speed_ext, 104 : dg::Formulation dg_formulation) noexcept; 105 : }; 106 : } // namespace Burgers::BoundaryCorrections 

 Generated by: LCOV version 1.14