GMatTensor 0.10.6
|
Tensors and tensor operations for a(n) array of 3d tensors of different rank, defined in a Cartesian coordinate system. More...
Namespaces | |
namespace | pointer |
API for individual tensors with pointer-only input. | |
Classes | |
class | Array |
Array of tensors: More... | |
Functions | |
array_type::tensor< double, 2 > | Random2 () |
Random 2nd-order tensor (for example for use in testing). More... | |
array_type::tensor< double, 4 > | Random4 () |
Random 4th-order tensor (for example for use in testing). More... | |
array_type::tensor< double, 2 > | O2 () |
2nd-order null tensor (all components equal to zero). More... | |
array_type::tensor< double, 4 > | O4 () |
4th-order null tensor (all components equal to zero). More... | |
array_type::tensor< double, 2 > | I2 () |
2nd-order identity tensor. More... | |
array_type::tensor< double, 4 > | II () |
Result of the dyadic product of two 2nd-order identity tensors (see I2()). More... | |
array_type::tensor< double, 4 > | I4 () |
Fourth order unit tensor. More... | |
array_type::tensor< double, 4 > | I4rt () |
Right-transposed fourth order unit tensor. More... | |
array_type::tensor< double, 4 > | I4s () |
Fourth order symmetric projection. More... | |
array_type::tensor< double, 4 > | I4d () |
Fourth order deviatoric projection. More... | |
template<class T > | |
auto | Trace (const T &A) |
Trace or 2nd-order tensor. More... | |
template<class T , class R > | |
void | trace (const T &A, R &ret) |
Same as Trace() but writes to externally allocated output. More... | |
template<class T > | |
auto | Hydrostatic (const T &A) |
Hydrostatic part of a tensor. More... | |
template<class T , class R > | |
void | hydrostatic (const T &A, R &ret) |
Same as Hydrostatic() but writes to externally allocated output. More... | |
template<class T > | |
auto | Det (const T &A) |
Determinant. More... | |
template<class T , class R > | |
void | det (const T &A, R &ret) |
Same as Det() but writes to externally allocated output. More... | |
template<class T > | |
auto | A2_ddot_B2 (const T &A, const T &B) |
Double tensor contraction. More... | |
template<class T , class R > | |
void | A2_ddot_B2 (const T &A, const T &B, R &ret) |
Same as A2_ddot_B2(const T& A, const T& B) but writes to externally allocated output. More... | |
template<class T > | |
auto | A2s_ddot_B2s (const T &A, const T &B) |
Same as A2_ddot_B2(const T& A, const T& B, R& ret) but for symmetric tensors. More... | |
template<class T , class R > | |
void | A2s_ddot_B2s (const T &A, const T &B, R &ret) |
Same as A2s_ddot_B2s(const T& A, const T& B) but writes to externally allocated output. More... | |
template<class T > | |
auto | Norm_deviatoric (const T &A) |
Norm of the tensor's deviator: More... | |
template<class T , class R > | |
void | norm_deviatoric (const T &A, R &ret) |
Same as Norm_deviatoric() but writes to externally allocated output. More... | |
template<class T > | |
auto | Deviatoric (const T &A) |
Deviatoric part of a tensor: More... | |
template<class T , class R > | |
void | deviatoric (const T &A, R &ret) |
Same as Deviatoric() but writes to externally allocated output. More... | |
template<class T > | |
auto | Sym (const T &A) |
Symmetric part of a tensor: More... | |
template<class T , class R > | |
void | sym (const T &A, R &ret) |
Same as Sym() but writes to externally allocated output. More... | |
template<class T > | |
auto | Inv (const T &A) |
Inverse. More... | |
template<class T , class R > | |
void | inv (const T &A, R &ret) |
Same as Inv() but writes to externally allocated output. More... | |
template<class T > | |
auto | Logs (const T &A) |
Logarithm. More... | |
template<class T , class R > | |
void | logs (const T &A, R &ret) |
Same as Logs() but writes to externally allocated output. More... | |
template<class T > | |
auto | A2_dot_A2T (const T &A) |
Dot-product (single tensor contraction) More... | |
template<class T , class R > | |
void | A2_dot_A2T (const T &A, R &ret) |
Same as A2_dot_A2T(const T& A) but writes to externally allocated output. More... | |
template<class T > | |
auto | A2_dot_B2 (const T &A, const T &B) |
Dot-product (single tensor contraction) More... | |
template<class T , class R > | |
void | A2_dot_B2 (const T &A, const T &B, R &ret) |
Same as A2_dot_B2(const T& A, const T& B) but writes to externally allocated output. More... | |
template<class T > | |
auto | A2_dyadic_B2 (const T &A, const T &B) |
Dyadic product. More... | |
template<class T , class R > | |
void | A2_dyadic_B2 (const T &A, const T &B, R &ret) |
Same as A2_dyadic_B2(const T& A, const T& B) but writes to externally allocated output. More... | |
template<class T , class U > | |
auto | A4_ddot_B2 (const T &A, const U &B) |
Double tensor contraction. More... | |
template<class T , class U , class R > | |
void | A4_ddot_B2 (const T &A, const U &B, R &ret) |
Same as A4_ddot_B2(const T& A, const U& B) but writes to externally allocated output. More... | |
template<class T , class U > | |
auto | A4_dot_B2 (const T &A, const U &B) |
Tensor contraction. More... | |
template<class T , class U , class R > | |
void | A4_dot_B2 (const T &A, const U &B, R &ret) |
Same as A4_dot_B2(const T& A, const U& B) but writes to externally allocated output. More... | |
template<class T > | |
size_t | underlying_size_A2 (const T &A) |
Size of the underlying array. More... | |
template<class T > | |
size_t | underlying_size_A4 (const T &A) |
Size of the underlying array. More... | |
template<class T > | |
auto | underlying_shape_A2 (const T &A) -> std::array< size_t, detail::impl_A2< T, 3 >::rank > |
Shape of the underlying array. More... | |
template<class T > | |
auto | underlying_shape_A4 (const T &A) -> std::array< size_t, detail::impl_A4< T, 3 >::rank > |
Shape of the underlying array. More... | |
Tensors and tensor operations for a(n) array of 3d tensors of different rank, defined in a Cartesian coordinate system.
|
inline |
Double tensor contraction.
\( c = A : B \)
or in index notation
\( c = A_{ij} A_{ji} \)
To write to allocated data use A2_ddot_B2(const T& A, const T& B, R& ret).
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
Definition at line 1024 of file Cartesian3d.h.
|
inline |
Same as A2_ddot_B2(const T& A, const T& B) but writes to externally allocated output.
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
ret | output [...] array. |
Definition at line 1038 of file Cartesian3d.h.
|
inline |
Dot-product (single tensor contraction)
\( C = A \cdot A^T \)
or in index notation
\( C_{ik} = A_{ij} A_{kj} \)
To write to allocated data use A2_dot_A2T(const T& A, R& ret).
A | [..., 3, 3] array. |
Definition at line 1239 of file Cartesian3d.h.
|
inline |
Same as A2_dot_A2T(const T& A) but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [..., 3, 3] array. |
Definition at line 1252 of file Cartesian3d.h.
|
inline |
Dot-product (single tensor contraction)
\( C = A \cdot B \)
or in index notation
\( C_{ik} = A_{ij} B_{jk} \)
To write to allocated data use A2_dot_B2(const T& A, const T& B, R& ret).
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
Definition at line 1274 of file Cartesian3d.h.
|
inline |
Same as A2_dot_B2(const T& A, const T& B) but writes to externally allocated output.
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
ret | output [..., 3, 3] array. |
Definition at line 1289 of file Cartesian3d.h.
|
inline |
Dyadic product.
\( C = A \otimes B \)
or in index notation
\( C_{ijkl} = A_{ij} B_{kl} \)
To write to allocated data use A2_dyadic_B2(const T& A, const T& B, R& ret).
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
Definition at line 1312 of file Cartesian3d.h.
|
inline |
Same as A2_dyadic_B2(const T& A, const T& B) but writes to externally allocated output.
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
ret | output [..., 3, 3, 3, 3] array. |
Definition at line 1327 of file Cartesian3d.h.
|
inline |
Same as A2_ddot_B2(const T& A, const T& B, R& ret) but for symmetric tensors.
This function is slightly faster. There is no assertion to check the symmetry. To write to allocated data use A2s_ddot_B2s(const T& A, const T& B, R& ret).
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
Definition at line 1055 of file Cartesian3d.h.
|
inline |
Same as A2s_ddot_B2s(const T& A, const T& B) but writes to externally allocated output.
A | [..., 3, 3] array. |
B | [..., 3, 3] array. |
ret | output [...] array. |
Definition at line 1069 of file Cartesian3d.h.
|
inline |
Double tensor contraction.
\( C = A : B \)
or in index notation
\( C_{ij} = A_{ijkl} A_{lk} \)
To write to allocated data use A4_ddot_B2(const T& A, const U& B, R& ret).
A | [..., 3, 3, 3, 3] array. |
B | [..., 3, 3] array. |
Definition at line 1350 of file Cartesian3d.h.
|
inline |
Same as A4_ddot_B2(const T& A, const U& B) but writes to externally allocated output.
A | [..., 3, 3, 3, 3] array. |
B | [..., 3, 3] array. |
ret | output [..., 3, 3] array. |
Definition at line 1365 of file Cartesian3d.h.
|
inline |
Tensor contraction.
\( C = A \cdot B \)
or in index notation
\( C_{ijkm} = A_{ijkl} A_{lm} \)
To write to allocated data use A4_dot_B2(const T& A, const U& B, R& ret).
A | [..., 3, 3, 3, 3] array. |
B | [..., 3, 3] array. |
Definition at line 1388 of file Cartesian3d.h.
|
inline |
Same as A4_dot_B2(const T& A, const U& B) but writes to externally allocated output.
A | [..., 3, 3, 3, 3] array. |
B | [..., 3, 3] array. |
ret | output [..., 3, 3, 3, 3] array. |
Definition at line 1403 of file Cartesian3d.h.
|
inline |
Determinant.
To write to allocated output use det().
A | [..., 3, 3] array. |
Definition at line 991 of file Cartesian3d.h.
|
inline |
Same as Det() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [...] array. |
Definition at line 1003 of file Cartesian3d.h.
|
inline |
Deviatoric part of a tensor:
A - Hydrostatic(A) * I2
See Hydrostatic(). To write to allocated data use deviatoric().
A | [..., 3, 3] array. |
Definition at line 1116 of file Cartesian3d.h.
|
inline |
Same as Deviatoric() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [..., 3, 3] array. |
Definition at line 1129 of file Cartesian3d.h.
|
inline |
Hydrostatic part of a tensor.
== trace(A) / 3 == trace(A) / d
where d = 3
. To write to allocated output use hydrostatic().
A | [..., 3, 3] array. |
Definition at line 966 of file Cartesian3d.h.
|
inline |
Same as Hydrostatic() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [...] array. |
Definition at line 978 of file Cartesian3d.h.
|
inline |
2nd-order identity tensor.
By definition
\( I_{ij} = \delta_{ij} \)
such that
\( I \cdot A = A \)
or in index notation
\( I_{ij} A_{jk} = A_{ik} \)
See A2_dot_B2().
Definition at line 798 of file Cartesian3d.h.
|
inline |
Fourth order unit tensor.
By definition
\( I_{ijkl} = \delta_{il} \delta_{jk} \)
such that
\( I : A = A \)
or in index notation
\( I_{ijkl} A_{lk} = A_{ij} \)
See A4_ddot_B2().
Definition at line 848 of file Cartesian3d.h.
|
inline |
Fourth order deviatoric projection.
By definition
I = I4s() - 1.0 / 3.0 * II()
such that
\( I : A = sym(A) - tr(A) / 3 \)
See A4_ddot_B2(), Deviatoric().
Definition at line 919 of file Cartesian3d.h.
|
inline |
Right-transposed fourth order unit tensor.
By definition
\( I_{ijkl} = \delta_{ik} \delta_{jl} \)
such that
\( I : A = A^T \)
or in index notation
\( I_{ijkl} A_{lk} = A_{ji} \)
See A4_ddot_B2().
Definition at line 873 of file Cartesian3d.h.
|
inline |
Fourth order symmetric projection.
By definition
I = 0.5 * (I4() + I4rt())
such that
\( I : A = sym(A) \)
or in index notation
\( I_{ijkl} A_{lk} = (A_{ij} + A_{ji}) / 2 \)
See A4_ddot_B2(), Sym().
Definition at line 898 of file Cartesian3d.h.
|
inline |
Result of the dyadic product of two 2nd-order identity tensors (see I2()).
By definition
\( (II)_{ijkl} = \delta_{ij} \delta_{kl} \)
such that
\( II : A = tr(A) I \)
or in index notation
\( (II)_{ijkl} A_{lk} = tr(A) I_{ij} \)
See A4_ddot_B2(), Trace(), I2().
Definition at line 823 of file Cartesian3d.h.
|
inline |
Inverse.
To write to allocated output use inv().
A | [..., 3, 3] array. |
Definition at line 1177 of file Cartesian3d.h.
|
inline |
Same as Inv() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [..., 3, 3] array. |
Definition at line 1190 of file Cartesian3d.h.
|
inline |
Logarithm.
Symmetric tensors only, no assertion. To write to allocated output use logs().
A | [..., 3, 3] array. |
Definition at line 1205 of file Cartesian3d.h.
|
inline |
Same as Logs() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [..., 3, 3] array, may be the same reference as A . |
Definition at line 1218 of file Cartesian3d.h.
|
inline |
Norm of the tensor's deviator:
\( \sqrt{(dev(A))_{ij} (dev(A))_{ji}} \)
To write to allocated data use norm_deviatoric().
A | [..., 3, 3] array. |
Definition at line 1086 of file Cartesian3d.h.
|
inline |
Same as Norm_deviatoric() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [...] array |
Definition at line 1099 of file Cartesian3d.h.
|
inline |
2nd-order null tensor (all components equal to zero).
Definition at line 765 of file Cartesian3d.h.
|
inline |
4th-order null tensor (all components equal to zero).
Definition at line 775 of file Cartesian3d.h.
|
inline |
Random 2nd-order tensor (for example for use in testing).
Definition at line 743 of file Cartesian3d.h.
|
inline |
Random 4th-order tensor (for example for use in testing).
Definition at line 754 of file Cartesian3d.h.
|
inline |
Symmetric part of a tensor:
\( (A + A^T) / 2 \)
of in index notation
\( (A_{ij} + A_{ji}) / 2 \)
To write to allocated data use sym().
A | [..., 3, 3] array. |
Definition at line 1150 of file Cartesian3d.h.
|
inline |
Same as Sym() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [..., 3, 3] array, may be the same reference as A . |
Definition at line 1163 of file Cartesian3d.h.
|
inline |
Trace or 2nd-order tensor.
\( tr(A) = A_{ii} \)
To write to allocated data use trace().
A | [..., 3, 3] array. |
Definition at line 937 of file Cartesian3d.h.
|
inline |
Same as Trace() but writes to externally allocated output.
A | [..., 3, 3] array. |
ret | output [...] array. |
Definition at line 949 of file Cartesian3d.h.
|
inline |
Shape of the underlying array.
A | [..., 2, 2] array. |
[...]
. Definition at line 1441 of file Cartesian3d.h.
|
inline |
Shape of the underlying array.
A | [..., 2, 2] array. |
[...]
. Definition at line 1453 of file Cartesian3d.h.
|
inline |
Size of the underlying array.
A | [..., 2, 2] array. |
prod([...])
. Definition at line 1417 of file Cartesian3d.h.
|
inline |
Size of the underlying array.
A | [..., 2, 2] array. |
prod([...])
. Definition at line 1429 of file Cartesian3d.h.