|
OpenWalnut
1.2.5
|
Implements a tensor that has the same number of components in every direction. More...
#include <WTensor.h>
Inheritance diagram for WTensor< order, dim, Data_T >:Public Member Functions | |
| WTensor () | |
| Standard constructor. | |
| WTensor (WTensorSym< order, dim, Data_T > const &t) | |
| Construct a Tensor from a symmetric tensor. | |
| WTensor const & | operator= (WTensorSym< order, dim, Data_T > const &t) |
| Copy from a symmetric tensor. | |
Implements a tensor that has the same number of components in every direction.
| 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:
Examples:
Construct a tensor of order 2 and dimension 3 (i.e. a 3x3-Matrix):
WTensor< 2, 3 > w;
Change Element (2,0) to 4.0:
w( 2, 0 ) = 4.0;
Construct a 4D-vector:
WTensor< 1, 4 > v;
Access v at position 2:
v( 2 ) = ...;
std::vector< int > i( 1, 2 ); v[ i ] = ...;
| WTensor< order, dim, Data_T >::WTensor | ( | WTensorSym< order, dim, Data_T > const & | t | ) |
Construct a Tensor from a symmetric tensor.
| t | A symmetric tensor. |
Definition at line 110 of file WTensor.h.
References WTensor< order, dim, Data_T >::operator=().
| WTensor< order, dim, Data_T > const & WTensor< order, dim, Data_T >::operator= | ( | WTensorSym< order, dim, Data_T > const & | t | ) |
Copy from a symmetric tensor.
| t | A symmetric tensor. |
Definition at line 117 of file WTensor.h.
References WTensorBase< order, dim, Data_T >::operator=().
Referenced by WTensor< order, dim, Data_T >::WTensor().
1.8.1