Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include "DataStructures/DataBox/DataBox.hpp" 7 : #include "IO/Logging/Verbosity.hpp" 8 : #include "Parallel/Printf/Printf.hpp" 9 : #include "ParallelAlgorithms/ApparentHorizonFinder/FastFlow.hpp" 10 : #include "Utilities/PrettyType.hpp" 11 : 12 : /// \cond 13 : namespace Parallel { 14 : template <typename Metavariables> 15 : class GlobalCache; 16 : } // namespace Parallel 17 : namespace logging::Tags { 18 : template <typename OptionsGroup> 19 : struct Verbosity; 20 : } // namespace logging::Tags 21 : /// \endcond 22 : 23 : namespace intrp::callbacks { 24 : 25 : /// \brief Callback for a failed apparent horizon find that prints a 26 : /// message (if sufficient Verbosity is enabled) but does not 27 : /// terminate the executable. 28 1 : struct IgnoreFailedApparentHorizon { 29 : template <typename InterpolationTargetTag, typename DbTags, 30 : typename Metavariables, typename TemporalId> 31 0 : static void apply(const db::DataBox<DbTags>& box, 32 : const Parallel::GlobalCache<Metavariables>& /*cache*/, 33 : const TemporalId& /*temporal_id*/, 34 : const FastFlow::Status failure_reason) { 35 : const auto& verbosity = 36 : db::get<logging::Tags::Verbosity<InterpolationTargetTag>>(box); 37 : if (verbosity >= ::Verbosity::Quiet) { 38 : Parallel::printf("Remark: Horizon finder %s failed, reason = %s\n", 39 : pretty_type::name<InterpolationTargetTag>(), 40 : failure_reason); 41 : } 42 : } 43 : }; 44 : 45 : } // namespace intrp::callbacks