SpECTRE Documentation Coverage Report
Current view: top level - Time/TimeSteppers - Rk4Kennedy.hpp Hit Total Coverage
Commit: 47355bc26b45b897defe322cc093c7b7b3155e93 Lines: 6 21 28.6 %
Date: 2024-05-04 22:40:33
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 fourth-order Runge-Kutta method with IMEX support.
      17             :  *
      18             :  * The coefficients are given as ARK4(3)6L[2]SA in \cite Kennedy2003.
      19             :  *
      20             :  * The implicit part is stiffly accurate and L-stable.
      21             :  *
      22             :  * The CFL factor/stable step size is 2.1172491998184686.
      23             :  */
      24           1 : class Rk4Kennedy : public ImexRungeKutta {
      25             :  public:
      26           0 :   using options = tmpl::list<>;
      27           0 :   static constexpr Options::String help = {
      28             :       "A 4th-order Runge-Kutta scheme devised by Kennedy and Carpenter."};
      29             : 
      30           0 :   Rk4Kennedy() = default;
      31           0 :   Rk4Kennedy(const Rk4Kennedy&) = default;
      32           0 :   Rk4Kennedy& operator=(const Rk4Kennedy&) = default;
      33           0 :   Rk4Kennedy(Rk4Kennedy&&) = default;
      34           0 :   Rk4Kennedy& operator=(Rk4Kennedy&&) = default;
      35           0 :   ~Rk4Kennedy() override = default;
      36             : 
      37           1 :   size_t order() const override;
      38             : 
      39           1 :   size_t error_estimate_order() const override;
      40             : 
      41           1 :   double stable_step() const override;
      42             : 
      43           1 :   size_t imex_order() const override;
      44             : 
      45           1 :   size_t implicit_stage_order() const override;
      46             : 
      47           0 :   WRAPPED_PUPable_decl_template(Rk4Kennedy);  // NOLINT
      48             : 
      49           0 :   explicit Rk4Kennedy(CkMigrateMessage* /*unused*/) {}
      50             : 
      51           0 :   const ButcherTableau& butcher_tableau() const override;
      52             : 
      53           0 :   const ImplicitButcherTableau& implicit_butcher_tableau() const override;
      54             : };
      55             : 
      56           0 : inline bool constexpr operator==(const Rk4Kennedy& /*lhs*/,
      57             :                                  const Rk4Kennedy& /*rhs*/) {
      58             :   return true;
      59             : }
      60             : 
      61           0 : inline bool constexpr operator!=(const Rk4Kennedy& lhs, const Rk4Kennedy& rhs) {
      62             :   return not(lhs == rhs);
      63             : }
      64             : }  // namespace TimeSteppers

Generated by: LCOV version 1.14