OpenWalnut  1.4.0
Public Member Functions
WTensor< order, dim, Data_T > Class Template Reference

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 >:

List of all members.

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.

Detailed Description

template<std::size_t order, std::size_t dim, typename Data_T = double>
class WTensor< order, dim, Data_T >

Implements a tensor that has the same number of components in every direction.

Template Parameters:
orderThe order of the tensor.
dimThe dimension of the tensor, i.e. the number of components in each direction.
Data_TThe datatype of the components, double by default.
Notes:
The dimension may never be 0.
Notes:
The type Data_T may not throw exceptions on construction, destruction or during any assignment operator.

Access to specific elements of the tensor can be achieved in 2 ways:

Notes:
The datatype of the array or std::vector can be any type castable to std::size_t.
Notes:
There is no bounds checking for the array version of operator [].
Notes:
Operator () is not supported for orders larger than 6.

Examples:

WTensor< 2, 3 > w;

w( 2, 0 ) = 4.0;

WTensor< 1, 4 > v;

v( 2 ) = ...;

std::vector< int > i( 1, 2 ); v[ i ] = ...;

Definition at line 78 of file WTensor.h.


Constructor & Destructor Documentation

template<std::size_t order, std::size_t dim, typename Data_T >
WTensor< order, dim, Data_T >::WTensor ( )

Standard constructor.

Definition at line 104 of file WTensor.h.

template<std::size_t order, std::size_t dim, typename Data_T>
WTensor< order, dim, Data_T >::WTensor ( WTensorSym< order, dim, Data_T > const &  t)

Construct a Tensor from a symmetric tensor.

Parameters:
tA symmetric tensor.

Definition at line 110 of file WTensor.h.

References WTensor< order, dim, Data_T >::operator=().


Member Function Documentation

template<std::size_t order, std::size_t dim, typename Data_T>
WTensor< order, dim, Data_T > const & WTensor< order, dim, Data_T >::operator= ( WTensorSym< order, dim, Data_T > const &  t)

Copy from a symmetric tensor.

Parameters:
tA symmetric tensor.
Returns:
new tensor

Definition at line 117 of file WTensor.h.

References WTensorBase< order, dim, Data_T >::operator=().

Referenced by WTensor< order, dim, Data_T >::WTensor().


The documentation for this class was generated from the following file: