|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
Class that represents a rank 2 tensor. More...
#include <RealTensor2.H>
Public Member Functions | |
| RealTensor2 () | |
| Construct a RealTensor2 of all zeros. | |
| RealTensor2 (const Real &xx, const Real &xy, const Real &xz, const Real &yx, const Real &yy, const Real &yz, const Real &zx, const Real &zy, const Real &zz) | |
| Construct a RealTensor2 from nine scalars. | |
| RealTensor2 (const RealVec &a, const RealVec &b) | |
| Construct a RealTensor2 as the outer product of two RealVecs. | |
| Real & | operator() (int i, int j) |
| Return an element of the tensor. | |
| const Real & | operator() (int i, int j) const |
| Return a const ref to an element of the tensor. | |
| Real & | operator[] (int i) |
| Return an element of the tensor. | |
| const Real & | operator[] (int i) const |
| Return a const ref to an element of the tensor. | |
| RealTensor2 | operator- () const |
| Return the negative of a RealTensor2. | |
| RealTensor2 & | operator+= (const Real a) |
| Add a scalar to the RealTensor2 elementwise. | |
| RealTensor2 & | operator-= (const Real a) |
| Subtract a scalar from the RealTensor2 elementwise. | |
| RealTensor2 & | operator*= (const Real a) |
| Multiply a scalar by the RealTensor2 elementwise. | |
| RealTensor2 & | operator/= (const Real a) |
| Divide the RealTensor2 by a scalar elementwise. | |
| RealTensor2 & | operator+= (const RealTensor2 &a) |
| Add another RealTensor2 to the RealTensor2 elementwise. | |
| RealTensor2 & | operator-= (const RealTensor2 &a) |
| Subtract another RealTensor2 from the RealTensor2 elementwise. | |
| RealTensor2 & | operator*= (const RealTensor2 &a) |
| Multiply another RealTensor2 by the RealTensor2 elementwise. | |
| RealTensor2 & | operator/= (const RealTensor2 &a) |
| Divide this RealTensor2 by another RealTensor2 elementwise. | |
| RealTensor2 & | operator= (const Real a) |
| Assign a scalar value to every element of a RealTensor2. | |
| RealTensor2 | operator+ (const Real a) const |
| Add a scalar and a RealTensor2 elementwise. | |
| RealTensor2 | operator- (const Real a) const |
| Subtract a scalar from a RealTensor2 elementwise. | |
| RealTensor2 | operator* (const Real a) const |
| Multiply a scalar by a RealTensor2 elementwise. | |
| RealTensor2 | operator/ (const Real a) const |
| Divide a RealTensor2 by a scalar elementwise. | |
| RealVec | operator* (const RealVec &v) const |
| Matrix-vector multiplication. | |
| RealTensor2 | operator+ (const RealTensor2 &a) const |
| Add two RealTensor2s elementwise. | |
| RealTensor2 | operator- (const RealTensor2 &a) const |
| Subtract two RealTensor2s elementwise. | |
| RealTensor2 | operator* (const RealTensor2 &a) const |
| Multiply two RealTensor2s elementwise. | |
| RealTensor2 | operator/ (const RealTensor2 &a) const |
| Divide two RealTensor2s elementwise. | |
| RealVec | contract1 (const RealVec &v) const |
| Compute the tensor contraction v_i T_ij. | |
| RealVec | contract2 (const RealVec &v) const |
| Compute the tensor contraction v_j T_ij. | |
| Real | contract (const RealVec &a, const RealVec &b) const |
| Compute the tensor contraction a_i b_j T_ij. | |
| Real | contract (const RealTensor2 &a) const |
| Compute the contraction of this tensor with another tensor. | |
| Real | divTangent (const RealVec &v) const |
| Compute the divergence of the tangent vector. | |
| Real | trace () const |
| Return the trace of this tensor. | |
| RealTensor2 | T () const |
| Return the transpose of this tensor. | |
| void | transpose () |
| Transpose this tensor in place. | |
| Real | mag () |
| Total magnitude. | |
| Real | det () const |
| Compute the determinant. | |
| RealVec | eVal () const |
| Compute the eigenvalues of a symmetric tensor. | |
| RealTensor2 | eVec () const |
| Compute the eigenvectors of a symmetric tensor. | |
| void | eigenDecompose (RealVec &eVal, RealTensor2 &eVec) const |
| Compute the eigendecomposition of a symmetric tensor. | |
| RealTensor2 | inv () const |
| Compute the inverse of a symmetric tensor. | |
| RealTensor2 | sqrt () const |
| Compute the square root of a symmetric tensor. | |
| RealTensor2 | invSqrt () const |
| Compute the inverse of the square root of a symmetric tensor. | |
Public Attributes | |
| Real | t [9] |
Class that represents a rank 2 tensor.
This class represents a rank 2 tensor in 3 dimensional space, and provides algebraic operations on this tensor. The tensor is indexed so that element ij is stored at memory position 3*i + j.
|
inline |
Construct a RealTensor2 of all zeros.
|
inline |
Construct a RealTensor2 from nine scalars.
| xx | xx element of tensor |
| xy | xy element of tensor |
| xz | xz element of tensor |
| yx | yx element of tensor |
| yy | yy element of tensor |
| yz | yz element of tensor |
| zx | zx element of tensor |
| zy | zy element of tensor |
| zz | zz element of tensor |
Construct a RealTensor2 as the outer product of two RealVecs.
| a | The first vector |
| b | The second vector |
The constructed RealTensor2 will be indexed as T_ij = a_i * b_j
|
inline |
Compute the contraction of this tensor with another tensor.
| a | The tensor with which to contract this tensor |
Compute the tensor contraction a_i b_j T_ij.
| a | First vector with which to contract |
| b | Second vector with which to contract |
Compute the tensor contraction v_i T_ij.
| v | The vector with which to contract this tensor |
Compute the tensor contraction v_j T_ij.
| v | The vector with which to contract this tensor |
|
inline |
Compute the determinant.
Compute the divergence of the tangent vector.
| v | The vector field |
Assuming that this tensor represents the gradient of a vector field at some point, and that v is the corresponding value of the vector field itself, this routine computes the divergence of the tangent vector to the vector field.
|
inline |
Compute the eigendecomposition of a symmetric tensor.
| eVal | The eigenvalues |
| eVec | The eigenvectors |
The eigenvectors are returned in another tensor, which can be interpreted as the rotation matrix required to diagonalize the tensor. This method assumes that the tensor is symmetric; if it is not, the results are undefined.
|
inline |
Compute the eigenvalues of a symmetric tensor.
This method assumes that the tensor is symmetric; if it is not, the results are undefined.
|
inline |
Compute the eigenvectors of a symmetric tensor.
This method assumes that the tensor is symmetric; if it is not, the results are undefined.
|
inline |
Compute the inverse of a symmetric tensor.
This method assumes that the tensor is symmetric; if it is not, the results are undefined.
|
inline |
Compute the inverse of the square root of a symmetric tensor.
This method assumes that the tensor is symmetric; if it is not, the results are undefined.
|
inline |
Total magnitude.
|
inline |
Return an element of the tensor.
| i | First tensor index |
| j | Second tensor index |
|
inline |
Return a const ref to an element of the tensor.
| i | First tensor index |
| j | Second tensor index |
|
inline |
Multiply a scalar by a RealTensor2 elementwise.
| a | The scalar |
|
inline |
Multiply two RealTensor2s elementwise.
| a | The RealTensor2 to multiply |
|
inline |
Matrix-vector multiplication.
| v | The vector by which to multiply |
|
inline |
Multiply a scalar by the RealTensor2 elementwise.
| a | The scalar |
|
inline |
Multiply another RealTensor2 by the RealTensor2 elementwise.
| a | The RealTensor2 to multiply |
|
inline |
Add a scalar and a RealTensor2 elementwise.
| a | The scalar |
|
inline |
Add two RealTensor2s elementwise.
| a | The RealTensor2 to add |
|
inline |
Add a scalar to the RealTensor2 elementwise.
| a | The scalar |
|
inline |
Add another RealTensor2 to the RealTensor2 elementwise.
| a | The RealTensor2 to add |
|
inline |
Return the negative of a RealTensor2.
|
inline |
Subtract a scalar from a RealTensor2 elementwise.
| a | The scalar |
|
inline |
Subtract two RealTensor2s elementwise.
| a | The RealTensor2 to subtract |
|
inline |
Subtract a scalar from the RealTensor2 elementwise.
| a | The scalar |
|
inline |
Subtract another RealTensor2 from the RealTensor2 elementwise.
| a | The RealTensor2 to subtract |
|
inline |
Divide a RealTensor2 by a scalar elementwise.
| a | The scalar |
|
inline |
Divide two RealTensor2s elementwise.
| a | The RealTensor2 to divide by |
|
inline |
Divide the RealTensor2 by a scalar elementwise.
| a | The scalar |
|
inline |
Divide this RealTensor2 by another RealTensor2 elementwise.
| a | The RealTensor2 to divide by |
|
inline |
Assign a scalar value to every element of a RealTensor2.
| a | The scalar |
|
inline |
Return an element of the tensor.
| i | 1D index of the tensor |
|
inline |
Return a const ref to an element of the tensor.
| i | 1D index of the tensor |
|
inline |
Compute the square root of a symmetric tensor.
This method assumes that the tensor is symmetric; if it is not, the results are undefined.
|
inline |
Return the transpose of this tensor.
|
inline |
Return the trace of this tensor.
|
inline |
Transpose this tensor in place.
| Real criptic::RealTensor2::t[9] |
Data in RealTensor2