SpECTRE  v2022.09.02
Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > > Struct Template Reference

Stores necessary data and interpolates on to new time points at scri+, multiplying two results together before supplying the result. More...

#include <ScriPlusInterpolationManager.hpp>

Public Member Functions

 ScriPlusInterpolationManager (const size_t target_number_of_points, const size_t vector_size, std::unique_ptr< intrp::SpanInterpolator > interpolator)
 
void insert_data (const DataVector &u_bondi, const VectorTypeToInterpolate &to_interpolate_lhs, const VectorTypeToInterpolate &to_interpolate_rhs)
 provide data to the interpolation manager. More...
 
void insert_target_time (const double time)
 Request a target time to be interpolated to when enough data has been accumulated. More...
 
bool first_time_is_ready_to_interpolate () const
 Determines whether enough data before and after the first time in the target time queue has been provided to interpolate. More...
 
const std::deque< std::pair< double, double > > & get_u_bondi_ranges () const
 
std::pair< double, VectorTypeToInterpolate > interpolate_first_time ()
 Interpolate to the first target time in the queue, returning both the time and the interpolated-and-multiplied data at that time. More...
 
std::pair< double, VectorTypeToInterpolate > interpolate_and_pop_first_time ()
 Interpolate to the first target time in the queue, returning both the time and the interpolated-and-multiplied data at that time, and remove the first time from the queue. More...
 
size_t number_of_target_times () const
 return the number of times in the target times queue
 
size_t number_of_data_points () const
 return the number of data points that have been provided to the interpolation manager
 
void pup (PUP::er &p)
 

Detailed Description

template<typename VectorTypeToInterpolate, typename MultipliesLhs, typename MultipliesRhs>
struct Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > >

Stores necessary data and interpolates on to new time points at scri+, multiplying two results together before supplying the result.

Details

The coordinate time used for the CCE evolution is not the same as the asymptotic inertial retarded time, which is determined through a separate evolution equation. This class manages the two sets of scri+ data passed in (via insert_data()) along with the set of inertial retarded times associated with that data, and interpolates to a set of inertial requested times (supplied via insert_target_time()), multiplying the two interpolation results together before returning.

Template parameters:

  • VectorTypeToInterpolate: the vector type associated with the values to interpolate.
  • Tags::Multiplies<MultipliesLhs, MultipliesRhs>: The tag associated with the interpolation procedure. This determines the behavior of the interpolation return value. The default is just interpolation, if Tag has prefix Tags::Multiplies (this case) or Tags::Du, the interpolator performs the additional multiplication or time derivative as a step in the interpolation procedure.

Member Function Documentation

◆ first_time_is_ready_to_interpolate()

template<typename VectorTypeToInterpolate , typename MultipliesLhs , typename MultipliesRhs >
bool Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > >::first_time_is_ready_to_interpolate ( ) const
inline

Determines whether enough data before and after the first time in the target time queue has been provided to interpolate.

Details

If possible, this function will require that the target time to be interpolated is reasonably centered on the range, but will settle for non-centered data if the time is too early for the given data, which is necessary to get the first couple of times out of the simulation. This function always returns false if all of the provided data is earlier than the next target time, indicating that the caller should wait until more data has been provided before interpolating.

◆ insert_data()

template<typename VectorTypeToInterpolate , typename MultipliesLhs , typename MultipliesRhs >
void Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > >::insert_data ( const DataVector u_bondi,
const VectorTypeToInterpolate &  to_interpolate_lhs,
const VectorTypeToInterpolate &  to_interpolate_rhs 
)
inline

provide data to the interpolation manager.

Details

u_bondi is a vector of inertial times, and to_interpolate_lhs and to_interpolate_rhs are the vector of values that will be interpolated to target times. The interpolation result will be the product of the interpolated lhs and rhs vectors.

◆ insert_target_time()

template<typename VectorTypeToInterpolate , typename MultipliesLhs , typename MultipliesRhs >
void Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > >::insert_target_time ( const double  time)
inline

Request a target time to be interpolated to when enough data has been accumulated.

For optimization, we assume that these are inserted in ascending order.

◆ interpolate_and_pop_first_time()

template<typename VectorTypeToInterpolate , typename MultipliesLhs , typename MultipliesRhs >
std::pair< double, VectorTypeToInterpolate > Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > >::interpolate_and_pop_first_time ( )
inline

Interpolate to the first target time in the queue, returning both the time and the interpolated-and-multiplied data at that time, and remove the first time from the queue.

Note
If this function is not able to interpolate to the full accuracy using a centered stencil, it will perform the best interpolation available.
Warning
This function will extrapolate if the target times are outside the range of data the class has been provided. This is intentional to support small extrapolation at the end of a simulation when no further data is available, but for full accuracy, check first_time_is_ready_to_interpolate before calling the interpolation functions

◆ interpolate_first_time()

template<typename VectorTypeToInterpolate , typename MultipliesLhs , typename MultipliesRhs >
std::pair< double, VectorTypeToInterpolate > Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, ::Tags::Multiplies< MultipliesLhs, MultipliesRhs > >::interpolate_first_time ( )
inline

Interpolate to the first target time in the queue, returning both the time and the interpolated-and-multiplied data at that time.

Note
If this function is not able to interpolate to the full accuracy using a centered stencil, it will perform the best interpolation available.
Warning
This function will extrapolate if the target times are outside the range of data the class has been provided. This is intentional to support small extrapolation at the end of a simulation when no further data is available, but for full accuracy, check first_time_is_ready_to_interpolate before calling the interpolation functions

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