SpECTRE Documentation Coverage Report
Current view: top level - Time/TimeSteppers - Rk3Pareschi.hpp Hit Total Coverage
Commit: a9ee6aa7c65ba703dbdc6dfb79436bb5378d4465 Lines: 6 21 28.6 %
Date: 2024-05-05 02:31:09
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 <cstddef>
       7             : 
       8             : #include "Options/String.hpp"
       9             : #include "Time/TimeSteppers/ImexRungeKutta.hpp"
      10             : #include "Utilities/Serialization/CharmPupable.hpp"
      11             : #include "Utilities/TMPL.hpp"
      12             : 
      13             : namespace TimeSteppers {
      14             : /*!
      15             :  * \ingroup TimeSteppersGroup
      16             :  * \brief A third-order Runge-Kutta method with IMEX support.
      17             :  *
      18             :  * The method as published has four stages, but is implemented with
      19             :  * five as a way to convert it to an EDIRK method.
      20             :  *
      21             :  * The coefficients are given as IMEX-SSP3(4,3,3) in \cite Pareschi2005.
      22             :  *
      23             :  * While this method can be implemented so that the explicit part is
      24             :  * strong-stability-preserving, the presentation in \cite Pareschi2005
      25             :  * is not, and this implementation follows that presentation.  See
      26             :  * \cite HesthavenWarburton section 5.7 for details.
      27             :  *
      28             :  * Using this time stepper in a non-IMEX simulation is not
      29             :  * recommended, as it performs two unused RHS evaluations.  When using
      30             :  * IMEX it performs one extra evaluation because there are more
      31             :  * implicit steps than explicit.
      32             :  *
      33             :  * The implicit portion is L-stable.
      34             :  *
      35             :  * The CFL factor/stable step size is 1.25637.
      36             :  */
      37           1 : class Rk3Pareschi : public ImexRungeKutta {
      38             :  public:
      39           0 :   using options = tmpl::list<>;
      40           0 :   static constexpr Options::String help = {
      41             :       "A 3rd-order 4 stage Runge-Kutta scheme devised by Pareschi and Russo."};
      42             : 
      43           0 :   Rk3Pareschi() = default;
      44           0 :   Rk3Pareschi(const Rk3Pareschi&) = default;
      45           0 :   Rk3Pareschi& operator=(const Rk3Pareschi&) = default;
      46           0 :   Rk3Pareschi(Rk3Pareschi&&) = default;
      47           0 :   Rk3Pareschi& operator=(Rk3Pareschi&&) = default;
      48           0 :   ~Rk3Pareschi() override = default;
      49             : 
      50           1 :   size_t order() const override;
      51             : 
      52           1 :   size_t error_estimate_order() const override;
      53             : 
      54           1 :   double stable_step() const override;
      55             : 
      56           1 :   size_t imex_order() const override;
      57             : 
      58           1 :   size_t implicit_stage_order() const override;
      59             : 
      60           0 :   WRAPPED_PUPable_decl_template(Rk3Pareschi);  // NOLINT
      61             : 
      62           0 :   explicit Rk3Pareschi(CkMigrateMessage* /*unused*/) {}
      63             : 
      64           0 :   const ButcherTableau& butcher_tableau() const override;
      65             : 
      66           0 :   const ImplicitButcherTableau& implicit_butcher_tableau() const override;
      67             : };
      68             : 
      69           0 : inline bool constexpr operator==(const Rk3Pareschi& /*lhs*/,
      70             :                                  const Rk3Pareschi& /*rhs*/) {
      71             :   return true;
      72             : }
      73             : 
      74           0 : inline bool constexpr operator!=(const Rk3Pareschi& lhs,
      75             :                                  const Rk3Pareschi& rhs) {
      76             :   return not(lhs == rhs);
      77             : }
      78             : }  // namespace TimeSteppers

Generated by: LCOV version 1.14