SpECTRE Documentation Coverage Report
Current view: top level - ParallelAlgorithms/EventsAndTriggers - Completion.hpp Hit Total Coverage
Commit: a48770a280d0d66bc04cb5df30de1e3cc4985437 Lines: 2 8 25.0 %
Date: 2021-06-17 20:55:50
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 "Options/Options.hpp"
       7             : #include "Parallel/CharmPupable.hpp"
       8             : #include "Parallel/GlobalCache.hpp"
       9             : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
      10             : #include "Utilities/TMPL.hpp"
      11             : 
      12             : namespace Events {
      13             : /// \ingroup EventsAndTriggersGroup
      14             : /// Sets the termination flag for the code to exit.
      15           1 : class Completion : public Event {
      16             :  public:
      17             :   /// \cond
      18             :   explicit Completion(CkMigrateMessage* /*unused*/) noexcept {}
      19             :   using PUP::able::register_constructor;
      20             :   WRAPPED_PUPable_decl_template(Completion);  // NOLINT
      21             :   /// \endcond
      22             : 
      23           0 :   using options = tmpl::list<>;
      24           0 :   static constexpr Options::String help = {
      25             :       "Sets the termination flag for the code to exit."};
      26             : 
      27           0 :   Completion() = default;
      28             : 
      29           0 :   using argument_tags = tmpl::list<>;
      30             : 
      31             :   template <typename Metavariables, typename ArrayIndex, typename Component>
      32           0 :   void operator()(Parallel::GlobalCache<Metavariables>& cache,
      33             :                   const ArrayIndex& array_index,
      34             :                   const Component* const /*meta*/) const noexcept {
      35             :     auto al_gore =
      36             :         Parallel::get_parallel_component<Component>(cache)[array_index]
      37             :             .ckLocal();
      38             :     al_gore->set_terminate(true);
      39             :   }
      40             : 
      41           1 :   bool needs_evolved_variables() const noexcept override { return false; }
      42             : };
      43             : }  // namespace Events

Generated by: LCOV version 1.14