TakeStep.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
8 #include "Time/Actions/ChangeStepSize.hpp"
9 #include "Time/Actions/RecordTimeStepperData.hpp"
10 #include "Time/Actions/UpdateU.hpp"
11 #include "Utilities/Gsl.hpp"
12 
13 /// Bundled method for recording the current system state in the history, and
14 /// updating the evolved variables and step size.
15 ///
16 /// This function is used to encapsulate any needed logic for updating the
17 /// system, and in the case for which step parameters may need to be rejected
18 /// and re-tried, looping until an acceptable step is performed.
19 template <typename VariablesTag = NoSuchType, typename DbTags,
20  typename Metavariables>
21 void take_step(const gsl::not_null<db::DataBox<DbTags>*> box,
23  record_time_stepper_data<typename Metavariables::system, VariablesTag>(box);
24  do {
25  update_u<typename Metavariables::system, VariablesTag>(box);
26  } while (Metavariables::local_time_stepping and
27  not change_step_size(box, cache));
28 }
NoSuchType
Used to mark "no type" or "bad state" for metaprogramming.
Definition: NoSuchType.hpp:10
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:15
GlobalCache.hpp
DataBox.hpp
ActionTesting::cache
Parallel::GlobalCache< Metavariables > & cache(MockRuntimeSystem< Metavariables > &runner, const ArrayIndex &array_index) noexcept
Returns the GlobalCache of Component with index array_index.
Definition: MockRuntimeSystemFreeFunctions.hpp:382
Gsl.hpp
UpdateU.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13