SpECTRE Documentation Coverage Report
Current view: top level - Elliptic/Executables/SelfForce/GeneralRelativity - SolveGrSelfForce.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 0.0 % 1 0
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              : 
       8              : #include "DataStructures/DataBox/PrefixHelpers.hpp"
       9              : #include "Domain/Creators/AlignedLattice.hpp"
      10              : #include "Domain/RadiallyCompressedCoordinates.hpp"
      11              : #include "Domain/Tags.hpp"
      12              : #include "Elliptic/Actions/RunEventsAndTriggers.hpp"
      13              : #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp"
      14              : #include "Elliptic/DiscontinuousGalerkin/DgElementArray.hpp"
      15              : #include "Elliptic/Executables/Solver.hpp"
      16              : #include "Elliptic/Systems/SelfForce/GeneralRelativity/Actions/InitializeEffectiveSource.hpp"
      17              : #include "Elliptic/Systems/SelfForce/GeneralRelativity/AnalyticData/CircularOrbit.hpp"
      18              : #include "Elliptic/Systems/SelfForce/GeneralRelativity/BoundaryConditions/Angular.hpp"
      19              : #include "Elliptic/Systems/SelfForce/GeneralRelativity/BoundaryConditions/Sommerfeld.hpp"
      20              : #include "Elliptic/Systems/SelfForce/GeneralRelativity/FirstOrderSystem.hpp"
      21              : #include "Elliptic/Systems/SelfForce/GeneralRelativity/Tags.hpp"
      22              : #include "Elliptic/Triggers/Factory.hpp"
      23              : #include "IO/Observer/Actions/RegisterEvents.hpp"
      24              : #include "IO/Observer/Helpers.hpp"
      25              : #include "IO/Observer/ObserverComponent.hpp"
      26              : #include "Options/Protocols/FactoryCreation.hpp"
      27              : #include "Options/String.hpp"
      28              : #include "Parallel/Phase.hpp"
      29              : #include "Parallel/PhaseControl/ExecutePhaseChange.hpp"
      30              : #include "Parallel/PhaseControl/VisitAndReturn.hpp"
      31              : #include "Parallel/PhaseDependentActionList.hpp"
      32              : #include "Parallel/Protocols/RegistrationMetavariables.hpp"
      33              : #include "Parallel/Reduction.hpp"
      34              : #include "ParallelAlgorithms/Actions/TerminatePhase.hpp"
      35              : #include "ParallelAlgorithms/Amr/Actions/SendAmrDiagnostics.hpp"
      36              : #include "ParallelAlgorithms/Amr/Criteria/Factory.hpp"
      37              : #include "ParallelAlgorithms/Amr/Protocols/AmrMetavariables.hpp"
      38              : #include "ParallelAlgorithms/Events/Completion.hpp"
      39              : #include "ParallelAlgorithms/Events/Factory.hpp"
      40              : #include "ParallelAlgorithms/Events/Tags.hpp"
      41              : #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp"
      42              : #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
      43              : #include "ParallelAlgorithms/LinearSolver/Multigrid/ElementsAllocator.hpp"
      44              : #include "ParallelAlgorithms/LinearSolver/Multigrid/Tags.hpp"
      45              : #include "PointwiseFunctions/InitialDataUtilities/AnalyticSolution.hpp"
      46              : #include "PointwiseFunctions/InitialDataUtilities/Background.hpp"
      47              : #include "PointwiseFunctions/InitialDataUtilities/InitialGuess.hpp"
      48              : #include "PointwiseFunctions/MathFunctions/Factory.hpp"
      49              : #include "Utilities/ProtocolHelpers.hpp"
      50              : #include "Utilities/TMPL.hpp"
      51              : 
      52              : /// \cond
      53              : namespace PUP {
      54              : class er;
      55              : }  // namespace PUP
      56              : 
      57              : struct Metavariables {
      58              :   static constexpr Options::String help{
      59              :       "Find the self force for a point mass by solving a 2D elliptic "
      60              :       "problem."};
      61              : 
      62              :   using system = GrSelfForce::FirstOrderSystem;
      63              :   static constexpr size_t volume_dim = system::volume_dim;
      64              :   using solver = elliptic::Solver<Metavariables, volume_dim, system>;
      65              : 
      66              :   using observe_fields = tmpl::append<
      67              :       typename system::primal_fields, typename system::background_fields,
      68              :       tmpl::list<GrSelfForce::Tags::SingularField,
      69              :                  GrSelfForce::Tags::BoyerLindquistRadius>,
      70              :       typename solver::observe_fields,
      71              :       tmpl::list<domain::Tags::Coordinates<volume_dim, Frame::Inertial>,
      72              :                  domain::Tags::RadiallyCompressedCoordinatesCompute<
      73              :                      2, Frame::Inertial, tmpl::size_t<0>>>>;
      74              :   using observer_compute_tags =
      75              :       tmpl::list<::Events::Tags::ObserverMeshCompute<volume_dim>,
      76              :                  ::Events::Tags::ObserverDetInvJacobianCompute<
      77              :                      Frame::ElementLogical, Frame::Inertial>>;
      78              : 
      79              :   // Collect all items to store in the cache.
      80              :   using const_global_cache_tags =
      81              :       tmpl::list<domain::Tags::RadiallyCompressedCoordinatesOptions>;
      82              : 
      83              :   struct factory_creation
      84              :       : tt::ConformsTo<Options::protocols::FactoryCreation> {
      85              :     using factory_classes = tmpl::map<
      86              :         tmpl::pair<DomainCreator<volume_dim>,
      87              :                    tmpl::list<domain::creators::AlignedLattice<2>>>,
      88              :         tmpl::pair<elliptic::analytic_data::Background,
      89              :                    tmpl::list<GrSelfForce::AnalyticData::CircularOrbit>>,
      90              :         tmpl::pair<elliptic::analytic_data::InitialGuess,
      91              :                    tmpl::list<GrSelfForce::AnalyticData::CircularOrbit>>,
      92              :         tmpl::pair<elliptic::analytic_data::AnalyticSolution, tmpl::list<>>,
      93              :         tmpl::pair<elliptic::BoundaryConditions::BoundaryCondition<volume_dim>,
      94              :                    tmpl::list<GrSelfForce::BoundaryConditions::Angular,
      95              :                               GrSelfForce::BoundaryConditions::Sommerfeld>>,
      96              :         tmpl::pair<::amr::Criterion,
      97              :                    ::amr::Criteria::standard_criteria<
      98              :                        volume_dim, typename system::primal_fields>>,
      99              :         tmpl::pair<Event,
     100              :                    tmpl::flatten<tmpl::list<
     101              :                        Events::Completion,
     102              :                        dg::Events::field_observations<
     103              :                            volume_dim, observe_fields, observer_compute_tags,
     104              :                            amr::Tags::IsFinestGrid>>>>,
     105              :         tmpl::pair<Trigger, elliptic::Triggers::all_triggers<
     106              :                                 ::amr::OptionTags::AmrGroup>>,
     107              :         tmpl::pair<
     108              :             PhaseChange,
     109              :             tmpl::list<
     110              :                 // Phases for AMR
     111              :                 PhaseControl::VisitAndReturn<
     112              :                     Parallel::Phase::EvaluateAmrCriteria>,
     113              :                 PhaseControl::VisitAndReturn<Parallel::Phase::AdjustDomain>,
     114              :                 PhaseControl::VisitAndReturn<Parallel::Phase::UpdateSections>,
     115              :                 PhaseControl::VisitAndReturn<Parallel::Phase::CheckDomain>>>>;
     116              :   };
     117              : 
     118              :   // Collect all reduction tags for observers
     119              :   using observed_reduction_data_tags =
     120              :       observers::collect_reduction_data_tags<tmpl::push_back<
     121              :           tmpl::at<typename factory_creation::factory_classes, Event>, solver>>;
     122              : 
     123              :   using initialization_actions =
     124              :       tmpl::push_back<typename solver::initialization_actions,
     125              :                       Parallel::Actions::TerminatePhase>;
     126              : 
     127              :   using register_actions =
     128              :       tmpl::push_back<typename solver::register_actions,
     129              :                       observers::Actions::RegisterEventsWithObservers>;
     130              : 
     131              :   using solve_actions = typename solver::template solve_actions<tmpl::list<>>;
     132              : 
     133              :   using dg_element_array = elliptic::DgElementArray<
     134              :       Metavariables,
     135              :       tmpl::list<
     136              :           Parallel::PhaseActions<
     137              :               Parallel::Phase::Initialization,
     138              :               tmpl::replace<initialization_actions,
     139              :                             elliptic::Actions::InitializeFixedSources<
     140              :                                 system, typename solver::background_tag>,
     141              :                             GrSelfForce::Actions::InitializeEffectiveSource<
     142              :                                 system, typename solver::background_tag>>>,
     143              :           Parallel::PhaseActions<
     144              :               Parallel::Phase::Register,
     145              :               tmpl::push_back<register_actions,
     146              :                               Parallel::Actions::TerminatePhase>>,
     147              :           Parallel::PhaseActions<
     148              :               Parallel::Phase::Restart,
     149              :               tmpl::push_back<register_actions,
     150              :                               Parallel::Actions::TerminatePhase>>,
     151              :           Parallel::PhaseActions<Parallel::Phase::Solve, solve_actions>,
     152              :           Parallel::PhaseActions<
     153              :               Parallel::Phase::CheckDomain,
     154              :               tmpl::list<::amr::Actions::SendAmrDiagnostics,
     155              :                          Parallel::Actions::TerminatePhase>>>,
     156              :       LinearSolver::multigrid::ElementsAllocator<
     157              :           volume_dim, typename solver::multigrid::options_group>>;
     158              : 
     159              :   struct amr : tt::ConformsTo<::amr::protocols::AmrMetavariables> {
     160              :     using element_array = dg_element_array;
     161              :     using projectors =
     162              :         tmpl::replace<typename solver::amr_projectors,
     163              :                       elliptic::Actions::InitializeFixedSources<
     164              :                           system, typename solver::background_tag>,
     165              :                       GrSelfForce::Actions::InitializeEffectiveSource<
     166              :                           system, typename solver::background_tag>>;
     167              :     static constexpr bool keep_coarse_grids = true;
     168              :     static constexpr bool p_refine_only_in_event = false;
     169              :   };
     170              : 
     171              :   struct registration
     172              :       : tt::ConformsTo<Parallel::protocols::RegistrationMetavariables> {
     173              :     using element_registrars =
     174              :         tmpl::map<tmpl::pair<dg_element_array, register_actions>>;
     175              :   };
     176              : 
     177              :   // Specify all parallel components that will execute actions at some point.
     178              :   using component_list = tmpl::flatten<
     179              :       tmpl::list<dg_element_array, typename solver::component_list,
     180              :                  observers::Observer<Metavariables>,
     181              :                  observers::ObserverWriter<Metavariables>>>;
     182              : 
     183              :   static constexpr std::array<Parallel::Phase, 6> default_phase_order{
     184              :       {Parallel::Phase::Initialization, Parallel::Phase::Register,
     185              :        Parallel::Phase::UpdateSections, Parallel::Phase::CheckDomain,
     186              :        Parallel::Phase::Solve, Parallel::Phase::Exit}};
     187              : 
     188              :   // NOLINTNEXTLINE(google-runtime-references)
     189              :   void pup(PUP::er& /*p*/) {}
     190              : };
     191              : /// \endcond
        

Generated by: LCOV version 2.0-1