SpECTRE Documentation Coverage Report
Current view: top level - ControlSystem/Actions - PrintCurrentMeasurement.hpp Hit Total Coverage
Commit: c4864ba59ab2d0d4227eb983d3e1eb61f059bc16 Lines: 1 3 33.3 %
Date: 2024-05-05 16:16:17
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 int current_measurement =
      25             :         db::get<control_system::Tags::CurrentNumberOfMeasurements>(box);
      26             : 
      27             :     Parallel::printf("%s: Current measurement = %d\n",
      28             :                      pretty_type::name<ParallelComponent>(),
      29             :                      current_measurement);
      30             :   }
      31             : };
      32             : }  // namespace control_system::Actions

Generated by: LCOV version 1.14