SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce/InterfaceManagers - GhInterfaceManager.hpp Hit Total Coverage
Commit: cd74d65bdc718fd7e344eaec61dc6334dd4d366b Lines: 1 10 10.0 %
Date: 2022-08-12 23:56:47
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 <memory>
       7             : #include <optional>
       8             : #include <tuple>
       9             : 
      10             : #include "DataStructures/Tensor/Tensor.hpp"
      11             : #include "DataStructures/Tensor/TypeAliases.hpp"
      12             : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
      13             : #include "Options/Options.hpp"
      14             : #include "Parallel/CharmPupable.hpp"
      15             : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
      16             : #include "Time/TimeStepId.hpp"
      17             : 
      18             : namespace Cce {
      19           0 : namespace InterfaceManagers {
      20             : 
      21             : /// \cond
      22             : class GhLocalTimeStepping;
      23             : class GhLockstep;
      24             : /// \endcond
      25             : 
      26             : /*!
      27             :  * \brief Abstract base class for storage and retrieval of generalized harmonic
      28             :  * quantities communicated from a Cauchy simulation to the Cce system.
      29             :  *
      30             :  * \details The functions that are required to be overriden in the derived
      31             :  * classes are:
      32             :  * - `GhInterfaceManager::get_clone()`: should return a
      33             :  * `std::unique_ptr<GhInterfaceManager>` with cloned state.
      34             :  * - `GhInterfaceManager::insert_gh_data()`: should store the portions
      35             :  * of the provided generalized harmonic data that are required to provide useful
      36             :  * boundary values for the CCE evolution at requested timesteps.
      37             :  * - `GhInterfaceManager::request_gh_data()`: should register requests
      38             :  * from the CCE evolution for boundary data.
      39             :  * - `GhInterfaceManager::retrieve_and_remove_first_ready_gh_data()`:
      40             :  * should return a `std::optional<std::tuple<TimeStepId,
      41             :  * tnsr::aa<DataVector, 3>, tnsr::iaa<DataVector, 3>, tnsr::aa<DataVector, 3>>>`
      42             :  * containing the boundary data associated with the oldest requested timestep if
      43             :  * enough data has been supplied via `insert_gh_data()` to determine the
      44             :  * boundary data. Otherwise, return a `std::nullopt` to indicate that the CCE
      45             :  * system must continue waiting for generalized harmonic input.
      46             :  * - `GhInterfaceManager::number_of_pending_requests()`: should return
      47             :  * the number of requests that have been registered to the class that do not yet
      48             :  * been retrieved via `retrieve_and_remove_first_ready_gh_data()`.
      49             :  * - `GhInterfaceManager::number_of_gh_times()`: should return the
      50             :  * number of time steps sent to `insert_gh_data()` that have not yet been
      51             :  * retrieved via `retrieve_and_remove_first_ready_gh_data()`.
      52             :  */
      53           1 : class GhInterfaceManager : public PUP::able {
      54             :  public:
      55           0 :   using gh_variables = Variables<
      56             :    tmpl::list<gr::Tags::SpacetimeMetric<3, ::Frame::Inertial, DataVector>,
      57             :               GeneralizedHarmonic::Tags::Pi<3, ::Frame::Inertial>,
      58             :               GeneralizedHarmonic::Tags::Phi<3, ::Frame::Inertial>>>;
      59             : 
      60           0 :   WRAPPED_PUPable_abstract(GhInterfaceManager);  // NOLINT
      61             : 
      62           0 :   virtual std::unique_ptr<GhInterfaceManager> get_clone() const = 0;
      63             : 
      64           0 :   virtual void request_gh_data(const TimeStepId&) = 0;
      65             : 
      66           0 :   virtual auto retrieve_and_remove_first_ready_gh_data()
      67             :       -> std::optional<std::tuple<TimeStepId, gh_variables>> = 0;
      68             : 
      69           0 :   virtual size_t number_of_pending_requests() const = 0;
      70             : 
      71           0 :   virtual size_t number_of_gh_times() const = 0;
      72             : };
      73             : 
      74             : }  // namespace InterfaceManagers
      75             : }  // namespace Cce

Generated by: LCOV version 1.14