SpECTRE  v2024.09.29
Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > > Struct Template Reference

Stores necessary data and interpolates on to new time points at scri+, differentiating 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_argument)
 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 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 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 Tag>
struct Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > >

Stores necessary data and interpolates on to new time points at scri+, differentiating 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 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 requested times (supplied via insert_target_time()), differentiating the interpolation before returning.

Template parameters:

  • VectorTypeToInterpolate: the vector type associated with the values to interpolate.
  • Tags::Du<Tag>: 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 or Tags::Du (this case), 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 Tag >
bool Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > >::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 Tag >
void Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > >::insert_data ( const DataVector u_bondi,
const VectorTypeToInterpolate &  to_interpolate_argument 
)
inline

provide data to the interpolation manager.

Details

u_bondi is a vector of inertial times, and to_interpolate_argument is the vector of values that will be interpolated to target times and differentiated.

◆ insert_target_time()

template<typename VectorTypeToInterpolate , typename Tag >
void Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > >::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 Tag >
std::pair< double, VectorTypeToInterpolate > Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > >::interpolate_and_pop_first_time

Interpolate to the first target time in the queue, returning both the time and the interpolated 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 Tag >
std::pair< double, VectorTypeToInterpolate > Cce::ScriPlusInterpolationManager< VectorTypeToInterpolate, Tags::Du< Tag > >::interpolate_first_time

Interpolate to the first target time in the queue, returning both the time and the interpolated 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: