ComputeTags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
9 #include "Domain/Tags.hpp"
10 #include "Time/Tags.hpp"
11 #include "Utilities/TMPL.hpp"
12 
13 namespace evolution {
14 namespace Tags {
15 /*!
16  * \brief Use the `AnalyticSolutionTag` to compute the analytic solution of the
17  * tags in `AnalyticFieldsTagList`.
18  */
19 template <size_t Dim, typename AnalyticSolutionTag,
20  typename AnalyticFieldsTagList>
22  : db::add_tag_prefix<::Tags::Analytic,
23  ::Tags::Variables<AnalyticFieldsTagList>>,
27  using argument_tags =
28  tmpl::list<AnalyticSolutionTag, ::Tags::Coordinates<Dim, Frame::Inertial>,
29  ::Tags::Time>;
30  static db::const_item_type<base> function(
32  analytic_solution_computer,
33  const tnsr::I<DataVector, Dim, Frame::Inertial>& inertial_coords,
34  const double& time) noexcept {
36  variables_from_tagged_tuple(analytic_solution_computer.variables(
37  inertial_coords, time, AnalyticFieldsTagList{})));
38  }
39 };
40 } // namespace Tags
41 } // namespace evolution
Prefix< DataBox_detail::dispatch_add_tag_prefix_impl< Prefix, Tag, Args... >, Args... > add_tag_prefix
Wrap Tag in Prefix<_, Args...>, also wrapping variables tags if Tag is a Tags::Variables.
Definition: DataBoxTag.hpp:616
Definition: Variables.hpp:46
Prefix indicating the analytic solution value for a quantity.
Definition: Prefixes.hpp:43
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:154
Define prefixes for DataBox tags.
Tag for the current time as a double.
Definition: Tags.hpp:72
Defines class Variables.
Definition: DataBoxTag.hpp:29
Defines classes for Tensor.
Wraps the template metaprogramming library used (brigand)
Use the AnalyticSolutionTag to compute the analytic solution of the tags in AnalyticFieldsTagList.
Definition: ComputeTags.hpp:21
Defines tags related to domain quantities.
Variables< tmpl::list< Tags... > > variables_from_tagged_tuple(const tuples::TaggedTuple< Tags... > &tuple) noexcept
Construct a variables from the Tensors in a TaggedTuple.
Definition: Variables.hpp:831
Defines tags related to Time quantities.
Functionality for evolving hyperbolic partial differential equations.
Definition: ComputeTags.hpp:13