SpECTRE  v2024.04.12
CachedTempBuffer< Tags > Class Template Reference

#include <CachedTempBuffer.hpp>

Public Types

using tags_list = tmpl::list< Tags... >
 

Public Member Functions

 CachedTempBuffer (const size_t size)
 Construct the buffer with the given computer. size is passed to the underlying TempBuffer constructor.
 
template<typename Computer , typename Tag >
const Tag::type & get_var (const Computer &computer, Tag)
 Obtain a value from the buffer, computing it if necessary.
 
size_t number_of_grid_points () const
 

Detailed Description

template<typename... Tags>
class CachedTempBuffer< Tags >

A temporary buffer with contents computed on demand.

When an entry in the buffer is first requested, it is computed by the computer that is passed to the get_var function. Subsequent requests just return the cached value. The computer can itself request data from the cache to use in its computations.

For the cache

template <typename DataType>
using Cache =
CachedTempBuffer<Tags::Scalar1<DataType>, Tags::Scalar2<DataType>,
Tags::Vector1<DataType>, Tags::Vector2<DataType>>;
Definition: CachedTempBuffer.hpp:29

the function used to compute Tags::Scalar2<DataType> is

void operator()(const gsl::not_null<Scalar<DataType>*> scalar2,
const gsl::not_null<Cache<DataType>*> cache,
Tags::Scalar2<DataType> /*meta*/) const {
Definition: ContractFirstNIndices.hpp:16
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183

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