Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <type_traits>
7 :
8 : #include "Utilities/TMPL.hpp"
9 : #include "Utilities/TypeTraits/IsA.hpp"
10 :
11 : /// \cond
12 : class TimeStepper;
13 : namespace Tags {
14 : template <typename StepperInterface>
15 : struct TimeStepper;
16 : template <typename Tag>
17 : struct HistoryEvolvedVariables;
18 : } // namespace Tags
19 : namespace TimeSteppers {
20 : template <typename Vars>
21 : class History;
22 : } // namespace TimeSteppers
23 : namespace gsl {
24 : template <class T>
25 : class not_null;
26 : } // namespace gsl
27 : /// \endcond
28 :
29 : /// \ingroup TimeGroup
30 : /// \brief Clean time stepper history after a substep
31 : /// @{
32 : template <typename System,
33 : template <typename> typename CacheTagPrefix = std::type_identity_t,
34 : typename = tmpl::conditional_t<
35 : tt::is_a_v<tmpl::list, typename System::variables_tag>,
36 : typename System::variables_tag,
37 : tmpl::list<typename System::variables_tag>>>
38 1 : struct CleanHistory;
39 :
40 : template <typename System, template <typename> typename CacheTagPrefix,
41 : typename... VariablesTags>
42 0 : struct CleanHistory<System, CacheTagPrefix, tmpl::list<VariablesTags...>> {
43 0 : using return_tags =
44 : tmpl::list<Tags::HistoryEvolvedVariables<VariablesTags>...>;
45 0 : using argument_tags =
46 : tmpl::list<CacheTagPrefix<Tags::TimeStepper<TimeStepper>>>;
47 :
48 0 : static void apply(
49 : const gsl::not_null<
50 : TimeSteppers::History<typename VariablesTags::type>*>... histories,
51 : const TimeStepper& time_stepper);
52 : };
53 : /// @}
|