SpECTRE Documentation Coverage Report
Current view: top level - Time/TimeSteppers - Rk3HesthavenSsp.hpp Hit Total Coverage
Commit: 9b01d30df5d2e946e7e38cc43c008be18ae9b1d2 Lines: 10 27 37.0 %
Date: 2024-04-23 04:54:49
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             : #include <cstdint>
       8             : 
       9             : #include "Options/String.hpp"
      10             : #include "Time/TimeStepId.hpp"
      11             : #include "Time/TimeSteppers/TimeStepper.hpp"
      12             : #include "Utilities/Gsl.hpp"
      13             : #include "Utilities/Serialization/CharmPupable.hpp"
      14             : #include "Utilities/TMPL.hpp"
      15             : 
      16             : /// \cond
      17             : class TimeDelta;
      18             : namespace TimeSteppers {
      19             : template <typename T>
      20             : class ConstUntypedHistory;
      21             : template <typename T>
      22             : class MutableUntypedHistory;
      23             : }  // namespace TimeSteppers
      24             : /// \endcond
      25             : 
      26             : namespace TimeSteppers {
      27             : 
      28             : /// \ingroup TimeSteppersGroup
      29             : ///
      30             : /// A "strong stability-preserving" 3rd-order Runge-Kutta
      31             : /// time-stepper, as described in \cite HesthavenWarburton section
      32             : /// 5.7.
      33             : ///
      34             : /// The CFL factor/stable step size is 1.25637266330916.
      35             : ///
      36             : /// \note The time stepper is only strong-stability-preserving for
      37             : /// time steps not exceeding 1.0, i.e., slightly less than 0.8 times
      38             : /// the stable step.
      39           1 : class Rk3HesthavenSsp : public TimeStepper {
      40             :  public:
      41           0 :   using options = tmpl::list<>;
      42           0 :   static constexpr Options::String help = {
      43             :       "A third-order strong stability-preserving Runge-Kutta time-stepper."};
      44             : 
      45           0 :   Rk3HesthavenSsp() = default;
      46           0 :   Rk3HesthavenSsp(const Rk3HesthavenSsp&) = default;
      47           0 :   Rk3HesthavenSsp& operator=(const Rk3HesthavenSsp&) = default;
      48           0 :   Rk3HesthavenSsp(Rk3HesthavenSsp&&) = default;
      49           0 :   Rk3HesthavenSsp& operator=(Rk3HesthavenSsp&&) = default;
      50           0 :   ~Rk3HesthavenSsp() override = default;
      51             : 
      52           0 :   WRAPPED_PUPable_decl_template(Rk3HesthavenSsp);  // NOLINT
      53             : 
      54           0 :   explicit Rk3HesthavenSsp(CkMigrateMessage* /*unused*/) {}
      55             : 
      56           1 :   size_t order() const override;
      57             : 
      58           1 :   size_t error_estimate_order() const override;
      59             : 
      60           1 :   double stable_step() const override;
      61             : 
      62           1 :   bool monotonic() const override;
      63             : 
      64           1 :   uint64_t number_of_substeps() const override;
      65             : 
      66           1 :   uint64_t number_of_substeps_for_error() const override;
      67             : 
      68           1 :   size_t number_of_past_steps() const override;
      69             : 
      70           1 :   TimeStepId next_time_id(const TimeStepId& current_id,
      71             :                           const TimeDelta& time_step) const override;
      72             : 
      73           1 :   TimeStepId next_time_id_for_error(const TimeStepId& current_id,
      74             :                                     const TimeDelta& time_step) const override;
      75             : 
      76             :  private:
      77             :   template <typename T>
      78           0 :   void update_u_impl(gsl::not_null<T*> u,
      79             :                      const MutableUntypedHistory<T>& history,
      80             :                      const TimeDelta& time_step) const;
      81             : 
      82             :   template <typename T>
      83           0 :   bool update_u_impl(gsl::not_null<T*> u, gsl::not_null<T*> u_error,
      84             :                      const MutableUntypedHistory<T>& history,
      85             :                      const TimeDelta& time_step) const;
      86             : 
      87             :   template <typename T>
      88           0 :   bool dense_update_u_impl(gsl::not_null<T*> u,
      89             :                            const ConstUntypedHistory<T>& history,
      90             :                            double time) const;
      91             : 
      92             :   template <typename T>
      93           0 :   bool can_change_step_size_impl(const TimeStepId& time_id,
      94             :                                  const ConstUntypedHistory<T>& history) const;
      95             : 
      96             :   TIME_STEPPER_DECLARE_OVERLOADS
      97             : };
      98             : 
      99           0 : inline bool constexpr operator==(const Rk3HesthavenSsp& /*lhs*/,
     100             :                                  const Rk3HesthavenSsp& /*rhs*/) {
     101             :   return true;
     102             : }
     103             : 
     104           0 : inline bool constexpr operator!=(const Rk3HesthavenSsp& /*lhs*/,
     105             :                                  const Rk3HesthavenSsp& /*rhs*/) {
     106             :   return false;
     107             : }
     108             : }  // namespace TimeSteppers

Generated by: LCOV version 1.14