GMatTensor 0.10.6
Loading...
Searching...
No Matches
GMatTensor::Cartesian3d Namespace Reference

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...
 

Detailed Description

Tensors and tensor operations for a(n) array of 3d tensors of different rank, defined in a Cartesian coordinate system.

Function Documentation

◆ A2_ddot_B2() [1/2]

template<class T >
auto GMatTensor::Cartesian3d::A2_ddot_B2 ( const T &  A,
const T &  B 
)
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).

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
Returns
[...] array.

Definition at line 1024 of file Cartesian3d.h.

◆ A2_ddot_B2() [2/2]

template<class T , class R >
void GMatTensor::Cartesian3d::A2_ddot_B2 ( const T &  A,
const T &  B,
R &  ret 
)
inline

Same as A2_ddot_B2(const T& A, const T& B) but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
retoutput [...] array.

Definition at line 1038 of file Cartesian3d.h.

◆ A2_dot_A2T() [1/2]

template<class T >
auto GMatTensor::Cartesian3d::A2_dot_A2T ( const T &  A)
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).

Parameters
A[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1239 of file Cartesian3d.h.

◆ A2_dot_A2T() [2/2]

template<class T , class R >
void GMatTensor::Cartesian3d::A2_dot_A2T ( const T &  A,
R &  ret 
)
inline

Same as A2_dot_A2T(const T& A) but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [..., 3, 3] array.

Definition at line 1252 of file Cartesian3d.h.

◆ A2_dot_B2() [1/2]

template<class T >
auto GMatTensor::Cartesian3d::A2_dot_B2 ( const T &  A,
const T &  B 
)
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).

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1274 of file Cartesian3d.h.

◆ A2_dot_B2() [2/2]

template<class T , class R >
void GMatTensor::Cartesian3d::A2_dot_B2 ( const T &  A,
const T &  B,
R &  ret 
)
inline

Same as A2_dot_B2(const T& A, const T& B) but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
retoutput [..., 3, 3] array.

Definition at line 1289 of file Cartesian3d.h.

◆ A2_dyadic_B2() [1/2]

template<class T >
auto GMatTensor::Cartesian3d::A2_dyadic_B2 ( const T &  A,
const T &  B 
)
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).

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
Returns
[..., 3, 3, 3, 3] array.

Definition at line 1312 of file Cartesian3d.h.

◆ A2_dyadic_B2() [2/2]

template<class T , class R >
void GMatTensor::Cartesian3d::A2_dyadic_B2 ( const T &  A,
const T &  B,
R &  ret 
)
inline

Same as A2_dyadic_B2(const T& A, const T& B) but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
retoutput [..., 3, 3, 3, 3] array.

Definition at line 1327 of file Cartesian3d.h.

◆ A2s_ddot_B2s() [1/2]

template<class T >
auto GMatTensor::Cartesian3d::A2s_ddot_B2s ( const T &  A,
const T &  B 
)
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).

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
Returns
[...] array.

Definition at line 1055 of file Cartesian3d.h.

◆ A2s_ddot_B2s() [2/2]

template<class T , class R >
void GMatTensor::Cartesian3d::A2s_ddot_B2s ( const T &  A,
const T &  B,
R &  ret 
)
inline

Same as A2s_ddot_B2s(const T& A, const T& B) but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
B[..., 3, 3] array.
retoutput [...] array.

Definition at line 1069 of file Cartesian3d.h.

◆ A4_ddot_B2() [1/2]

template<class T , class U >
auto GMatTensor::Cartesian3d::A4_ddot_B2 ( const T &  A,
const U &  B 
)
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).

Parameters
A[..., 3, 3, 3, 3] array.
B[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1350 of file Cartesian3d.h.

◆ A4_ddot_B2() [2/2]

template<class T , class U , class R >
void GMatTensor::Cartesian3d::A4_ddot_B2 ( const T &  A,
const U &  B,
R &  ret 
)
inline

Same as A4_ddot_B2(const T& A, const U& B) but writes to externally allocated output.

Parameters
A[..., 3, 3, 3, 3] array.
B[..., 3, 3] array.
retoutput [..., 3, 3] array.

Definition at line 1365 of file Cartesian3d.h.

◆ A4_dot_B2() [1/2]

template<class T , class U >
auto GMatTensor::Cartesian3d::A4_dot_B2 ( const T &  A,
const U &  B 
)
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).

