SpECTRE  v2021.11.01
Cce::InterfaceManagers::GhLockstep Class Reference

Simple implementation of a GhInterfaceManager that only provides boundary data on matching TimeStepIds. More...

#include <GhLockstep.hpp>

Public Types

using options = tmpl::list<>
 
using gh_variables = Variables< tmpl::list< gr::Tags::SpacetimeMetric< 3, ::Frame::Inertial, DataVector >, GeneralizedHarmonic::Tags::Pi< 3, ::Frame::Inertial >, GeneralizedHarmonic::Tags::Phi< 3, ::Frame::Inertial > > >
 
- Public Types inherited from Cce::InterfaceManagers::GhInterfaceManager
using gh_variables = Variables< tmpl::list< gr::Tags::SpacetimeMetric< 3, ::Frame::Inertial, DataVector >, GeneralizedHarmonic::Tags::Pi< 3, ::Frame::Inertial >, GeneralizedHarmonic::Tags::Phi< 3, ::Frame::Inertial > > >
 
using creatable_classes = tmpl::list< GhLocalTimeStepping, GhLockstep >
 

Public Member Functions

 GhLockstep (CkMigrateMessage *)
 
 WRAPPED_PUPable_decl_template (GhLockstep)
 
std::unique_ptr< GhInterfaceManagerget_clone () const override
 
void insert_gh_data (TimeStepId time_id, const tnsr::aa< DataVector, 3 > &spacetime_metric, const tnsr::iaa< DataVector, 3 > &phi, const tnsr::aa< DataVector, 3 > &pi, const tnsr::aa< DataVector, 3 > &dt_spacetime_metric={}, const tnsr::iaa< DataVector, 3 > &dt_phi={}, const tnsr::aa< DataVector, 3 > &dt_pi={}) override
 Store a provided data set in a std::deque. More...
 
void insert_next_gh_time (TimeStepId, TimeStepId) override
 next time information is ignored by this implementation, so this is a no-op. More...
 
void request_gh_data (const TimeStepId &) override
 Requests are ignored by this implementation, so this is a no-op. More...
 
auto retrieve_and_remove_first_ready_gh_data () -> std::optional< std::tuple< TimeStepId, gh_variables > > override
 Return a std::optional<std::tuple> of the least recently submitted generalized harmonic boundary data if any exists and removes it from the internal std::deque, otherwise returns std::nullopt. More...
 
size_t number_of_pending_requests () const override
 This class ignores requests to ensure a one-way communication pattern, so the number of requests is always 0. More...
 
size_t number_of_gh_times () const override
 The number of times at which data from a GH evolution have been stored and not yet retrieved. More...
 
void pup (PUP::er &p) override
 Serialization for Charm++.
 
InterpolationStrategy get_interpolation_strategy () const override
 
- Public Member Functions inherited from Cce::InterfaceManagers::GhInterfaceManager
 WRAPPED_PUPable_abstract (GhInterfaceManager)
 
virtual std::unique_ptr< GhInterfaceManagerget_clone () const =0
 
virtual void insert_gh_data (TimeStepId time_id, const tnsr::aa< DataVector, 3 > &spacetime_metric, const tnsr::iaa< DataVector, 3 > &phi, const tnsr::aa< DataVector, 3 > &pi, const tnsr::aa< DataVector, 3 > &dt_spacetime_metric, const tnsr::iaa< DataVector, 3 > &dt_phi, const tnsr::aa< DataVector, 3 > &dt_pi)=0
 
virtual void insert_next_gh_time (TimeStepId time_id, TimeStepId next_time_id)=0
 
virtual void request_gh_data (const TimeStepId &)=0
 
virtual auto retrieve_and_remove_first_ready_gh_data () -> std::optional< std::tuple< TimeStepId, gh_variables > >=0
 
virtual size_t number_of_pending_requests () const =0
 
virtual size_t number_of_gh_times () const =0
 
