SpECTRE Documentation Coverage Report
Current view: top level - ControlSystem/Actions - PrintCurrentMeasurement.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 1 3 33.3 %
Date: 2025-12-05 05:03:31
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include "ControlSystem/Tags/SystemTags.hpp"
       7             : #include "DataStructures/DataBox/DataBox.hpp"
       8             : #include "Parallel/GlobalCache.hpp"
       9             : #include "Parallel/Printf/Printf.hpp"
      10             : #include "Utilities/PrettyType.hpp"
      11             : 
      12             : namespace control_system::Actions {
      13             : /*!
      14             :  * \brief Simple action that will print the
      15             :  * `control_system::Tags::CurrentNumberOfMeasurements` for whatever control
      16             :  * system it is run on.
      17             :  */
      18           1 : struct PrintCurrentMeasurement {
      19             :   template <typename ParallelComponent, typename DbTags, typename Metavariables,
      20             :             typename ArrayIndex>
      21           0 :   static void apply(db::DataBox<DbTags>& box,
      22             :                     const Parallel::GlobalCache<Metavariables>& /*cache*/,
      23             :                     const ArrayIndex& /*array_index*/,
      24             :                     const std::string& file_name) {
      25             :     const int current_measurement =
      26             :         db::get<control_system::Tags::CurrentNumberOfMeasurements>(box);
      27             : 
      28             :     Parallel::fprintf(file_name, "%s: Current measurement = %d\n",
      29             :                       pretty_type::name<ParallelComponent>(),
      30             :                       current_measurement);
      31             :   }
      32             : };
      33             : }  // namespace control_system::Actions

Generated by: LCOV version 1.14