SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce/Actions - InitializeCharacteristicEvolutionTime.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 14.3 % 7 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 <cstddef>
       7              : #include <optional>
       8              : #include <tuple>
       9              : #include <utility>
      10              : 
      11              : #include "DataStructures/DataBox/DataBox.hpp"
      12              : #include "DataStructures/TaggedTuple.hpp"
      13              : #include "DataStructures/VariablesTag.hpp"
      14              : #include "Evolution/Initialization/Evolution.hpp"
      15              : #include "Evolution/Initialization/Tags.hpp"
      16              : #include "Evolution/Systems/Cce/OptionTags.hpp"
      17              : #include "Parallel/AlgorithmExecution.hpp"
      18              : #include "ParallelAlgorithms/Initialization/MutateAssign.hpp"
      19              : #include "Time/ChooseLtsStepSize.hpp"
      20              : #include "Time/LtsMode.hpp"
      21              : #include "Time/Slab.hpp"
      22              : #include "Time/Tags/AdaptiveSteppingDiagnostics.hpp"
      23              : #include "Time/Tags/LtsMode.hpp"
      24              : #include "Time/Tags/StepNumberWithinSlab.hpp"
      25              : #include "Time/Tags/Time.hpp"
      26              : #include "Time/Tags/TimeStep.hpp"
      27              : #include "Time/Tags/TimeStepId.hpp"
      28              : #include "Time/Tags/TimeStepper.hpp"
      29              : #include "Time/Time.hpp"
      30              : #include "Time/TimeStepId.hpp"
      31              : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
      32              : #include "Time/TimeSteppers/TimeStepper.hpp"
      33              : #include "Utilities/Rational.hpp"
      34              : #include "Utilities/Requires.hpp"
      35              : #include "Utilities/TMPL.hpp"
      36              : 
      37              : namespace Cce {
      38              : namespace Actions {
      39              : 
      40              : /*!
      41              :  * \ingroup ActionsGroup
      42              :  * \brief Initializes the contents of the `CharacteristicEvolution` component
      43              :  * for performing the time evolution of the system, which is the singleton that
      44              :  * handles the main evolution system for CCE computations.
      45              :  *
      46              :  * \details Sets up the \ref DataBoxGroup to be ready to perform the
      47              :  * time-stepping associated with the CCE system.
      48              :  *
      49              :  * \ref DataBoxGroup changes:
      50              :  * - Modifies: nothing
      51              :  * - Adds:
      52              :  *  - `Tags::TimeStepId`
      53              :  *  - `Tags::Next<Tags::TimeStepId>`
      54              :  *  - `Tags::TimeStep`
      55              :  *  - `Tags::Time`
      56              :  *  - `Tags::AdaptiveSteppingDiagnostics`
      57              :  * - Removes: nothing
      58              :  */
      59            1 : struct InitializeCharacteristicEvolutionTime {
      60            0 :   using simple_tags_from_options =
      61              :       tmpl::list<Initialization::Tags::InitialSlabSize,
      62              :                  ::Initialization::Tags::InitialTimeDelta>;
      63              : 
      64            0 :   using const_global_cache_tags = tmpl::list<
      65              :       Tags::CceEvolutionPrefix<::Tags::ConcreteTimeStepper<LtsTimeStepper>>,
      66              :       Tags::CceEvolutionPrefix<::Tags::LtsModeForced<LtsMode::Conservative>>>;
      67              : 
      68            0 :   using simple_tags =
      69              :       tmpl::list<::Tags::TimeStepId, ::Tags::Next<::Tags::TimeStepId>,
      70              :                  ::Tags::TimeStep, ::Tags::Time, ::Tags::StepNumberWithinSlab,
      71              :                  ::Tags::AdaptiveSteppingDiagnostics>;
      72            0 :   using compute_tags =
      73              :       tmpl::transform<time_stepper_ref_tags<LtsTimeStepper>,
      74              :                       tmpl::bind<Tags::CceEvolutionPrefix, tmpl::_1>>;
      75              : 
      76              :   template <typename DbTags, typename... InboxTags, typename Metavariables,
      77              :             typename ArrayIndex, typename ActionList,
      78              :             typename ParallelComponent>
      79            0 :   static Parallel::iterable_action_return_t apply(
      80              :       db::DataBox<DbTags>& box,
      81              :       const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
      82              :       const Parallel::GlobalCache<Metavariables>& /*cache*/,
      83              :       const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
      84              :       const ParallelComponent* const /*meta*/) {
      85              :     const auto& time_stepper =
      86              :         db::get<Tags::CceEvolutionPrefix<::Tags::TimeStepper<TimeStepper>>>(
      87              :             box);
      88              :     const double initial_time_value = db::get<Tags::StartTime>(box);
      89              : 
      90              :     double unused_slab_size_goal{};
      91              :     db::mutate_apply<
      92              :         tmpl::list<::Tags::Next<::Tags::TimeStepId>, ::Tags::TimeStep>,
      93              :         tmpl::list<>>(
      94              :         Initialization::TimeStepping<Metavariables, TimeStepper, false, true>{},
      95              :         make_not_null(&box), make_not_null(&unused_slab_size_goal),
      96              :         initial_time_value,
      97              :         db::get<::Initialization::Tags::InitialTimeDelta>(box),
      98              :         db::get<::Initialization::Tags::InitialSlabSize>(box), time_stepper,
      99              :         LtsMode::Conservative);
     100              : 
     101              :     Initialization::mutate_assign<tmpl::list<::Tags::TimeStepId, ::Tags::Time>>(
     102              :         make_not_null(&box), TimeStepId{}, initial_time_value);
     103              :     return {Parallel::AlgorithmExecution::Continue, std::nullopt};
     104              :   }
     105              : };
     106              : 
     107              : }  // namespace Actions
     108              : }  // namespace Cce
        

Generated by: LCOV version 2.0-1