SpECTRE Documentation Coverage Report
Current view: top level - ControlSystem/Actions - PrintCurrentMeasurement.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 33.3 % 3 1
Test Date: 2026-10-22 17:29:42
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 2.0-1