OpenWalnut
1.2.5
|
Implements a symmetric tensor that has the same number of components in every direction. More...
#include <WTensorSym.h>
Public Member Functions | |
WTensorSym () | |
Default constructor of the symmetric tensor. | |
WTensorSym (const WValue< Data_T > &data) | |
Constructs and initializes the symmetrical Tensor with a WValue. |
Implements a symmetric tensor that has the same number of components in every direction.
A symmetric tensor has the same value for every permutation of the indices.
For example, t(i,j) = t(j,i) for a tensor of order 2, and t(i,j,k) = t(j,i,k) = t(i,k,j) = t(j,k,i) = t(k,i,j) = t(k,j,i) for a tensor of order 3.
order | The order of the tensor. |
dim | The dimension of the tensor, i.e. the number of components in each direction. |
Data_T | The datatype of the components, double by default. |
Access to specific elements of the tensor can be achieved in 2 ways:
This class optimizes memory usage. For example, for a symmetric tensor of order 2 and dimension 3, only 6 values (instead of 9) need to be stored. However, there is additional memory overhead per class (i.e. per allocation of the template parameters), which is of constant size and thus does not depend on the number of instances.
Usage and operators are the same as with WTensor. Note that changes to an element t(i,j,k,...) also change every element whose indices are a permutation of i,j,k... .
Definition at line 70 of file WTensorSym.h.
WTensorSym< order, dim, Data_T >::WTensorSym | ( | ) |
Default constructor of the symmetric tensor.
Definition at line 92 of file WTensorSym.h.
|
explicit |
Constructs and initializes the symmetrical Tensor with a WValue.
data | The components in same ordering as for the data member m_data is required, ( |
Definition at line 98 of file WTensorSym.h.