UpdateM1Closure.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <tuple>
7 
11 #include "Utilities/Requires.hpp"
12 #include "Utilities/TMPL.hpp"
14 
15 /// \cond
16 namespace Parallel {
17 template <typename Metavariables>
18 class ConstGlobalCache;
19 } // namespace Parallel
20 // IWYU pragma: no_forward_declare db::DataBox
21 /// \endcond
22 
23 namespace Actions {
24 
25 /// \ingroup ActionsGroup
26 /// \brief Compute the M1 closure and derived neutrino moments
27 ///
28 /// \note `Metavariables` must specify a
29 /// `list_of_neutrino_species`.
30 ///
31 /// Uses:
32 /// - DataBox: Items in RadiationTransport::M1Grey::M1Closure::argument_tags
33 ///
34 /// DataBox changes:
35 /// - Adds: nothing
36 /// - Removes: nothing
37 /// - Modifies: RadiationTransport::M1Grey::M1Closure::return_tags
39  template <typename DbTagsList, typename... InboxTags, typename Metavariables,
40  typename ArrayIndex, typename ActionList,
41  typename ParallelComponent,
43  static auto apply(db::DataBox<DbTagsList>& box,
44  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
46  const ArrayIndex& /*array_index*/,
47  const ActionList /*meta*/,
48  const ParallelComponent* const /*meta*/) noexcept {
49  using Closure = typename RadiationTransport::M1Grey::ComputeM1Closure<
50  typename Metavariables::neutrino_species>;
51  db::mutate_apply<Closure>(make_not_null(&box));
52  return std::forward_as_tuple(std::move(box));
53  }
54 };
55 } // namespace Actions
Defines class tuples::TaggedTuple.
Defines functions to compute the M1 closure.
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
Defines the type alias Requires.
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:1610
Compute the M1 closure and derived neutrino moments.
Definition: UpdateM1Closure.hpp:38
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
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
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Definition: ComputeTimeDerivative.hpp:28