IgnoreFailedApparentHorizon.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include "ApparentHorizons/FastFlow.hpp"
8 #include "Informer/Tags.hpp"
9 #include "Parallel/Printf.hpp"
10 #include "Utilities/PrettyType.hpp"
11 
12 /// \cond
13 namespace Parallel {
14 template <typename Metavariables>
15 class GlobalCache;
16 } // namespace Parallel
17 /// \endcond
18 
19 namespace intrp::callbacks {
20 
21 /// \brief Callback for a failed apparent horizon find that prints a
22 /// message (if sufficient Verbosity is enabled) but does not
23 /// terminate the executable.
25  template <typename InterpolationTargetTag, typename DbTags,
26  typename Metavariables, typename TemporalId>
27  static void apply(const db::DataBox<DbTags>& box,
28  const Parallel::GlobalCache<Metavariables>& /*cache*/,
29  const TemporalId& /*temporal_id*/,
30  const FastFlow::Status failure_reason) noexcept {
31  const auto& verbosity =
32  db::get<logging::Tags::Verbosity<InterpolationTargetTag>>(box);
33  if (verbosity > ::Verbosity::Quiet) {
34  Parallel::printf("Remark: Horizon finder %s failed, reason = %s\n",
35  pretty_type::short_name<InterpolationTargetTag>(),
36  failure_reason);
37  }
38  }
39 };
40 
41 } // namespace intrp::callbacks
intrp::callbacks::IgnoreFailedApparentHorizon
Callback for a failed apparent horizon find that prints a message (if sufficient Verbosity is enabled...
Definition: IgnoreFailedApparentHorizon.hpp:24
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:15
PrettyType.hpp
Parallel::printf
void printf(const std::string &format, Args &&... args)
Print an atomic message to stdout with C printf usage.
Definition: Printf.hpp:103
Printf.hpp
DataBox.hpp
intrp::callbacks
Contains callback functions called by InterpolationTargets.
Definition: Callbacks.hpp:11
Parallel
Functionality for parallelization.
Definition: ElementReceiveInterpPoints.hpp:13