A Rank 4 Tensor class. More...
#include <matrices.h>
Public Member Functions | |
RankFourTensor () | |
Empty constructor. More... | |
RankFourTensor (const RankFourTensor &source_tensor) | |
Copy constructor: Deep copy. More... | |
RankFourTensor & | operator= (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... | |
T | 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... | |
A Rank 4 Tensor class.
Definition at line 1625 of file matrices.h.
|
inline |
Empty constructor.
Definition at line 1696 of file matrices.h.
|
inline |
Copy constructor: Deep copy.
Definition at line 1699 of file matrices.h.
References i, oomph::QuadTreeNames::N, oomph::RankFourTensor< T >::nindex1(), oomph::RankFourTensor< T >::nindex2(), oomph::RankFourTensor< T >::nindex3(), oomph::RankFourTensor< T >::nindex4(), oomph::ElementGeometry::Q, and oomph::ElementGeometry::T.
|
inline |
One parameter constructor produces a nxnxnxn tensor.
Definition at line 1761 of file matrices.h.
References oomph::ElementGeometry::Q, and oomph::ElementGeometry::T.
|
inline |
Four parameter constructor, general non-square tensor.
Definition at line 1774 of file matrices.h.
References oomph::ElementGeometry::Q, and oomph::ElementGeometry::T.
|
inline |
Four parameter constructor, general non-square tensor.
Definition at line 1789 of file matrices.h.
References oomph::ElementGeometry::Q, and oomph::ElementGeometry::T.
|
inlinevirtual |
Destructor: delete the pointers.
Definition at line 1802 of file matrices.h.
|
inline |
Initialise all values in the tensor to val.
Definition at line 1905 of file matrices.h.
References i, and oomph::ElementGeometry::Q.
|
inline |
Return the range of index 1 of the tensor.
Definition at line 1909 of file matrices.h.
References oomph::QuadTreeNames::N.
Referenced by oomph::FiniteElement::d_dshape_eulerian_dnodal_coordinates(), oomph::RankFourTensor< T >::operator=(), and oomph::RankFourTensor< T >::RankFourTensor().
|
inline |
Return the range of index 2 of the tensor.
Definition at line 1912 of file matrices.h.
Referenced by oomph::FiniteElement::d_dshape_eulerian_dnodal_coordinates(), oomph::RankFourTensor< T >::operator=(), and oomph::RankFourTensor< T >::RankFourTensor().
|
inline |
Return the range of index 3 of the tensor.
Definition at line 1915 of file matrices.h.
Referenced by oomph::FiniteElement::d_dshape_eulerian_dnodal_coordinates(), oomph::RankFourTensor< T >::operator=(), and oomph::RankFourTensor< T >::RankFourTensor().
|
inline |
Return the range of index 4 of the tensor.
Definition at line 1918 of file matrices.h.
References oomph::ElementGeometry::Q.
Referenced by oomph::FiniteElement::d_dshape_eulerian_dnodal_coordinates(), oomph::RankFourTensor< T >::operator=(), and oomph::RankFourTensor< T >::RankFourTensor().
|
inline |
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.
Definition at line 1960 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().
|
inline |
Overload the round brackets to give access as a(i,j,k,l)
Definition at line 1921 of file matrices.h.
References oomph::Matrix< T, MATRIX_TYPE >::range_check().
|
inline |
Overload a const version for read-only access as a(i,j,k,l)
Definition at line 1931 of file matrices.h.
References oomph::Matrix< T, MATRIX_TYPE >::range_check().
|
inline |
Copy assignement.
Definition at line 1727 of file matrices.h.
References i, oomph::QuadTreeNames::N, oomph::RankFourTensor< T >::nindex1(), oomph::RankFourTensor< T >::nindex2(), oomph::RankFourTensor< T >::nindex3(), oomph::RankFourTensor< T >::nindex4(), and oomph::ElementGeometry::Q.
|
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 1647 of file matrices.h.
|
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 1946 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().
|
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 1953 of file matrices.h.
References i.
|
inline |
Resize to a square nxnxnxn tensor.
Definition at line 1805 of file matrices.h.
References oomph::RankFourTensor< T >::resize().
Referenced by oomph::RankFourTensor< T >::resize().
|
inline |
Resize to a general tensor.
Definition at line 1808 of file matrices.h.
References i, oomph::QuadTreeNames::N, oomph::ElementGeometry::Q, and oomph::ElementGeometry::T.
|
inline |
Resize to a general tensor.
Definition at line 1856 of file matrices.h.
References i, oomph::QuadTreeNames::N, oomph::ElementGeometry::Q, and oomph::ElementGeometry::T.
|
private |
2nd Tensor dimension
Definition at line 1637 of file matrices.h.
|
private |
1st Tensor dimension
Definition at line 1634 of file matrices.h.
|
private |
3rd Tensor dimension
Definition at line 1640 of file matrices.h.
|
private |
4th Tensor dimension
Definition at line 1643 of file matrices.h.
|
private |
Private internal representation as pointer to data.
Definition at line 1631 of file matrices.h.