Public Member Functions | Private Member Functions | Private Attributes | List of all members
oomph::RankThreeTensor< T > Class Template Reference

A Rank 3 Tensor class. More...

#include <matrices.h>

Public Member Functions

 RankThreeTensor ()
 Empty constructor. More...
 
 RankThreeTensor (const RankThreeTensor &source_tensor)
 Copy constructor: Deep copy. More...
 
RankThreeTensoroperator= (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...
 
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...
 

Detailed Description

template<class T>
class oomph::RankThreeTensor< T >

A Rank 3 Tensor class.

Definition at line 1337 of file matrices.h.

Constructor & Destructor Documentation

◆ RankThreeTensor() [1/5]

template<class T>
oomph::RankThreeTensor< T >::RankThreeTensor ( )
inline

Empty constructor.

Definition at line 1396 of file matrices.h.

◆ RankThreeTensor() [2/5]

template<class T>
oomph::RankThreeTensor< T >::RankThreeTensor ( const RankThreeTensor< T > &  source_tensor)
inline

◆ RankThreeTensor() [3/5]

template<class T>
oomph::RankThreeTensor< T >::RankThreeTensor ( const unsigned long &  n)
inline

One parameter constructor produces a cubic nxnxn tensor.

Definition at line 1451 of file matrices.h.

References oomph::ElementGeometry::T.

◆ RankThreeTensor() [4/5]

template<class T>
oomph::RankThreeTensor< T >::RankThreeTensor ( const unsigned long &  n_index1,
const unsigned long &  n_index2,
const unsigned long &  n_index3 
)
inline

Three parameter constructor, general non-square tensor.

Definition at line 1464 of file matrices.h.

References oomph::ElementGeometry::T.

◆ RankThreeTensor() [5/5]

template<class T>
oomph::RankThreeTensor< T >::RankThreeTensor ( const unsigned long &  n_index1,
const unsigned long &  n_index2,
const unsigned long &  n_index3,
const T &  initial_val 
)
inline

Three parameter constructor, general non-square tensor.

Definition at line 1479 of file matrices.h.

References oomph::ElementGeometry::T.

◆ ~RankThreeTensor()

template<class T>
virtual oomph::RankThreeTensor< T >::~RankThreeTensor ( )
inlinevirtual

Destructor: delete the pointers.

Definition at line 1491 of file matrices.h.

Member Function Documentation

◆ initialise()

template<class T>
void oomph::RankThreeTensor< T >::initialise ( const T &  val)
inline

Initialise all values in the tensor to val.

Definition at line 1581 of file matrices.h.

References i.

Referenced by oomph::ScalarAdvectionEquations< DIM >::dflux_du().

◆ nindex1()

template<class T>
unsigned long oomph::RankThreeTensor< T >::nindex1 ( ) const
inline

Return the range of index 1 of the tensor.

Definition at line 1585 of file matrices.h.

References oomph::QuadTreeNames::N.

Referenced by oomph::RankThreeTensor< T >::operator=(), and oomph::RankThreeTensor< T >::RankThreeTensor().

◆ nindex2()

template<class T>
unsigned long oomph::RankThreeTensor< T >::nindex2 ( ) const
inline

Return the range of index 2 of the tensor.

Definition at line 1588 of file matrices.h.

Referenced by oomph::RankThreeTensor< T >::operator=(), and oomph::RankThreeTensor< T >::RankThreeTensor().

◆ nindex3()

template<class T>
unsigned long oomph::RankThreeTensor< T >::nindex3 ( ) const
inline

Return the range of index 3 of the tensor.

Definition at line 1591 of file matrices.h.

Referenced by oomph::RankThreeTensor< T >::operator=(), and oomph::RankThreeTensor< T >::RankThreeTensor().

◆ operator()() [1/2]

template<class T>
T& oomph::RankThreeTensor< T >::operator() ( const unsigned long &  i,
const unsigned long &  j,
const unsigned long &  k 
)
inline

Overload the round brackets to give access as a(i,j,k)

Definition at line 1594 of file matrices.h.

References oomph::Matrix< T, MATRIX_TYPE >::range_check().

◆ operator()() [2/2]

template<class T>
T oomph::RankThreeTensor< T >::operator() ( const unsigned long &  i,
const unsigned long &  j,
const unsigned long &  k 
) const
inline

Overload a const version for read-only access as a(i,j,k)

Definition at line 1604 of file matrices.h.

References oomph::Matrix< T, MATRIX_TYPE >::range_check().

◆ operator=()

template<class T>
RankThreeTensor& oomph::RankThreeTensor< T >::operator= ( const RankThreeTensor< T > &  source_tensor)
inline

◆ range_check()

template<class T>
void oomph::RankThreeTensor< T >::range_check ( const unsigned long &  i,
const unsigned long &  j,
const unsigned long &  k 
) const
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 1356 of file matrices.h.

◆ resize() [1/3]

template<class T>
void oomph::RankThreeTensor< T >::resize ( const unsigned long &  n)
inline

Resize to a square nxnxn tensor.

Definition at line 1494 of file matrices.h.

References oomph::RankThreeTensor< T >::resize().

Referenced by oomph::RankThreeTensor< T >::resize().

◆ resize() [2/3]

template<class T>
void oomph::RankThreeTensor< T >::resize ( const unsigned long &  n_index1,
const unsigned long &  n_index2,
const unsigned long &  n_index3 
)
inline

Resize to a general tensor.

Definition at line 1497 of file matrices.h.

References i, oomph::QuadTreeNames::N, and oomph::ElementGeometry::T.

◆ resize() [3/3]

template<class T>
void oomph::RankThreeTensor< T >::resize ( const unsigned long &  n_index1,
const unsigned long &  n_index2,
const unsigned long &  n_index3,
const T &  initial_value 
)
inline

Resize to a general tensor.

Definition at line 1539 of file matrices.h.

References i, oomph::QuadTreeNames::N, and oomph::ElementGeometry::T.

Member Data Documentation

◆ M

template<class T>
unsigned oomph::RankThreeTensor< T >::M
private

2nd Tensor dimension

Definition at line 1349 of file matrices.h.

◆ N

template<class T>
unsigned oomph::RankThreeTensor< T >::N
private

1st Tensor dimension

Definition at line 1346 of file matrices.h.

◆ P

template<class T>
unsigned oomph::RankThreeTensor< T >::P
private

3rd Tensor dimension

Definition at line 1352 of file matrices.h.

◆ Tensordata

template<class T>
T* oomph::RankThreeTensor< T >::Tensordata
private

Private internal representation as pointer to data.

Definition at line 1343 of file matrices.h.


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