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

////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// More...

#include <matrices.h>

Public Member Functions

 RankFourTensor ()
 Empty constructor. More...
 
 RankFourTensor (const RankFourTensor &source_tensor)
 Copy constructor: Deep copy. More...
 
RankFourTensoroperator= (const RankFourTensor &source_tensor)
 Copy assignement. More...
 
 RankFourTensor (const unsigned long &n)
 One parameter constructor produces a nxnxnxn tensor. More...
 
 RankFourTensor (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const unsigned long &n_index4)
 Four parameter constructor, general non-square tensor. More...
 
 RankFourTensor (const unsigned long &n_index1, const unsigned long &n_index2, const unsigned long &n_index3, const unsigned long &n_index4, const T &initial_val)
 Four parameter constructor, general non-square tensor. More...
 
virtual ~RankFourTensor ()
 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)
 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 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...
 
T & operator() (const unsigned long &i, const unsigned long &j, const unsigned long &k, const unsigned long &l)
 Overload the round brackets to give access as a(i,j,k,l) More...
 
operator() (const unsigned long &i, const unsigned long &j, const unsigned long &k, const unsigned long &l) const
 Overload a const version for read-only access as a(i,j,k,l) 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
 Caculate the offset in flat-packed C-style, column-major format, required for a given i,j. 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
 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...
 

Detailed Description

template<class T>
class oomph::RankFourTensor< T >

////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////

A Rank 4 Tensor class

Definition at line 1700 of file matrices.h.

Constructor & Destructor Documentation

◆ RankFourTensor() [1/5]

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

Empty constructor.

Definition at line 1769 of file matrices.h.

◆ RankFourTensor() [2/5]

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

◆ RankFourTensor() [3/5]

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

◆ RankFourTensor() [4/5]

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

◆ RankFourTensor() [5/5]

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

◆ ~RankFourTensor()

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

Destructor: delete the pointers.

Definition at line 1892 of file matrices.h.

References oomph::RankFourTensor< T >::Tensordata.

Member Function Documentation

◆ initialise()

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

◆ nindex1()

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

◆ nindex2()

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

◆ nindex3()

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

◆ nindex4()

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

◆ offset()

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

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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

◆ operator=()

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

◆ range_check()

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

References i, oomph::RankFourTensor< T >::M, oomph::RankFourTensor< T >::N, oomph::RankFourTensor< T >::P, and oomph::RankFourTensor< T >::Q.

Referenced by oomph::RankFourTensor< T >::operator()().

◆ raw_direct_access() [1/2]

template<class T >
T & oomph::RankFourTensor< 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 2078 of file matrices.h.

References i, and oomph::RankFourTensor< T >::Tensordata.

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::RankFourTensor< 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 2087 of file matrices.h.

References i, and oomph::RankFourTensor< T >::Tensordata.

◆ resize() [1/3]

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

Resize to a square nxnxnxn tensor.

Definition at line 1899 of file matrices.h.

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

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

◆ resize() [2/3]

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

◆ resize() [3/3]

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

Member Data Documentation

◆ M

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

◆ N

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

◆ P

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

◆ Q

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

◆ Tensordata

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

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