9 #include "Evolution/Systems/Cce/OptionTags.hpp"
10 #include "Evolution/Systems/Cce/Tags.hpp"
12 #include "Time/Tags.hpp"
18 template <
typename Tag>
19 struct get_interpolator_argument_tag {
23 template <
typename Tag>
24 struct get_interpolator_argument_tag<Tags::Du<Tag>> {
28 template <
typename Tag>
29 struct InsertIntoInterpolationManagerImpl {
31 tmpl::list<Tags::InterpolationManager<ComplexDataVector, Tag>>;
33 tmpl::list<typename get_interpolator_argument_tag<Tag>::type,
34 Tags::InertialRetardedTime>;
36 const gsl::not_null<ScriPlusInterpolationManager<ComplexDataVector, Tag>*>
37 interpolation_manager,
38 const typename Tag::type& scri_data,
40 interpolation_manager->insert_data(
get(inertial_retarded_time),
45 template <
typename LhsTag,
typename RhsTag>
46 struct InsertIntoInterpolationManagerImpl<::
Tags::Multiplies<LhsTag, RhsTag>> {
47 using return_tags = tmpl::list<Tags::InterpolationManager<
50 tmpl::list<typename get_interpolator_argument_tag<LhsTag>::type, RhsTag,
51 Tags::InertialRetardedTime>;
54 interpolation_manager,
55 const typename LhsTag::type& lhs_data,
56 const typename RhsTag::type& rhs_data,
58 interpolation_manager->insert_data(
get(inertial_retarded_time),
91 template <
typename Tag>
93 using const_global_cache_tags =
94 tmpl::list<InitializationTags::ScriOutputDensity>;
95 template <
typename DbTags,
typename... InboxTags,
typename Metavariables,
96 typename ArrayIndex,
typename ActionList,
97 typename ParallelComponent>
98 static auto apply(db::DataBox<DbTags>& box,
103 const ParallelComponent*
const ) noexcept {
104 if (db::get<::Tags::TimeStepId>(box).substep() == 0) {
106 db::mutate_apply<detail::InsertIntoInterpolationManagerImpl<Tag>>(
109 const auto& time_span_deque =
110 db::get<Tags::InterpolationManager<ComplexDataVector, Tag>>(box)
111 .get_u_bondi_ranges();
113 const double this_time = time_span_deque.back().first;
114 double time_delta_estimate = db::get<::Tags::TimeStep>(box).value();
115 if(time_span_deque.size() > 1) {
116 time_delta_estimate =
117 this_time - time_span_deque[time_span_deque.size() - 2].first;
121 db::mutate<Tags::InterpolationManager<ComplexDataVector, Tag>>(
123 [&this_time, &time_delta_estimate](
126 interpolation_manager,
127 const size_t number_of_interpolated_times) noexcept {
128 for (
size_t i = 0; i < number_of_interpolated_times; ++i) {
129 interpolation_manager->insert_target_time(
131 time_delta_estimate *
static_cast<double>(i) /
132 static_cast<double>(number_of_interpolated_times));
135 db::get<InitializationTags::ScriOutputDensity>(box));
137 return std::forward_as_tuple(std::move(box));