SpECTRE Documentation Coverage Report
Current view: top level - ControlSystem/Measurements - CharSpeed.hpp Hit Total Coverage
Commit: aabde07399ba7837e5db64eedfd0a21f31f96922 Lines: 3 34 8.8 %
Date: 2024-04-26 02:38:13
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 <string>
       8             : 
       9             : #include "ControlSystem/Measurements/NonFactoryCreatable.hpp"
      10             : #include "ControlSystem/Protocols/Measurement.hpp"
      11             : #include "ControlSystem/Protocols/Submeasurement.hpp"
      12             : #include "ControlSystem/RunCallbacks.hpp"
      13             : #include "Domain/Structure/ObjectLabel.hpp"
      14             : #include "Domain/TagsTimeDependent.hpp"
      15             : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/ErrorOnFailedApparentHorizon.hpp"
      16             : #include "ParallelAlgorithms/ApparentHorizonFinder/Callbacks/FindApparentHorizon.hpp"
      17             : #include "ParallelAlgorithms/ApparentHorizonFinder/ComputeExcisionBoundaryVolumeQuantities.hpp"
      18             : #include "ParallelAlgorithms/ApparentHorizonFinder/ComputeHorizonVolumeQuantities.hpp"
      19             : #include "ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp"
      20             : #include "ParallelAlgorithms/ApparentHorizonFinder/InterpolationTarget.hpp"
      21             : #include "ParallelAlgorithms/Interpolation/Events/Interpolate.hpp"
      22             : #include "ParallelAlgorithms/Interpolation/Events/InterpolateWithoutInterpComponent.hpp"
      23             : #include "ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp"
      24             : #include "ParallelAlgorithms/Interpolation/Targets/Sphere.hpp"
      25             : #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp"
      26             : #include "Time/Tags/TimeAndPrevious.hpp"
      27             : #include "Utilities/ProtocolHelpers.hpp"
      28             : #include "Utilities/TMPL.hpp"
      29             : 
      30             : /// \cond
      31             : class DataVector;
      32             : template <size_t VolumeDim>
      33             : class ElementId;
      34             : template <size_t Dim>
      35             : class Mesh;
      36             : namespace Parallel {
      37             : template <typename Metavariables>
      38             : class GlobalCache;
      39             : }  // namespace Parallel
      40             : namespace domain::Tags {
      41             : template <size_t Dim>
      42             : struct Mesh;
      43             : template <size_t Dim, typename Frame>
      44             : struct Coordinates;
      45             : }  // namespace domain::Tags
      46             : /// \endcond
      47             : 
      48             : namespace control_system::measurements {
      49             : /*!
      50             :  * \brief A `control_system::protocols::Measurement` that relies on one
      51             :  * apparent horizon, the template parameter `Object`, and one excision surface.
      52             :  */
      53             : template <::domain::ObjectLabel Object>
      54           1 : struct CharSpeed : tt::ConformsTo<protocols::Measurement> {
      55           0 :   static std::string name() { return "CharSpeed" + ::domain::name(Object); }
      56             : 
      57             :   /*!
      58             :    * \brief A `control_system::protocols::Submeasurement` that does an
      59             :    * interpolation to the excision boundary for this `Object` from the elements.
      60             :    *
      61             :    * This does not go through the interpolation framework.
      62             :    */
      63           1 :   struct Excision : tt::ConformsTo<protocols::Submeasurement> {
      64           0 :     static std::string name() { return CharSpeed::name() + "::Excision"; }
      65             : 
      66             :    private:
      67             :     template <typename ControlSystems>
      68           0 :     struct InterpolationTarget
      69             :         : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
      70           0 :       static std::string name() {
      71             :         return "ControlSystemCharSpeedExcision" + ::domain::name(Object);
      72             :       }
      73             : 
      74           0 :       using temporal_id = ::Tags::TimeAndPrevious<1>;
      75             : 
      76           0 :       using vars_to_interpolate_to_target =
      77             :           tmpl::list<gr::Tags::Lapse<DataVector>,
      78             :                      gr::Tags::Shift<DataVector, 3, Frame::Distorted>,
      79             :                      gr::Tags::ShiftyQuantity<DataVector, 3, Frame::Distorted>,
      80             :                      gr::Tags::SpatialMetric<DataVector, 3, Frame::Distorted>>;
      81           0 :       using compute_vars_to_interpolate =
      82             :           ah::ComputeExcisionBoundaryVolumeQuantities;
      83           0 :       using compute_items_on_source =
      84             :           tmpl::list<::Tags::TimeAndPreviousCompute<1>>;
      85           0 :       using compute_items_on_target =
      86             :           tmpl::list<gr::Tags::DetAndInverseSpatialMetricCompute<
      87             :               DataVector, 3, Frame::Distorted>>;
      88           0 :       using compute_target_points =
      89             :           intrp::TargetPoints::Sphere<InterpolationTarget, ::Frame::Grid>;
      90           0 :       using post_interpolation_callbacks =
      91             :           tmpl::list<control_system::RunCallbacks<Excision, ControlSystems>>;
      92             : 
      93             :       template <typename Metavariables>
      94           0 :       using interpolating_component =
      95             :           typename Metavariables::gh_dg_element_array;
      96             :     };
      97             : 
      98             :    public:
      99             :     template <typename ControlSystems>
     100           0 :     using interpolation_target_tag = InterpolationTarget<ControlSystems>;
     101             : 
     102             :     template <typename ControlSystems>
     103           0 :     using event = NonFactoryCreatableWrapper<
     104             :         intrp::Events::InterpolateWithoutInterpComponent<
     105             :             3, InterpolationTarget<ControlSystems>, ::ah::source_vars<3>>>;
     106             :   };
     107             : 
     108             :   /*!
     109             :    * \brief A `control_system::protocols::Submeasurement` that starts the
     110             :    * interpolation to the interpolation target in order to find the apparent
     111             :    * horizon.
     112             :    */
     113           1 :   struct Horizon : tt::ConformsTo<protocols::Submeasurement> {
     114           0 :     static std::string name() { return CharSpeed::name() + "::Horizon"; }
     115             : 
     116             :    private:
     117             :     template <typename ControlSystems>
     118           0 :     struct InterpolationTarget
     119             :         : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
     120             :      private:
     121           0 :       static constexpr size_t index =
     122             :           Object == ::domain::ObjectLabel::A ? 1_st : 2_st;
     123             : 
     124             :      public:
     125           0 :       static std::string name() {
     126             :         return "ControlSystemCharSpeedAh" + ::domain::name(Object);
     127             :       }
     128             : 
     129             :       // Separate temporal IDs for each object
     130           0 :       using temporal_id = ::Tags::TimeAndPrevious<index>;
     131             : 
     132           0 :       using vars_to_interpolate_to_target =
     133             :           ::ah::vars_to_interpolate_to_target<3, ::Frame::Distorted>;
     134           0 :       using compute_vars_to_interpolate = ::ah::ComputeHorizonVolumeQuantities;
     135           0 :       using compute_items_on_source =
     136             :           tmpl::list<::Tags::TimeAndPreviousCompute<index>>;
     137           0 :       using compute_items_on_target = tmpl::push_back<
     138             :           ::ah::compute_items_on_target<3, Frame::Distorted>,
     139             :           ylm::Tags::TimeDerivStrahlkorperCompute<Frame::Distorted>>;
     140           0 :       using compute_target_points =
     141             :           intrp::TargetPoints::ApparentHorizon<InterpolationTarget,
     142             :                                                ::Frame::Distorted>;
     143           0 :       using post_interpolation_callbacks =
     144             :           tmpl::list<intrp::callbacks::FindApparentHorizon<InterpolationTarget,
     145             :                                                            ::Frame::Distorted>>;
     146           0 :       using horizon_find_failure_callback =
     147             :           intrp::callbacks::ErrorOnFailedApparentHorizon;
     148           0 :       using post_horizon_find_callbacks =
     149             :           tmpl::list<control_system::RunCallbacks<Horizon, ControlSystems>>;
     150             :     };
     151             : 
     152             :    public:
     153             :     template <typename ControlSystems>
     154           0 :     using interpolation_target_tag = InterpolationTarget<ControlSystems>;
     155             : 
     156             :     template <typename ControlSystems>
     157           0 :     using event = NonFactoryCreatableWrapper<intrp::Events::Interpolate<
     158             :         3, InterpolationTarget<ControlSystems>, ::ah::source_vars<3>>>;
     159             :   };
     160             : 
     161           0 :   using submeasurements = tmpl::list<Horizon, Excision>;
     162             : };
     163             : }  // namespace control_system::measurements

Generated by: LCOV version 1.14