UpdateConservatives.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <tuple>
7 
10 #include "Utilities/Requires.hpp"
11 #include "Utilities/TMPL.hpp"
13 
14 /// \cond
15 namespace Parallel {
16 template <typename Metavariables>
17 class ConstGlobalCache;
18 } // namespace Parallel
19 // IWYU pragma: no_forward_declare db::DataBox
20 /// \endcond
21 
22 namespace Actions {
23 /// \ingroup ActionsGroup
24 /// \brief Compute the conservative variables from the primitive variables
25 ///
26 /// Uses:
27 /// - DataBox: Items in system::conservative_from_primitive::argument_tags
28 ///
29 /// DataBox changes:
30 /// - Adds: nothing
31 /// - Removes: nothing
32 /// - Modifies: Metavariables::system::conservative_from_primitive::return_tags
34  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
35  typename ArrayIndex, typename ActionList,
36  typename ParallelComponent,
38  static auto apply(db::DataBox<DbTagsList>& box,
39  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
41  const ArrayIndex& /*array_index*/,
42  const ActionList /*meta*/,
43  const ParallelComponent* const /*meta*/) noexcept {
44  using system = typename Metavariables::system;
46  typename system::conservative_from_primitive::return_tags,
47  typename system::conservative_from_primitive::argument_tags>(
48  typename system::conservative_from_primitive{}, make_not_null(&box));
49  return std::forward_as_tuple(std::move(box));
50  }
51 };
52 } // namespace Actions
Defines class tuples::TaggedTuple.
constexpr auto mutate_apply(F f, const gsl::not_null< DataBox< BoxTags > *> box, Args &&... args) noexcept(DataBox_detail::check_mutate_apply_mutate_tags(BoxTags{}, MutateTags{}) and DataBox_detail::check_mutate_apply_argument_tags(BoxTags{}, ArgumentTags{}) and noexcept(DataBox_detail::mutate_apply(f, box, MutateTags{}, ArgumentTags{}, std::forward< Args >(args)...)))
Apply the function f mutating items MutateTags and taking as additional arguments ArgumentTags and ar...
Definition: DataBox.hpp:1773
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
Defines the type alias Requires.
Compute the conservative variables from the primitive variables.
Definition: UpdateConservatives.hpp:33
constexpr auto apply(F &&f, const DataBox< BoxTags > &box, Args &&... args)
Apply the function f with argument Tags TagsList from DataBox box
Definition: DataBox.hpp:1595
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Defines classes and functions used for manipulating DataBox&#39;s.
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
A Charm++ chare that caches constant data once per Charm++ node.
Definition: ConstGlobalCache.hpp:76
The Poisson equation formulated as a set of coupled first-order PDEs.
Definition: FirstOrderSystem.hpp:55
Wraps the template metaprogramming library used (brigand)
gsl::not_null< T * > make_not_null(T *ptr) noexcept
Construct a not_null from a pointer. Often this will be done as an implicit conversion, but it may be necessary to perform the conversion explicitly when type deduction is desired.
Definition: Gsl.hpp:863
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t ...
Definition: Requires.hpp:67
Definition: SolvePoissonProblem.hpp:38
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Definition: ComputeTimeDerivative.hpp:28