////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// More...
#include <matrices.h>
Public Member Functions | |
RankThreeTensor () | |
Empty constructor. More... | |
RankThreeTensor (const RankThreeTensor &source_tensor) | |
Copy constructor: Deep copy. More... | |
RankThreeTensor & | operator= (const RankThreeTensor &source_tensor) |
Copy assignement. More... | |
RankThreeTensor (const unsigned long &n) | |
One parameter constructor produces a cubic nxnxn tensor. More... | |
RankThreeTensor (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3) | |
Three parameter constructor, general non-square tensor. More... | |
RankThreeTensor (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const T &initial_val) | |
Three parameter constructor, general non-square tensor. More... | |
virtual | ~RankThreeTensor () |
Destructor: delete the pointers. More... | |
void | resize (const unsigned long &n) |
Resize to a square nxnxn tensor. More... | |
void | resize (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3) |
Resize to a general tensor. More... | |
void | resize (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const T &initial_value) |
Resize to a general tensor. More... | |
void | initialise (const T &val) |
Initialise all values in the tensor to val. More... | |
unsigned long | nindex1 () const |
Return the range of index 1 of the tensor. More... | |
unsigned long | nindex2 () const |
Return the range of index 2 of the tensor. More... | |
unsigned long | nindex3 () const |
Return the range of index 3 of the tensor. More... | |
T & | operator() (const unsigned long &i, const unsigned long &j, const unsigned long &k) |
Overload the round brackets to give access as a(i,j,k) More... | |
T | operator() (const unsigned long &i, const unsigned long &j, const unsigned long &k) const |
Overload a const version for read-only access as a(i,j,k) More... | |
Private Member Functions | |
void | range_check (const unsigned long &i, const unsigned long &j, const unsigned long &k) const |
Range check to catch when an index is out of bounds, if so, it issues a warning message and dies by throwing an OomphLibError . More... | |
Private Attributes | |
T * | Tensordata |
Private internal representation as pointer to data. More... | |
unsigned | N |
1st Tensor dimension More... | |
unsigned | M |
2nd Tensor dimension More... | |
unsigned | P |
3rd Tensor dimension More... | |
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
A Rank 3 Tensor class
Definition at line 1369 of file matrices.h.
|
inline |
Empty constructor.
Definition at line 1425 of file matrices.h.
|
inline |
Copy constructor: Deep copy.
Definition at line 1428 of file matrices.h.
References i, oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::nindex1(), oomph::RankThreeTensor< T >::nindex2(), oomph::RankThreeTensor< T >::nindex3(), oomph::RankThreeTensor< T >::P, oomph::ElementGeometry::T, and oomph::RankThreeTensor< T >::Tensordata.
|
inline |
One parameter constructor produces a cubic nxnxn tensor.
Definition at line 1483 of file matrices.h.
References oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::P, oomph::ElementGeometry::T, and oomph::RankThreeTensor< T >::Tensordata.
|
inline |
Three parameter constructor, general non-square tensor.
Definition at line 1498 of file matrices.h.
References oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::P, oomph::ElementGeometry::T, and oomph::RankThreeTensor< T >::Tensordata.
|
inline |
Three parameter constructor, general non-square tensor.
Definition at line 1516 of file matrices.h.
References oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::P, oomph::ElementGeometry::T, and oomph::RankThreeTensor< T >::Tensordata.
|
inlinevirtual |
Destructor: delete the pointers.
Definition at line 1532 of file matrices.h.
References oomph::RankThreeTensor< T >::Tensordata.
|
inline |
Initialise all values in the tensor to val.
Definition at line 1642 of file matrices.h.
References i, oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::P, and oomph::RankThreeTensor< T >::Tensordata.
Referenced by oomph::ScalarAdvectionEquations< DIM >::dflux_du(), oomph::RankThreeTensor< T >::RankThreeTensor(), and oomph::RankThreeTensor< T >::resize().
|
inline |
Return the range of index 1 of the tensor.
Definition at line 1651 of file matrices.h.
References oomph::RankThreeTensor< T >::N.
Referenced by oomph::RankThreeTensor< T >::operator=(), and oomph::RankThreeTensor< T >::RankThreeTensor().
|
inline |
Return the range of index 2 of the tensor.
Definition at line 1657 of file matrices.h.
References oomph::RankThreeTensor< T >::M.
Referenced by oomph::RankThreeTensor< T >::operator=(), and oomph::RankThreeTensor< T >::RankThreeTensor().
|
inline |
Return the range of index 3 of the tensor.
Definition at line 1663 of file matrices.h.
References oomph::RankThreeTensor< T >::P.
Referenced by oomph::RankThreeTensor< T >::operator=(), and oomph::RankThreeTensor< T >::RankThreeTensor().
|
inline |
Overload the round brackets to give access as a(i,j,k)
Definition at line 1669 of file matrices.h.
References i, oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::P, oomph::RankThreeTensor< T >::range_check(), and oomph::RankThreeTensor< T >::Tensordata.
|
inline |
Overload a const version for read-only access as a(i,j,k)
Definition at line 1680 of file matrices.h.
References i, oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::P, oomph::RankThreeTensor< T >::range_check(), and oomph::RankThreeTensor< T >::Tensordata.
|
inline |
Copy assignement.
Definition at line 1450 of file matrices.h.
References i, oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::nindex1(), oomph::RankThreeTensor< T >::nindex2(), oomph::RankThreeTensor< T >::nindex3(), oomph::RankThreeTensor< T >::P, and oomph::RankThreeTensor< T >::resize().
|
inlineprivate |
Range check to catch when an index is out of bounds, if so, it issues a warning message and dies by throwing an OomphLibError
.
Definition at line 1386 of file matrices.h.
References i, oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, and oomph::RankThreeTensor< T >::P.
Referenced by oomph::RankThreeTensor< T >::operator()().
|
inline |
Resize to a square nxnxn tensor.
Definition at line 1539 of file matrices.h.
Referenced by oomph::RankThreeTensor< T >::operator=().
|
inline |
Resize to a general tensor.
Definition at line 1545 of file matrices.h.
References i, oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::P, oomph::ElementGeometry::T, and oomph::RankThreeTensor< T >::Tensordata.
|
inline |
Resize to a general tensor.
Definition at line 1593 of file matrices.h.
References i, oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::M, oomph::RankThreeTensor< T >::N, oomph::RankThreeTensor< T >::P, oomph::ElementGeometry::T, and oomph::RankThreeTensor< T >::Tensordata.
|
private |
2nd Tensor dimension
Definition at line 1379 of file matrices.h.
Referenced by oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::nindex2(), oomph::RankThreeTensor< T >::operator()(), oomph::RankThreeTensor< T >::operator=(), oomph::RankThreeTensor< T >::range_check(), oomph::RankThreeTensor< T >::RankThreeTensor(), and oomph::RankThreeTensor< T >::resize().
|
private |
1st Tensor dimension
Definition at line 1376 of file matrices.h.
Referenced by oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::nindex1(), oomph::RankThreeTensor< T >::operator=(), oomph::RankThreeTensor< T >::range_check(), oomph::RankThreeTensor< T >::RankThreeTensor(), and oomph::RankThreeTensor< T >::resize().
|
private |
3rd Tensor dimension
Definition at line 1382 of file matrices.h.
Referenced by oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::nindex3(), oomph::RankThreeTensor< T >::operator()(), oomph::RankThreeTensor< T >::operator=(), oomph::RankThreeTensor< T >::range_check(), oomph::RankThreeTensor< T >::RankThreeTensor(), and oomph::RankThreeTensor< T >::resize().
|
private |
Private internal representation as pointer to data.
Definition at line 1373 of file matrices.h.
Referenced by oomph::RankThreeTensor< T >::initialise(), oomph::RankThreeTensor< T >::operator()(), oomph::RankThreeTensor< T >::RankThreeTensor(), oomph::RankThreeTensor< T >::resize(), and oomph::RankThreeTensor< T >::~RankThreeTensor().