Parameters
A[..., 3, 3, 3, 3] array.
B[..., 3, 3] array.
Returns
[..., 3, 3, 3, 3] array.

Definition at line 1388 of file Cartesian3d.h.

◆ A4_dot_B2() [2/2]

template<class T , class U , class R >
void GMatTensor::Cartesian3d::A4_dot_B2 ( const T &  A,
const U &  B,
R &  ret 
)
inline

Same as A4_dot_B2(const T& A, const U& B) but writes to externally allocated output.

Parameters
A[..., 3, 3, 3, 3] array.
B[..., 3, 3] array.
retoutput [..., 3, 3, 3, 3] array.

Definition at line 1403 of file Cartesian3d.h.

◆ Det()

template<class T >
auto GMatTensor::Cartesian3d::Det ( const T &  A)
inline

Determinant.

To write to allocated output use det().

Parameters
A[..., 3, 3] array.
Returns
[...] array.

Definition at line 991 of file Cartesian3d.h.

◆ det()

template<class T , class R >
void GMatTensor::Cartesian3d::det ( const T &  A,
R &  ret 
)
inline

Same as Det() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [...] array.

Definition at line 1003 of file Cartesian3d.h.

◆ Deviatoric()

template<class T >
auto GMatTensor::Cartesian3d::Deviatoric ( const T &  A)
inline

Deviatoric part of a tensor:

A - Hydrostatic(A) * I2

See Hydrostatic(). To write to allocated data use deviatoric().

