Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstdint>
7 : #include <type_traits>
8 :
9 : #include "Utilities/TMPL.hpp"
10 :
11 : /// \cond
12 : class AdaptiveSteppingDiagnostics;
13 : class TimeDelta;
14 : class TimeStepId;
15 : class TimeStepper;
16 : namespace Tags {
17 : struct AdaptiveSteppingDiagnostics;
18 : template <typename Tag>
19 : struct Next;
20 : struct StepperErrorEstimatesEnabled;
21 : struct StepNumberWithinSlab;
22 : struct Time;
23 : struct TimeStep;
24 : struct TimeStepId;
25 : template <typename StepperInterface>
26 : struct TimeStepper;
27 : } // namespace Tags
28 : namespace gsl {
29 : template <class T>
30 : class not_null;
31 : } // namespace gsl
32 : /// \endcond
33 :
34 : namespace AdvanceTime_detail {
35 : void apply(gsl::not_null<TimeStepId*> time_id,
36 : gsl::not_null<TimeStepId*> next_time_id,
37 : gsl::not_null<TimeDelta*> time_step, gsl::not_null<double*> time,
38 : gsl::not_null<uint64_t*> step_number_within_slab,
39 : gsl::not_null<AdaptiveSteppingDiagnostics*> diags,
40 : const TimeStepper& time_stepper, bool using_error_control);
41 : } // namespace AdvanceTime_detail
42 :
43 : /// \ingroup TimeGroup
44 : /// \brief Advance time one substep
45 : ///
46 : /// Replaces the time state with the `Tags::Next` values, advances the
47 : /// `Tags::Next` values, and sets `Tags::Time` to the new substep time.
48 : template <template <typename> typename CacheTagPrefix = std::type_identity_t>
49 1 : struct AdvanceTime {
50 0 : using return_tags =
51 : tmpl::list<Tags::TimeStepId, Tags::Next<Tags::TimeStepId>, Tags::TimeStep,
52 : Tags::Time, Tags::StepNumberWithinSlab,
53 : Tags::AdaptiveSteppingDiagnostics>;
54 0 : using argument_tags =
55 : tmpl::list<CacheTagPrefix<Tags::TimeStepper<TimeStepper>>,
56 : Tags::StepperErrorEstimatesEnabled>;
57 :
58 0 : static constexpr auto apply = &AdvanceTime_detail::apply;
59 : };
|