SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
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>>;

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 {

The documentation for this class was generated from the following file:
  • src/DataStructures/CachedTempBuffer.hpp