SpECTRE  2021.08.02
TensorExpressions::TensorAsExpression< T, ArgsList > Struct Template Reference

Defines an expression representing a Tensor. More...

Detailed Description

template<typename T, typename ArgsList>
struct TensorExpressions::TensorAsExpression< T, ArgsList >

Defines an expression representing a Tensor.

Details

In order to represent a tensor as an expression, instead of having Tensor derive off of TensorExpression, a TensorAsExpression derives off of TensorExpression and contains a pointer to a Tensor. The reason having Tensor derive off of TensorExpression is problematic is that the index structure is part of the type of the TensorExpression, so every possible permutation and combination of indices must be derived from. For a rank 3 tensor, this is already over 500 base classes, which the Intel compiler takes too long to compile.

Template Parameters
Tthe type of Tensor being represented as an expression
ArgsListthe tensor indices, e.g. _a and _b in F(_a, _b)