virtual InterpolationStrategy get_interpolation_strategy () const =0
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

Simple implementation of a GhInterfaceManager that only provides boundary data on matching TimeStepIds.

Details

This version of the interface manager assumes that the CCE system and the generalized harmonic system that it communicates with evolve with an identical time stepper and on identical time step intervals (they evolve in 'lock step'). As a result, and to streamline communications, new data is always immediately 'ready' and requests are ignored to produce the behavior of just immediately gauge-transforming and sending the data to the CCE component as soon as it becomes available from the GH system.

Warning
Using this interface manager when the GH components and the CCE evolution are not identically stepped is considered undefined behavior. The outcome will likely be that CCE will fail to evolve and the boundary data will be continually inserted into a rapidly expanding inbox.

Member Function Documentation

◆ get_clone()

std::unique_ptr< GhInterfaceManager > Cce::InterfaceManagers::GhLockstep::get_clone ( ) const
overridevirtual

◆ get_interpolation_strategy()

InterpolationStrategy Cce::InterfaceManagers::GhLockstep::get_interpolation_strategy ( ) const
inlineoverridevirtual

◆ insert_gh_data()

void Cce::InterfaceManagers::GhLockstep::insert_gh_data ( TimeStepId  time_id,
const tnsr::aa< DataVector, 3 > &  spacetime_metric,
const tnsr::iaa< DataVector, 3 > &  phi,
const tnsr::aa< DataVector, 3 > &  pi,
const tnsr::aa< DataVector, 3 > &  dt_spacetime_metric = {},
const tnsr::iaa< DataVector, 3 > &  dt_phi = {},
const tnsr::aa< DataVector, 3 > &  dt_pi = {} 
)
overridevirtual

Store a provided data set in a std::deque.

Details

The lock-step constraint ensures that only the generalized harmonic variables spacetime_metric, phi, and pi are used. The remaining variables are accepted to comply with the more general abstract interface.

Implements Cce::InterfaceManagers::GhInterfaceManager.

◆ insert_next_gh_time()

void Cce::InterfaceManagers::GhLockstep::insert_next_gh_time ( TimeStepId  ,
TimeStepId   
)
inlineoverridevirtual

next time information is ignored by this implementation, so this is a no-op.

Implements Cce::InterfaceManagers::GhInterfaceManager.

◆ number_of_gh_times()

size_t Cce::InterfaceManagers::GhLockstep::number_of_gh_times ( ) const
inlineoverridevirtual

The number of times at which data from a GH evolution have been stored and not yet retrieved.

Implements Cce::InterfaceManagers::GhInterfaceManager.

◆ number_of_pending_requests()

size_t Cce::InterfaceManagers::GhLockstep::number_of_pending_requests ( ) const
inlineoverridevirtual

This class ignores requests to ensure a one-way communication pattern, so the number of requests is always 0.

Implements Cce::InterfaceManagers::GhInterfaceManager.

◆ request_gh_data()

void Cce::InterfaceManagers::GhLockstep::request_gh_data ( const TimeStepId )
inlineoverridevirtual

Requests are ignored by this implementation, so this is a no-op.

Implements Cce::InterfaceManagers::GhInterfaceManager.

◆ retrieve_and_remove_first_ready_gh_data()

auto Cce::InterfaceManagers::GhLockstep::retrieve_and_remove_first_ready_gh_data ( ) -> std::optional< std::tuple< TimeStepId, gh_variables > >
overridevirtual

Return a std::optional<std::tuple> of the least recently submitted generalized harmonic boundary data if any exists and removes it from the internal std::deque, otherwise returns std::nullopt.

Implements Cce::InterfaceManagers::GhInterfaceManager.

Member Data Documentation

◆ help

constexpr Options::String Cce::InterfaceManagers::GhLockstep::help
staticconstexpr
Initial value:
{
"Pass data between GH and CCE systems on matching timesteps only."}

The documentation for this class was generated from the following file: