11 #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" 29 template <
typename Tag,
size_t VolumeDim,
typename Fr>
46 tmpl::for_each<tags_list>([&result, &flux,
47 &normal ](
auto local_tag) noexcept {
48 using tensor_tag = tmpl::type_from<decltype(local_tag)>;
49 auto& result_tensor = get<NormalDotFlux<tensor_tag>>(result);
50 const auto& flux_tensor =
51 get<Flux<tensor_tag, tmpl::size_t<VolumeDim>, Fr>>(flux);
52 for (
auto it = result_tensor.begin(); it != result_tensor.end(); ++it) {
53 const auto result_indices = result_tensor.get_tensor_index(it);
54 for (
size_t d = 0; d < VolumeDim; ++d) {
55 *it += normal.get(d) * flux_tensor.get(
prepend(result_indices, d));
61 using argument_tags = tmpl::list<flux_tag, normal_tag>;
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:155
Define prefixes for DataBox tags.
constexpr std::array< T, Dim+1 > prepend(const std::array< T, Dim > &a, T value) noexcept
Construct an array from an existing array prepending a value.
Definition: StdArrayHelpers.hpp:132
std::remove_const_t< R > make_with_value(const T &input, const ValueType &value) noexcept
Given an object of type T, create an object of type R whose elements are initialized to value...
Definition: MakeWithValue.hpp:42
Declares function unnormalized_face_normal.
Wraps the template metaprogramming library used (brigand)
typename DataBox_detail::item_type_impl< TagList, Tag >::type item_type
Get the type that is returned by the Tag. If it is a base tag then a TagList must be passed as a seco...
Definition: DataBoxTag.hpp:410
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Defines arithmetic operators for std::array and other helpful functions.