Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <optional>
7 : #include <tuple>
8 :
9 : #include "DataStructures/DataBox/DataBox.hpp"
10 : #include "DataStructures/TaggedTuple.hpp"
11 : #include "Parallel/AlgorithmExecution.hpp"
12 : #include "Utilities/Requires.hpp"
13 : #include "Utilities/TMPL.hpp"
14 :
15 : /// \cond
16 : namespace Parallel {
17 : template <typename Metavariables>
18 : class GlobalCache;
19 : } // namespace Parallel
20 :
21 : /// \endcond
22 :
23 1 : namespace Actions {
24 : /// \ingroup ActionsGroup
25 : /// \brief Compute the conservative variables from the primitive variables
26 : ///
27 : /// Uses:
28 : /// - DataBox: Items in system::conservative_from_primitive::argument_tags
29 : ///
30 : /// DataBox changes:
31 : /// - Adds: nothing
32 : /// - Removes: nothing
33 : /// - Modifies: Metavariables::system::conservative_from_primitive::return_tags
34 1 : struct UpdateConservatives {
35 : template <typename DbTagsList, typename... InboxTags, typename Metavariables,
36 : typename ArrayIndex, typename ActionList,
37 : typename ParallelComponent,
38 : Requires<tmpl::size<DbTagsList>::value != 0> = nullptr>
39 0 : static Parallel::iterable_action_return_t apply(
40 : db::DataBox<DbTagsList>& box,
41 : const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
42 : const Parallel::GlobalCache<Metavariables>& /*cache*/,
43 : const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
44 : const ParallelComponent* const /*meta*/) {
45 : db::mutate_apply<
46 : typename Metavariables::system::conservative_from_primitive>(
47 : make_not_null(&box));
48 : return {Parallel::AlgorithmExecution::Continue, std::nullopt};
49 : }
50 : };
51 : } // namespace Actions
|