|
| | Tensor2 () |
| | Default constructor. More...
|
| |
| | Tensor2 (const unsigned int n1, const unsigned int n2) |
| | Constructor for a zeroed tensor. More...
|
| |
| | Tensor2 (const Tensor2< T > &A) |
| | Copy constructor. More...
|
| |
| unsigned int | getn1 () const |
| |
| unsigned int | getn2 () const |
| |
| unsigned int | getNVals () const |
| |
| T | getVal (const unsigned int i, const unsigned int j) const |
| | Get the value of \(T_{ij}\). More...
|
| |
| T | getValFlat (const unsigned int flatIdx) const |
| | Get the value of \(T_{i}\). More...
|
| |
| void | setVal (const unsigned int i, const unsigned int j, T val) |
| |
| T & | operator() (const unsigned int i, const unsigned int j) |
| | Get the a reference to the value of \(T_{ij}\). More...
|
| |
| T & | operator() (const unsigned int flatIdx) |
| |
| void | copyValuesOut (T *outVals) const |
| |
| | Tensor2 (const Tensor4< T > &A) |
| | Construct a square second order tensor from a square fourth order tensor. More...
|
| |
| Tensor2< T > & | operator= (const Tensor2< T > &input) |
| | The standard assignment operator. More...
|
| |
| void | printToStream (std::ostream &out) const |
| | Pretty printing to stream. More...
|
| |
| | Tensor2 (H5::DataSet &dataset, std::vector< hsize_t > gridOffset, std::vector< hsize_t > tensorDims) |
| | Construct from HD5 dataset and offset. More...
|
| |
| void | writeToExistingHDF5Dataset (H5::DataSet &dataset, std::vector< hsize_t > arrayOffset) |
| |
| | Tensor2 (H5::H5File &file, const H5std_string &datasetName, std::vector< hsize_t > tensorDims) |
| | Construct from HD5 file and dataset name. More...
|
| |
| void | writeToNewHDF5 (const H5std_string &filename, const H5std_string &datasetName) |
| |
| void | addAsNewHDF5Dataset (H5::H5File &file, const H5std_string &datasetName) |
| | Adding to an HDF5 file as a new dataset. More...
|
| |
| | Tensor2 (hid_t dset_id, hid_t plist_id, std::vector< hsize_t > gridOffset, std::vector< hsize_t > tensorDims) |
| | Construct from HD5 dataset and offset. More...
|
| |
| void | writeToExistingHDF5Dataset (hid_t dset_id, hid_t plist_id, std::vector< hsize_t > arrayOffset) |
| |
| void | invInPlace () |
| | The inverse of the tensor. More...
|
| |
| Tensor2< T > | inv () const |
| | The inverse of the tensor. More...
|
| |
| Tensor2< T > | exp () const |
| | The matrix exponential of the tensor. More...
|
| |
| void | assertSquare () const |
| |
| bool | isRotationMatrix () const |
| |
| T | tr () const |
| | The trace of the tensor. More...
|
| |
| T | det () const |
| | The determinant of the tensor. More...
|
| |
| T | min () const |
| | The minimum element in the tensor. More...
|
| |
| T | max () const |
| | The maximum element in the tensor. More...
|
| |
| T | absmax () const |
| | The maximum element in the tensor. More...
|
| |
| T | spectralNorm () const |
| |
| T | frobeniusNorm () const |
| |
| T | prod () const |
| | Product of all elements. More...
|
| |
| Tensor2< T > | abs () const |
| | The element-wise absolute value of the tensor. More...
|
| |
| Tensor2< T > | trans () const |
| | The transpose of the tensor. More...
|
| |
| Tensor2< T > | constrainedTo (const T minVal, const T maxVal) const |
| | Creates a new tensor with the values of the elements constrained between two values. More...
|
| |
| void | constrainInPlace (const T minVal, const T maxVal) |
| | Replaces the elements with their values constrained between two limits. More...
|
| |
| Tensor2< T > | scaledToUnitDeterminant () const |
| | Create a tensor with the values uniformly scaled so that the new tensor has unit determinant. More...
|
| |
| Tensor2< T > | deviatoricComponent () const |
| | The deviatoric component of the tensor. More...
|
| |
| void | evecDecomposition (std::valarray< T > &evals, Tensor2< T > &evecs) |
| |
| Tensor2< T > | sqrtMatrix () |
| | Matrix square root of the tensor. More...
|
| |
| PolarDecomposition< T > | polarDecomposition () const |
| | Polar decomposition of the tensor. More...
|
| |
|
| void | initialize (const unsigned int n1, const unsigned int n2) |
| | Initialize the dimensions and allocation for the tensor. More...
|
| |
| void | copyValues (const Tensor2< T > &input) |
| | Copy the values from one tensor to another. More...
|
| |
| void | constructFromHDF5Dataset (H5::DataSet &dataset, std::vector< hsize_t > gridOffset, std::vector< hsize_t > tensorDims) |
| |
| void | constructFromHDF5Dataset (hid_t dset_id, hid_t plist_id, std::vector< hsize_t > gridOffset, std::vector< hsize_t > tensorDims) |
| |
| | Tensor2 (const unsigned int n1, const unsigned int n2, const T *inArray) |
| | Constructor for a populated tensor. More...
|
| |
| | Tensor2 (const unsigned int n1, const unsigned int n2, const std::valarray< T > &inVec) |
| | Constructor for a populated tensor. More...
|
| |
| unsigned int | flat (const unsigned int i, const unsigned int j) const |
| | Flatten the two indices of the tensor. More...
|
| |
| idx2d | unflat (const unsigned int idx) const |
| | Unflatten the two indices of the tensor. More...
|
| |
|
| template<typename U , unsigned int M, unsigned int N> |
| class | Tensor2CUDA |
| |
| template<typename U > |
| bool | areSameShape (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | assertSameShape (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | assertCompatibleForMultiplication (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | assertCompatibleForContraction (const Tensor4< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | assertCompatibleForContraction (const Tensor4< U > &A, const Tensor2< U > &B, const Tensor2< U > &C) |
| |
| template<typename U > |
| bool | areEqual (const Tensor2< U > &A, const Tensor2< U > &B, U tol) |
| |
| template<typename U > |
| bool | operator== (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| bool | operator!= (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| Tensor2< U > | operator* (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | ABPlusBTransposeAInPlace (const hpp::Tensor2< U > &A, const hpp::Tensor2< U > &B, hpp::Tensor2< U > &C) |
| |
| template<typename U > |
| Tensor2< U > | contract (const Tensor4< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| U | contract (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | contractInPlace (const Tensor4< U > &A, const Tensor2< U > &B, Tensor2< U > &C) |
| |
| template<typename U > |
| void | assertCompatibleForOuterProduct (const Tensor2< U > &A, const Tensor2< U > &B, const Tensor4< U > &C) |
| |
| template<typename U > |
| Tensor4< U > | outer (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | outerInPlace (const Tensor2< U > &A, const Tensor2< U > &B, Tensor4< U > &C) |
| |
| template<typename U > |
| Tensor2< U > | operator+ (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| Tensor2< U > | operator+ (const Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| Tensor2< U > | operator+ (const U &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | operator+= (Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| void | operator+= (Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| Tensor2< U > | MPISum (Tensor2< U > &local, MPI_Comm comm) |
| |
| template<typename U > |
| Tensor2< U > | operator- (const Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| Tensor2< U > | operator- (const Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| Tensor2< U > | operator- (const U &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | operator-= (Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| void | operator-= (Tensor2< U > &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| Tensor2< U > | operator* (const Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| Tensor2< U > | operator* (const U &A, const Tensor2< U > &B) |
| |
| template<typename U > |
| void | operator*= (Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| Tensor2< U > | operator/ (const Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| void | operator/= (Tensor2< U > &A, const U &B) |
| |
| template<typename U > |
| void | identityTensor2InPlace (unsigned int n, Tensor2< U > &A) |
| |
template<typename T>
class hpp::Tensor2< T >
A class for second order tensors.
- Template Parameters
-
Construct a square second order tensor from a square fourth order tensor.
This is primarily used for intermediate steps in constructing fourth order inverses with respect to the contraction between a 4th order tensor and a 2nd order tensor.
The 4th order tensor \(\mathbf{A}\), of dimension \(n \times n \times n \times n\) is flattened into the 2nd order tensor \(\mathbf{B}\), of dimension \( n^2 \times n^2 \) according to:
\[ \mathbf{A}_{ijkl} = \mathbf{B}_{in+j,kn+l}. \]
That is, it is a row-major flattening.
- Parameters
-
| A | the 4th order tensor \(\mathbf{A}\) |
- Template Parameters
-
- Returns
- the 2nd order tensor \(\mathbf{B}\)