CheckWrappedGrConsistency.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
7 
8 #include "DataStructures/DataVector.hpp"
10 #include "Utilities/TMPL.hpp"
11 
12 template <typename WrappedGrSolution, typename ArgumentSolution, size_t Dim>
13 void check_wrapped_gr_solution_consistency(
14  const WrappedGrSolution& wrapped_solution,
15  const ArgumentSolution& argument_solution,
16  const tnsr::I<DataVector, Dim, Frame::Inertial>& x,
17  const double t) noexcept {
18  using argument_solution_tags =
19  typename ArgumentSolution::template tags<DataVector>;
20  const auto wrapped_vars =
21  wrapped_solution.variables(x, t, argument_solution_tags{});
22  const auto argument_vars =
23  argument_solution.variables(x, t, argument_solution_tags{});
24  tmpl::for_each<argument_solution_tags>(
25  [&wrapped_vars, &argument_vars](auto tag_v) noexcept {
26  using tag = typename decltype(tag_v)::type;
27  CHECK(get<tag>(wrapped_vars) == get<tag>(argument_vars));
28  });
29 }
TestingFramework.hpp
Tensor.hpp
TMPL.hpp