SpECTRE Documentation Coverage Report
Current view: top level - Time/TimeSteppers - Rk3Kennedy.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 coefficients are given as ARK3(2)4L[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 1.832102281377816.
      23             :  */
      24           1 : class Rk3Kennedy : public ImexRungeKutta {
      25             :  public:
      26           0 :   using options = tmpl::list<>;
      27           0 :   static constexpr Options::String help = {
      28             :       "A 3rd-order Runge-Kutta scheme devised by Kennedy and Carpenter."};
      29             : 
      30           0 :   Rk3Kennedy() = default;
      31           0 :   Rk3Kennedy(const Rk3Kennedy&) = default;
      32           0 :   Rk3Kennedy& operator=(const Rk3Kennedy&) = default;
      33           0 :   Rk3Kennedy(Rk3Kennedy&&) = default;
      34           0 :   Rk3Kennedy& operator=(Rk3Kennedy&&) = default;
      35           0 :   ~Rk3Kennedy() 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(Rk3Kennedy);  // NOLINT
      48             : 
      49           0 :   explicit Rk3Kennedy(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 Rk3Kennedy& /*lhs*/,
      57             :                                  const Rk3Kennedy& /*rhs*/) {
      58             :   return true;
      59             : }
      60             : 
      61           0 : inline bool constexpr operator!=(const Rk3Kennedy& lhs, const Rk3Kennedy& rhs) {
      62             :   return not(lhs == rhs);
      63             : }
      64             : }  // namespace TimeSteppers

Generated by: LCOV version 1.14