SpECTRE  2021.08.02
CachedTempBuffer< Computer, Tags > Class Template Reference

#include <CachedTempBuffer.hpp>

Public Types

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

Public Member Functions

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

Detailed Description

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

A temporary buffer with contents computed on demand.

When an entry in the buffer is first requested, it is computed by the Computer class. 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<Computer<DataType>, 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 noexcept {
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21