SpECTRE  2021.08.02
TensorIndex< I, > Struct Template Reference

Represents the geeric indices in a TensorExpression. More...

#include <TensorIndex.hpp>

Public Types

using value_type = std::size_t
 
using type = TensorIndex< I >
 

Static Public Attributes

static constexpr value_type value = I
 
static constexpr UpLo valence
 
static constexpr bool is_spacetime = I < TensorIndex_detail::spatial_sentinel
 

Detailed Description

template<std::size_t I, Requires<(I< TensorIndex_detail::max_sentinel)> = nullptr>
struct TensorIndex< I, >

Represents the geeric indices in a TensorExpression.

Details

Used to denote a tensor index in a tensor slot. This allows the following type of expressions to work:

auto T = evaluate<ti_a, ti_b>(F(ti_a, ti_b) + S(ti_b, ti_a));

where decltype(ti_a) == TensorIndex<0> and decltype(ti_b) == TensorIndex<1>. That is, ti_a and ti_b are placeholders for objects of type TensorIndex<0> and TensorIndex<1>, respectively.

Member Data Documentation

◆ valence

template<std::size_t I, Requires<(I< TensorIndex_detail::max_sentinel)> = nullptr>
constexpr UpLo TensorIndex< I, >::valence
staticconstexpr
Initial value:
=
((I < TensorIndex_detail::upper_sentinel) or
(I >= TensorIndex_detail::spatial_sentinel and
I < TensorIndex_detail::upper_spatial_sentinel))
@ Up
Contravariant, or Upper index.
@ Lo
Covariant, or Lower index.