SpECTRE
v2024.09.29
|
Classes | |
struct | AddSub |
Defines the tensor expression representing the addition or subtraction of two tensor expressions. More... | |
struct | AddSub< T1, T2, ArgsList1< Args1... >, ArgsList2< Args2... >, Sign > |
struct | Divide |
Defines the tensor expression representing the quotient of one tensor expression divided by another tensor expression that evaluates to a rank 0 tensor. More... | |
struct | LhsTensorSymmAndIndices |
Determines and stores a LHS tensor's symmetry and index list from a RHS tensor expression and desired LHS index order. More... | |
struct | LhsTensorSymmAndIndices< tmpl::list< RhsTensorIndices... >, tmpl::list< LhsTensorIndices... >, tmpl::integral_list< std::int32_t, RhsSymm... >, RhsTensorIndexTypeList, NumLhsIndices, NumRhsIndices, std::index_sequence< LhsInts... > > |
struct | MarkAsNumberAsExpression |
Marks a class as being a NumberAsExpression<DataType> More... | |
struct | Negate |
Defines the tensor expression representing the negation of a tensor expression. More... | |
struct | NumberAsExpression |
Defines an expression representing a number. More... | |
struct | OuterProduct |
Defines the tensor expression representing the outer product of two tensor expressions. More... | |
struct | OuterProduct< T1, T2, IndexList1< Indices1... >, IndexList2< Indices2... >, ArgsList1< Args1... >, ArgsList2< Args2... > > |
struct | SquareRoot |
Defines the tensor expression representing the square root of a tensor expression that evaluates to a rank 0 tensor. More... | |
struct | TensorAsExpression |
Defines an expression representing a Tensor. More... | |
struct | TensorAsExpression< Tensor< X, Symm< SymmValues... >, IndexList< Indices... > >, ArgsList< Args... > > |
struct | TensorContract |
struct | tensorindex_list_is_valid |
Determine whether or not a given list of TensorIndexs is valid to be used with a tensor. More... | |
struct | tensorindex_list_is_valid< tmpl::list< TensorIndices... > > |
Typedefs | |
template<typename TensorIndexList1 , typename TensorIndexList2 > | |
using | generic_indices_at_same_positions = implementation defined |
Determine whether or not two lists of TensorIndexs contain the same generic indices at the same positions. More... | |
Functions | |
template<auto &... LhsTensorIndices, typename LhsDataType , typename LhsSymmetry , typename LhsIndexList , typename Derived , typename RhsDataType , typename RhsSymmetry , typename RhsIndexList , typename... RhsTensorIndices> | |
void | evaluate (const gsl::not_null< Tensor< LhsDataType, LhsSymmetry, LhsIndexList > * > lhs_tensor, const TensorExpression< Derived, RhsDataType, RhsSymmetry, RhsIndexList, tmpl::list< RhsTensorIndices... > > &rhs_tensorexpression) |
Assign the result of a RHS tensor expression to a tensor with the LHS index order set in the template parameters. More... | |
template<auto &... LhsTensorIndices, typename RhsTE , Requires< std::is_base_of_v< Expression, RhsTE > > = nullptr> | |
auto | evaluate (const RhsTE &rhs_tensorexpression) |
Assign the result of a RHS tensor expression to a tensor with the LHS index order set in the template parameters. More... | |
template<auto &... LhsTensorIndices, typename LhsDataType , typename RhsDataType , typename LhsSymmetry , typename LhsIndexList , typename Derived , typename RhsSymmetry , typename RhsIndexList , typename... RhsTensorIndices> | |
void | update (const gsl::not_null< Tensor< LhsDataType, LhsSymmetry, LhsIndexList > * > lhs_tensor, const TensorExpression< Derived, RhsDataType, RhsSymmetry, RhsIndexList, tmpl::list< RhsTensorIndices... > > &rhs_tensorexpression) |
If the LHS tensor is used in the RHS expression, this should be used to assign a LHS tensor to the result of a RHS tensor expression that contains it. More... | |
template<size_t NumIndices1, size_t NumIndices2> | |
constexpr std::array< size_t, NumIndices2 > | compute_tensorindex_transformation (const std::array< size_t, NumIndices1 > &tensorindices1, const std::array< size_t, NumIndices2 > &tensorindices2) |
Computes a transformation from one generic tensor index order to another. More... | |
template<size_t NumIndicesIn, size_t NumIndicesOut> | |
constexpr std::array< size_t, NumIndicesOut > | transform_multi_index (const std::array< size_t, NumIndicesIn > &input_multi_index, const std::array< size_t, NumIndicesOut > &tensorindex_transformation) |
Computes the tensor multi-index that is equivalent to a given tensor multi-index, according to the differences in their generic index orders. More... | |
template<auto &... LhsTensorIndices, typename X , typename LhsSymmetry , typename LhsIndexList , typename N , Requires< std::is_arithmetic_v< N > > = nullptr> | |
void | evaluate (const gsl::not_null< Tensor< X, LhsSymmetry, LhsIndexList > * > lhs_tensor, const N rhs_value) |
Assign a number to components of a tensor with the LHS index order set in the template parameters. More... | |
template<auto &... LhsTensorIndices, typename X , typename LhsSymmetry , typename LhsIndexList , typename N > | |
void | evaluate (const gsl::not_null< Tensor< X, LhsSymmetry, LhsIndexList > * > lhs_tensor, const std::complex< N > &rhs_value) |
Assign a number to components of a tensor with the LHS index order set in the template parameters. More... | |
Holds all possible TensorExpressions currently implemented
|
constexpr |
Computes a transformation from one generic tensor index order to another.
In most cases, the elements of the transformation are simply the positions of the second list of generic indices in the first list of generic indices. Put another way, for some i
, tensorindices2[i] == tensorindices1[index_transformation[i]]
.
Here is an example of what the algorithm does:
Transformation between (1) tensorindices1
:
tensorindices2
:
returned tensorindex_transformation
:
One special case scenario to note is when concrete time indices are involved in the transformation. Consider transforming a multi-index for some tensor {1, PLACEHOLDER_VALUE, 0, PLACEHOLDER_VALUE}
, where PLACEHOLDER_VALUE
is defined by TensorIndexTransformation_detail::time_index_position_placeholder
. 1
and 0
are the positions of
NumIndices1 | the number of indices for the first generic index order |
NumIndices2 | the number of indices for the second generic index order |
tensorindices1 | the TensorIndex values of the first generic index order |
tensorindices2 | the TensorIndex values of the second generic index order |
Returns: a transformation from the first generic index order to the second
|
constexpr |
Computes the tensor multi-index that is equivalent to a given tensor multi-index, according to the differences in their generic index orders.
Here is an example of what the algorithm does:
Transform (input) multi-index of tensorindex_transformation
:
input_multi_index
:
returned equivalent output_multi_index
:
One special case scenario to note is when concrete time indices are involved in the transformation. Consider transforming a multi-index for some tensor tensorindex_transformation
) would need to be {1, PLACEHOLDER_VALUE, 0, PLACEHOLDER_VALUE}
, where PLACEHOLDER_VALUE
is defined by TensorIndexTransformation_detail::time_index_position_placeholder
. 1
and 0
are the positions of 0
at each position where this placeholder is found in the transformation. For example, if input_multi_index
is {1, 2}
, representing {2, 0, 1, 0}
, representing
NumIndicesIn | the number of indices |
NumIndicesOut | the number of indices |
input_multi_index | the input tensor multi-index to transform |
tensorindex_transformation | the positions of the output's generic indices in the input's generic indices (see example in details) |
Returns: the output tensor multi-index that is equivalent to input_multi_index
, according to generic index order differences