Parameters
A[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1116 of file Cartesian3d.h.

◆ deviatoric()

template<class T , class R >
void GMatTensor::Cartesian3d::deviatoric ( const T &  A,
R &  ret 
)
inline

Same as Deviatoric() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [..., 3, 3] array.

Definition at line 1129 of file Cartesian3d.h.

◆ Hydrostatic()

template<class T >
auto GMatTensor::Cartesian3d::Hydrostatic ( const T &  A)
inline

Hydrostatic part of a tensor.

== trace(A) / 3 == trace(A) / d

where d = 3. To write to allocated output use hydrostatic().

Parameters
A[..., 3, 3] array.
Returns
[...] array.

Definition at line 966 of file Cartesian3d.h.

◆ hydrostatic()

template<class T , class R >
void GMatTensor::Cartesian3d::hydrostatic ( const T &  A,
R &  ret 
)
inline

Same as Hydrostatic() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [...] array.

Definition at line 978 of file Cartesian3d.h.

◆ I2()

array_type::tensor< double, 2 > GMatTensor::Cartesian3d::I2 ( )
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().

Returns
[3, 3] array.

Definition at line 798 of file Cartesian3d.h.

◆ I4()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::I4 ( )
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().

Returns
[3, 3, 3, 3] array.

Definition at line 848 of file Cartesian3d.h.

◆ I4d()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::I4d ( )
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().

Returns
[3, 3, 3, 3] array.

Definition at line 919 of file Cartesian3d.h.

◆ I4rt()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::I4rt ( )
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().

Returns
[3, 3, 3, 3] array.

Definition at line 873 of file Cartesian3d.h.

◆ I4s()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::I4s ( )
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().

Returns
[3, 3, 3, 3] array.

Definition at line 898 of file Cartesian3d.h.

◆ II()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::II ( )
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().

Returns
[3, 3, 3, 3] array.

Definition at line 823 of file Cartesian3d.h.

◆ Inv()

template<class T >
auto GMatTensor::Cartesian3d::Inv ( const T &  A)
inline

Inverse.

To write to allocated output use inv().

Parameters
A[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1177 of file Cartesian3d.h.

◆ inv()

template<class T , class R >
void GMatTensor::Cartesian3d::inv ( const T &  A,
R &  ret 
)
inline

Same as Inv() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [..., 3, 3] array.

Definition at line 1190 of file Cartesian3d.h.

◆ Logs()

template<class T >
auto GMatTensor::Cartesian3d::Logs ( const T &  A)
inline

Logarithm.

Symmetric tensors only, no assertion. To write to allocated output use logs().

Parameters
A[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1205 of file Cartesian3d.h.

◆ logs()

template<class T , class R >
void GMatTensor::Cartesian3d::logs ( const T &  A,
R &  ret 
)
inline

Same as Logs() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [..., 3, 3] array, may be the same reference as A.

Definition at line 1218 of file Cartesian3d.h.

◆ Norm_deviatoric()

template<class T >
auto GMatTensor::Cartesian3d::Norm_deviatoric ( const T &  A)
inline

Norm of the tensor's deviator:

\( \sqrt{(dev(A))_{ij} (dev(A))_{ji}} \)

To write to allocated data use norm_deviatoric().

Parameters
A[..., 3, 3] array.
Returns
[...] array.

Definition at line 1086 of file Cartesian3d.h.

◆ norm_deviatoric()

template<class T , class R >
void GMatTensor::Cartesian3d::norm_deviatoric ( const T &  A,
R &  ret 
)
inline

Same as Norm_deviatoric() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [...] array

Definition at line 1099 of file Cartesian3d.h.

◆ O2()

array_type::tensor< double, 2 > GMatTensor::Cartesian3d::O2 ( )
inline

2nd-order null tensor (all components equal to zero).

Returns
[3, 3] array.

Definition at line 765 of file Cartesian3d.h.

◆ O4()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::O4 ( )
inline

4th-order null tensor (all components equal to zero).

Returns
[3, 3, 3, 3] array.

Definition at line 775 of file Cartesian3d.h.

◆ Random2()

array_type::tensor< double, 2 > GMatTensor::Cartesian3d::Random2 ( )
inline

Random 2nd-order tensor (for example for use in testing).

Returns
[3, 3] array.

Definition at line 743 of file Cartesian3d.h.

◆ Random4()

array_type::tensor< double, 4 > GMatTensor::Cartesian3d::Random4 ( )
inline

Random 4th-order tensor (for example for use in testing).

Returns
[3, 3, 3, 3] array.

Definition at line 754 of file Cartesian3d.h.

◆ Sym()

template<class T >
auto GMatTensor::Cartesian3d::Sym ( const T &  A)
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().

Parameters
A[..., 3, 3] array.
Returns
[..., 3, 3] array.

Definition at line 1150 of file Cartesian3d.h.

◆ sym()

template<class T , class R >
void GMatTensor::Cartesian3d::sym ( const T &  A,
R &  ret 
)
inline

Same as Sym() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [..., 3, 3] array, may be the same reference as A.

Definition at line 1163 of file Cartesian3d.h.

◆ Trace()

template<class T >
auto GMatTensor::Cartesian3d::Trace ( const T &  A)
inline

Trace or 2nd-order tensor.

\( tr(A) = A_{ii} \)

To write to allocated data use trace().

Parameters
A[..., 3, 3] array.
Returns
[...] array.

Definition at line 937 of file Cartesian3d.h.

◆ trace()

template<class T , class R >
void GMatTensor::Cartesian3d::trace ( const T &  A,
R &  ret 
)
inline

Same as Trace() but writes to externally allocated output.

Parameters
A[..., 3, 3] array.
retoutput [...] array.

Definition at line 949 of file Cartesian3d.h.

◆ underlying_shape_A2()

template<class T >
auto GMatTensor::Cartesian3d::underlying_shape_A2 ( const T &  A) -> std::array<size_t, detail::impl_A2<T, 3>::rank>
inline

Shape of the underlying array.

Parameters
A[..., 2, 2] array.
Returns
[...].

Definition at line 1441 of file Cartesian3d.h.

◆ underlying_shape_A4()

template<class T >
auto GMatTensor::Cartesian3d::underlying_shape_A4 ( const T &  A) -> std::array<size_t, detail::impl_A4<T, 3>::rank>
inline

Shape of the underlying array.

Parameters
A[..., 2, 2] array.
Returns
[...].

Definition at line 1453 of file Cartesian3d.h.

◆ underlying_size_A2()

template<class T >
size_t GMatTensor::Cartesian3d::underlying_size_A2 ( const T &  A)
inline

Size of the underlying array.

Parameters
A[..., 2, 2] array.
Returns
prod([...]).

Definition at line 1417 of file Cartesian3d.h.

◆ underlying_size_A4()

template<class T >
size_t GMatTensor::Cartesian3d::underlying_size_A4 ( const T &  A)
inline

Size of the underlying array.

Parameters
A[..., 2, 2] array.
Returns
prod([...]).

Definition at line 1429 of file Cartesian3d.h.