SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Executables/ForceFree - EvolveForceFree.hpp Hit Total Coverage
Commit: 965048f86d23c819715b3af1ca3f880c8145d4bb Lines: 0 22 0.0 %
Date: 2024-05-16 17:00:40
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 <array>
       7             : #include <cstddef>
       8             : #include <type_traits>
       9             : #include <vector>
      10             : 
      11             : #include "DataStructures/DataBox/PrefixHelpers.hpp"
      12             : #include "DataStructures/Tensor/TypeAliases.hpp"
      13             : #include "Domain/Creators/DomainCreator.hpp"
      14             : #include "Domain/Creators/Factory3D.hpp"
      15             : #include "Domain/Tags.hpp"
      16             : #include "Evolution/Actions/RunEventsAndDenseTriggers.hpp"
      17             : #include "Evolution/Actions/RunEventsAndTriggers.hpp"
      18             : #include "Evolution/ComputeTags.hpp"
      19             : #include "Evolution/DiscontinuousGalerkin/Actions/ApplyBoundaryCorrections.hpp"
      20             : #include "Evolution/DiscontinuousGalerkin/Actions/ComputeTimeDerivative.hpp"
      21             : #include "Evolution/DiscontinuousGalerkin/BackgroundGrVars.hpp"
      22             : #include "Evolution/DiscontinuousGalerkin/DgElementArray.hpp"
      23             : #include "Evolution/DiscontinuousGalerkin/Initialization/Mortars.hpp"
      24             : #include "Evolution/DiscontinuousGalerkin/Limiters/Minmod.hpp"
      25             : #include "Evolution/DiscontinuousGalerkin/Limiters/Tags.hpp"
      26             : #include "Evolution/Initialization/ConservativeSystem.hpp"
      27             : #include "Evolution/Initialization/DgDomain.hpp"
      28             : #include "Evolution/Initialization/Evolution.hpp"
      29             : #include "Evolution/Initialization/Limiter.hpp"
      30             : #include "Evolution/Initialization/SetVariables.hpp"
      31             : #include "Evolution/Systems/ForceFree/BoundaryConditions/BoundaryCondition.hpp"
      32             : #include "Evolution/Systems/ForceFree/BoundaryConditions/Factory.hpp"
      33             : #include "Evolution/Systems/ForceFree/BoundaryCorrections/Factory.hpp"
      34             : #include "Evolution/Systems/ForceFree/ElectricCurrentDensity.hpp"
      35             : #include "Evolution/Systems/ForceFree/ElectromagneticVariables.hpp"
      36             : #include "Evolution/Systems/ForceFree/MaskNeutronStarInterior.hpp"
      37             : #include "Evolution/Systems/ForceFree/System.hpp"
      38             : #include "Evolution/Systems/ForceFree/Tags.hpp"
      39             : #include "Evolution/Tags/Filter.hpp"
      40             : #include "IO/Observer/Actions/RegisterEvents.hpp"
      41             : #include "IO/Observer/Actions/RegisterWithObservers.hpp"
      42             : #include "IO/Observer/Helpers.hpp"
      43             : #include "IO/Observer/ObserverComponent.hpp"
      44             : #include "NumericalAlgorithms/LinearOperators/ExponentialFilter.hpp"
      45             : #include "Options/Options.hpp"
      46             : #include "Options/Protocols/FactoryCreation.hpp"
      47             : #include "Parallel/Local.hpp"
      48             : #include "Parallel/Phase.hpp"
      49             : #include "Parallel/PhaseControl/CheckpointAndExitAfterWallclock.hpp"
      50             : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
      51             : #include "Parallel/PhaseControl/PhaseChange.hpp"
      52             : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
      53             : #include "Parallel/PhaseDependentActionList.hpp"
      54             : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
      55             : #include "ParallelAlgorithms/Actions/AddComputeTags.hpp"
      56             : #include "ParallelAlgorithms/Actions/AddSimpleTags.hpp"
      57             : #include "ParallelAlgorithms/Actions/FilterAction.hpp"
      58             : #include "ParallelAlgorithms/Actions/InitializeItems.hpp"
      59             : #include "ParallelAlgorithms/Actions/LimiterActions.hpp"
      60             : #include "ParallelAlgorithms/Actions/MutateApply.hpp"
      61             : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
      62             : #include "ParallelAlgorithms/Events/Factory.hpp"
      63             : #include "ParallelAlgorithms/Events/Tags.hpp"
      64             : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTrigger.hpp"
      65             : #include "ParallelAlgorithms/EventsAndDenseTriggers/DenseTriggers/Factory.hpp"
      66             : #include "ParallelAlgorithms/EventsAndTriggers/Completion.hpp"
      67             : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
      68             : #include "ParallelAlgorithms/EventsAndTriggers/EventsAndTriggers.hpp"
      69             : #include "ParallelAlgorithms/EventsAndTriggers/LogicalTriggers.hpp"
      70             : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
      71             : #include "PointwiseFunctions/AnalyticData/ForceFree/AnalyticData.hpp"
      72             : #include "PointwiseFunctions/AnalyticData/ForceFree/Factory.hpp"
      73             : #include "PointwiseFunctions/AnalyticSolutions/ForceFree/Factory.hpp"
      74             : #include "PointwiseFunctions/AnalyticSolutions/Tags.hpp"
      75             : #include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp"
      76             : #include "Time/Actions/AdvanceTime.hpp"
      77             : #include "Time/Actions/RecordTimeStepperData.hpp"
      78             : #include "Time/Actions/SelfStartActions.hpp"
      79             : #include "Time/Actions/UpdateU.hpp"
      80             : #include "Time/ChangeSlabSize/Action.hpp"
      81             : #include "Time/StepChoosers/Factory.hpp"
      82             : #include "Time/StepChoosers/StepChooser.hpp"
      83             : #include "Time/Tags/Time.hpp"
      84             : #include "Time/Tags/TimeStepId.hpp"
      85             : #include "Time/TimeSequence.hpp"
      86             : #include "Time/TimeSteppers/Factory.hpp"
      87             : #include "Time/TimeSteppers/LtsTimeStepper.hpp"
      88             : #include "Time/TimeSteppers/TimeStepper.hpp"
      89             : #include "Time/Triggers/TimeTriggers.hpp"
      90             : #include "Utilities/ProtocolHelpers.hpp"
      91             : #include "Utilities/TMPL.hpp"
      92             : 
      93             : /// \cond
      94             : namespace PUP {
      95             : class er;
      96             : }  // namespace PUP
      97             : namespace Parallel {
      98             : template <typename Metavariables>
      99             : class CProxy_GlobalCache;
     100             : }  // namespace Parallel
     101             : /// \endcond
     102             : 
     103             : struct EvolutionMetavars {
     104             :   static constexpr size_t volume_dim = 3;
     105           0 :   using system = ForceFree::System;
     106           0 :   using temporal_id = Tags::TimeStepId;
     107           0 :   using TimeStepperBase = TimeStepper;
     108             : 
     109             :   static constexpr bool local_time_stepping =
     110             :       TimeStepperBase::local_time_stepping;
     111             : 
     112           0 :   using initial_data_list = tmpl::append<ForceFree::Solutions::all_solutions,
     113             :                                          ForceFree::AnalyticData::all_data>;
     114             : 
     115           0 :   using limiter = Tags::Limiter<Limiters::Minmod<
     116             :       3, tmpl::list<ForceFree::Tags::TildeE, ForceFree::Tags::TildeB,
     117             :                     ForceFree::Tags::TildeQ>>>;
     118             : 
     119           0 :   using analytic_variables_tags = typename system::variables_tag::tags_list;
     120             : 
     121           0 :   using analytic_compute = evolution::Tags::AnalyticSolutionsCompute<
     122             :       volume_dim, analytic_variables_tags, false, initial_data_list>;
     123             : 
     124           0 :   using error_compute = Tags::ErrorsCompute<analytic_variables_tags>;
     125             : 
     126           0 :   using error_tags = db::wrap_tags_in<Tags::Error, analytic_variables_tags>;
     127             : 
     128           0 :   using observe_fields = tmpl::push_back<
     129             :       tmpl::append<typename system::variables_tag::tags_list, error_tags>,
     130             :       domain::Tags::Coordinates<volume_dim, Frame::Grid>,
     131             :       domain::Tags::Coordinates<volume_dim, Frame::Inertial>,
     132             :       ForceFree::Tags::ElectricFieldCompute,
     133             :       ForceFree::Tags::MagneticFieldCompute,
     134             :       ForceFree::Tags::ChargeDensityCompute,
     135             :       ForceFree::Tags::ElectricCurrentDensityCompute>;
     136             : 
     137           0 :   using non_tensor_compute_tags =
     138             :       tmpl::list<::Events::Tags::ObserverMeshCompute<volume_dim>,
     139             :                  ::Events::Tags::ObserverDetInvJacobianCompute<
     140             :                      Frame::ElementLogical, Frame::Inertial>,
     141             :                  analytic_compute, error_compute>;
     142             : 
     143             :   struct factory_creation
     144             :       : tt::ConformsTo<Options::protocols::FactoryCreation> {
     145           0 :     using factory_classes = tmpl::map<
     146             :         tmpl::pair<ForceFree::BoundaryConditions::BoundaryCondition,
     147             :                    ForceFree::BoundaryConditions::standard_boundary_conditions>,
     148             :         tmpl::pair<DenseTrigger, DenseTriggers::standard_dense_triggers>,
     149             :         tmpl::pair<DomainCreator<volume_dim>, domain_creators<volume_dim>>,
     150             :         tmpl::pair<Event,
     151             :                    tmpl::flatten<tmpl::list<
     152             :                        Events::Completion,
     153             :                        dg::Events::field_observations<
     154             :                            volume_dim, observe_fields, non_tensor_compute_tags>,
     155             :                        Events::time_events<system>>>>,
     156             :         tmpl::pair<evolution::initial_data::InitialData, initial_data_list>,
     157             :         tmpl::pair<LtsTimeStepper, TimeSteppers::lts_time_steppers>,
     158             :         tmpl::pair<PhaseChange,
     159             :                    tmpl::list<PhaseControl::VisitAndReturn<
     160             :                                   Parallel::Phase::LoadBalancing>,
     161             :                               PhaseControl::CheckpointAndExitAfterWallclock>>,
     162             :         tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
     163             :                    StepChoosers::standard_step_choosers<system>>,
     164             :         tmpl::pair<
     165             :             StepChooser<StepChooserUse::Slab>,
     166             :             StepChoosers::standard_slab_choosers<system, local_time_stepping>>,
     167             :         tmpl::pair<TimeSequence<double>,
     168             :                    TimeSequences::all_time_sequences<double>>,
     169             :         tmpl::pair<TimeSequence<std::uint64_t>,
     170             :                    TimeSequences::all_time_sequences<std::uint64_t>>,
     171             :         tmpl::pair<TimeStepper, TimeSteppers::time_steppers>,
     172             :         tmpl::pair<Trigger, tmpl::append<Triggers::logical_triggers,
     173             :                                          Triggers::time_triggers>>>;
     174             :   };
     175             : 
     176           0 :   using observed_reduction_data_tags =
     177             :       observers::collect_reduction_data_tags<tmpl::flatten<tmpl::list<
     178             :           tmpl::at<typename factory_creation::factory_classes, Event>>>>;
     179             : 
     180           0 :   using dg_step_actions = tmpl::flatten<tmpl::list<
     181             :       Actions::MutateApply<
     182             :           evolution::dg::BackgroundGrVars<system, EvolutionMetavars, true>>,
     183             :       evolution::dg::Actions::ComputeTimeDerivative<
     184             :           volume_dim, system, AllStepChoosers, local_time_stepping>,
     185             :       tmpl::conditional_t<
     186             :           local_time_stepping,
     187             :           tmpl::list<evolution::Actions::RunEventsAndDenseTriggers<
     188             :                          tmpl::list<evolution::dg::ApplyBoundaryCorrections<
     189             :                              local_time_stepping, system, volume_dim, true>>>,
     190             :                      evolution::dg::Actions::ApplyLtsBoundaryCorrections<
     191             :                          system, volume_dim, false>>,
     192             :           tmpl::list<
     193             :               evolution::dg::Actions::ApplyBoundaryCorrectionsToTimeDerivative<
     194             :                   system, volume_dim, false>,
     195             :               Actions::RecordTimeStepperData<system>,
     196             :               evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<>>,
     197             :               Actions::UpdateU<system>>>,
     198             :       Limiters::Actions::SendData<EvolutionMetavars>,
     199             :       Limiters::Actions::Limit<EvolutionMetavars>,
     200             : 
     201             :       dg::Actions::Filter<
     202             :           Filters::Exponential<0>,
     203             :           tmpl::list<ForceFree::Tags::TildeE, ForceFree::Tags::TildeB,
     204             :                      ForceFree::Tags::TildePsi, ForceFree::Tags::TildePhi,
     205             :                      ForceFree::Tags::TildeQ>>
     206             : 
     207             :       >>;
     208             : 
     209           0 :   using const_global_cache_tags =
     210             :       tmpl::list<evolution::initial_data::Tags::InitialData,
     211             :                  ForceFree::Tags::KappaPsi, ForceFree::Tags::KappaPhi,
     212             :                  ForceFree::Tags::ParallelConductivity>;
     213             : 
     214           0 :   using dg_registration_list =
     215             :       tmpl::list<observers::Actions::RegisterEventsWithObservers>;
     216             : 
     217           0 :   using initialization_actions = tmpl::list<
     218             :       Initialization::Actions::InitializeItems<
     219             :           Initialization::TimeStepping<EvolutionMetavars, TimeStepperBase>,
     220             :           evolution::dg::Initialization::Domain<volume_dim>,
     221             :           Initialization::TimeStepperHistory<EvolutionMetavars>>,
     222             :       Initialization::Actions::AddSimpleTags<
     223             :           evolution::dg::BackgroundGrVars<system, EvolutionMetavars, true>>,
     224             :       Initialization::Actions::ConservativeSystem<system>,
     225             :       evolution::Initialization::Actions::SetVariables<
     226             :           domain::Tags::Coordinates<3, Frame::ElementLogical>>,
     227             : 
     228             :       Initialization::Actions::AddSimpleTags<
     229             :           ForceFree::MaskNeutronStarInterior<EvolutionMetavars, false>>,
     230             : 
     231             :       Initialization::Actions::AddComputeTags<
     232             :           tmpl::list<ForceFree::Tags::ComputeTildeJ>>,
     233             : 
     234             :       Initialization::Actions::AddComputeTags<
     235             :           StepChoosers::step_chooser_compute_tags<EvolutionMetavars,
     236             :                                                   local_time_stepping>>,
     237             :       ::evolution::dg::Initialization::Mortars<volume_dim, system>,
     238             :       Initialization::Actions::Minmod<3>,
     239             :       evolution::Actions::InitializeRunEventsAndDenseTriggers,
     240             :       Parallel::Actions::TerminatePhase>;
     241             : 
     242           0 :   using dg_element_array_component = DgElementArray<
     243             :       EvolutionMetavars,
     244             :       tmpl::list<
     245             :           Parallel::PhaseActions<Parallel::Phase::Initialization,
     246             :                                  initialization_actions>,
     247             : 
     248             :           Parallel::PhaseActions<Parallel::Phase::Register,
     249             :                                  tmpl::list<dg_registration_list,
     250             :                                             Parallel::Actions::TerminatePhase>>,
     251             : 
     252             :           Parallel::PhaseActions<
     253             :               Parallel::Phase::InitializeTimeStepperHistory,
     254             :               SelfStart::self_start_procedure<dg_step_actions, system>>,
     255             : 
     256             :           Parallel::PhaseActions<
     257             :               Parallel::Phase::Evolve,
     258             :               tmpl::list<evolution::Actions::RunEventsAndTriggers,
     259             :                          Actions::ChangeSlabSize, dg_step_actions,
     260             :                          Actions::AdvanceTime,
     261             :                          PhaseControl::Actions::ExecutePhaseChange>>>>;
     262             : 
     263             :   struct registration
     264             :       : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
     265           0 :     using element_registrars =
     266             :         tmpl::map<tmpl::pair<dg_element_array_component, dg_registration_list>>;
     267             :   };
     268             : 
     269           0 :   using component_list =
     270             :       tmpl::list<observers::Observer<EvolutionMetavars>,
     271             :                  observers::ObserverWriter<EvolutionMetavars>,
     272             :                  dg_element_array_component>;
     273             : 
     274             :   static constexpr Options::String help{
     275             :       "Evolve the GRFFE system with divergence cleaning.\n"};
     276             : 
     277             :   static constexpr std::array<Parallel::Phase, 5> default_phase_order{
     278             :       {Parallel::Phase::Initialization,
     279             :        Parallel::Phase::InitializeTimeStepperHistory, Parallel::Phase::Register,
     280             :        Parallel::Phase::Evolve, Parallel::Phase::Exit}};
     281             : 
     282             :   // NOLINTNEXTLINE(google-runtime-references)
     283           0 :   void pup(PUP::er& /*p*/) {}
     284             : };

Generated by: LCOV version 1.14