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

A Rank 5 Tensor class. More...

#include <matrices.h>

Public Member Functions

 RankFiveTensor ()
 Empty constructor. More...
 
 RankFiveTensor (const RankFiveTensor &source_tensor)
 Copy constructor: Deep copy. More...
 
RankFiveTensoroperator= (const RankFiveTensor &source_tensor)
 Copy assignement. More...
 
 RankFiveTensor (const unsigned long &n)
 One parameter constructor produces a nxnxnxnxn tensor. More...
 
 RankFiveTensor (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const unsigned long &n_index4, const unsigned long &n_index5)
 Four parameter constructor, general non-square tensor. More...
 
 RankFiveTensor (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const unsigned long &n_index4, const unsigned long &n_index5, const T &initial_val)
 Four parameter constructor, general non-square tensor. More...
 
virtual ~RankFiveTensor ()
 Destructor: delete the pointers. More...
 
void resize (const unsigned long &n)
 Resize to a square nxnxnxn tensor. More...
 
void resize (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const unsigned long &n_index4, const unsigned long &n_index5)
 Resize to a general tensor. More...
 
void resize (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const unsigned long &n_index4, const unsigned long &n_index5, 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...
 
unsigned long nindex4 () const
 Return the range of index 4 of the tensor. More...
 
unsigned long nindex5 () const
 Return the range of index 5 of the tensor. More...
 
T & operator() (const unsigned long &i, const unsigned long &j, const unsigned long &k, const unsigned long &l, const unsigned long &m)
 Overload the round brackets to give access as a(i,j,k,l,m) More...
 
operator() (const unsigned long &i, const unsigned long &j, const unsigned long &k, const unsigned long &l, const unsigned long &m) const
 Overload a const version for read-only access as a(i,j,k,l,m) More...
 
T & raw_direct_access (const unsigned long &i)
 Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems. More...
 
const T & raw_direct_access (const unsigned long &i) const
 Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems. More...
 
unsigned offset (const unsigned long &i, const unsigned long &j, const unsigned long &k) const
 Caculate the offset in flat-packed Cy-style, column-major format, required for a given i,j,k. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems. More...
 

Private Member Functions

void range_check (const unsigned long &i, const unsigned long &j, const unsigned long &k, const unsigned long &l, const unsigned long &m) 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...
 
unsigned Q
 4th Tensor dimension More...
 
unsigned R
 5th Tensor dimension More...
 

Detailed Description

template<class T>
class oomph::RankFiveTensor< T >

A Rank 5 Tensor class.

Definition at line 1976 of file matrices.h.

Constructor & Destructor Documentation

◆ RankFiveTensor() [1/5]

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

Empty constructor.

Definition at line 2062 of file matrices.h.

◆ RankFiveTensor() [2/5]

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

◆ RankFiveTensor() [3/5]

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

One parameter constructor produces a nxnxnxnxn tensor.

Definition at line 2135 of file matrices.h.

References oomph::BinaryTreeNames::R, and oomph::ElementGeometry::T.

◆ RankFiveTensor() [4/5]

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

Four parameter constructor, general non-square tensor.

Definition at line 2148 of file matrices.h.

References oomph::BinaryTreeNames::R, and oomph::ElementGeometry::T.

◆ RankFiveTensor() [5/5]

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

Four parameter constructor, general non-square tensor.

Definition at line 2164 of file matrices.h.

References oomph::BinaryTreeNames::R, and oomph::ElementGeometry::T.

◆ ~RankFiveTensor()

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

Destructor: delete the pointers.

Definition at line 2177 of file matrices.h.

Member Function Documentation

◆ initialise()

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

Initialise all values in the tensor to val.

Definition at line 2293 of file matrices.h.

References i, and oomph::BinaryTreeNames::R.

◆ nindex1()

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

Return the range of index 1 of the tensor.

Definition at line 2297 of file matrices.h.

References oomph::QuadTreeNames::N.

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

◆ nindex2()

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

Return the range of index 2 of the tensor.

Definition at line 2300 of file matrices.h.

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

◆ nindex3()

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

Return the range of index 3 of the tensor.

Definition at line 2303 of file matrices.h.

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

◆ nindex4()

template<class T>
unsigned long oomph::RankFiveTensor< T >::nindex4 ( ) const
inline

Return the range of index 4 of the tensor.

Definition at line 2306 of file matrices.h.

References oomph::ElementGeometry::Q.

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

◆ nindex5()

template<class T>
unsigned long oomph::RankFiveTensor< T >::nindex5 ( ) const
inline

Return the range of index 5 of the tensor.

Definition at line 2309 of file matrices.h.

References oomph::BinaryTreeNames::R.

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

◆ offset()

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

Caculate the offset in flat-packed Cy-style, column-major format, required for a given i,j,k. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.

Definition at line 2354 of file matrices.h.

Referenced by oomph::RefineablePVDEquations< DIM >::fill_in_generic_contribution_to_residuals_pvd(), oomph::PVDEquations< DIM >::fill_in_generic_contribution_to_residuals_pvd(), oomph::RefineablePVDEquationsWithPressure< DIM >::fill_in_generic_residual_contribution_pvd_with_pressure(), and oomph::PVDEquationsWithPressure< DIM >::fill_in_generic_residual_contribution_pvd_with_pressure().

◆ operator()() [1/2]

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

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

Definition at line 2312 of file matrices.h.

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

◆ operator()() [2/2]

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

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

Definition at line 2323 of file matrices.h.

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

◆ operator=()

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

◆ range_check()

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

◆ raw_direct_access() [1/2]

template<class T>
T& oomph::RankFiveTensor< T >::raw_direct_access ( const unsigned long &  i)
inline

Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.

Definition at line 2339 of file matrices.h.

References i.

Referenced by oomph::RefineablePVDEquations< DIM >::fill_in_generic_contribution_to_residuals_pvd(), oomph::PVDEquations< DIM >::fill_in_generic_contribution_to_residuals_pvd(), oomph::RefineablePVDEquationsWithPressure< DIM >::fill_in_generic_residual_contribution_pvd_with_pressure(), and oomph::PVDEquationsWithPressure< DIM >::fill_in_generic_residual_contribution_pvd_with_pressure().

◆ raw_direct_access() [2/2]

template<class T>
const T& oomph::RankFiveTensor< T >::raw_direct_access ( const unsigned long &  i) const
inline

Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.

Definition at line 2347 of file matrices.h.

References i.

◆ resize() [1/3]

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

Resize to a square nxnxnxn tensor.

Definition at line 2180 of file matrices.h.

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

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

◆ resize() [2/3]

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

Resize to a general tensor.

Definition at line 2183 of file matrices.h.

References i, oomph::QuadTreeNames::N, oomph::ElementGeometry::Q, oomph::BinaryTreeNames::R, and oomph::ElementGeometry::T.

◆ resize() [3/3]

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

Resize to a general tensor.

Definition at line 2238 of file matrices.h.

References i, oomph::QuadTreeNames::N, oomph::ElementGeometry::Q, oomph::BinaryTreeNames::R, and oomph::ElementGeometry::T.

Member Data Documentation

◆ M

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

2nd Tensor dimension

Definition at line 1988 of file matrices.h.

◆ N

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

1st Tensor dimension

Definition at line 1985 of file matrices.h.

◆ P

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

3rd Tensor dimension

Definition at line 1991 of file matrices.h.

◆ Q

template<class T>
unsigned oomph::RankFiveTensor< T >::Q
private

4th Tensor dimension

Definition at line 1994 of file matrices.h.

◆ R

template<class T>
unsigned oomph::RankFiveTensor< T >::R
private

5th Tensor dimension

Definition at line 1997 of file matrices.h.

◆ Tensordata

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

Private internal representation as pointer to data.

Definition at line 1982 of file matrices.h.


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