funcy  1.6.1
Classes | Typedefs | Functions | Variables
funcy::linalg Namespace Reference

Functionality from linear algebra such as (modified) principal and mixed matrix invariants. More...

Classes

class  LeftCauchyGreenStrainTensor
 Left Cauchy-Green strain tensor \( F^T F \) for a symmetric matrix \( F \). More...
 
class  RightCauchyGreenStrainTensor
 Right Cauchy-Green strain tensor \( F^T F \) for a symmetric matrix \( F \). More...
 
class  SecondPrincipalInvariant
 
struct  SquaredFrobeniusNorm
 
class  Transpose
 

Typedefs

template<class Mat >
using FrobeniusNorm = mathop::Chain< Sqrt, SquaredFrobeniusNorm< Mat > >
 

Functions

template<Matrix M, class Index >
decltype(auto) FUNCY_ALWAYS_INLINE at (M &&A, Index i, Index j) requires requires(std
 Access matrix entry.
 
template<int row, int col, ConstantSize Mat>
auto compute_cofactor (const Mat &A) requires(dim< Mat >()
 Compute the \((row,col)\)-cofactor of \( A \). Implemented for \( A\in \mathbb{R}^{n,n} \) with \( n=2,3 \). More...
 
template<int row, int col, ConstantSize Mat>
auto compute_cofactor_directional_derivative (const Mat &A, const Mat &B) requires(dim< Mat >()
 Compute the first directional derivative in direction \( B \) of the \((row,col)\)-cofactor of \( A \). Implemented for \( A\in \mathbb{R}^{n,n} \) with \( n=2,3 \). More...
 
template<class Mat >
auto det (const Mat &A) requires(!Function< Mat > &&!SquareMatrix< Mat >)
 Generate \(\det(A)\). More...
 
template<SquareMatrix Mat>
auto det (const Mat &A)
 Generate \(\det(A)\). More...
 
template<Function F>
auto det (const F &f)
 Generate \(\det\circ f\). More...
 
template<SquareMatrix M, int n = dim< M >()>
auto deviator (const M &A)
 
template<class Matrix >
auto deviator (const Matrix &A)
 
template<Function F>
auto deviator (const F &f)
 Generate deviator \( \mathrm{dev}\circ f\).
 
template<Matrix M>
auto j2 (const M &A) requires(!Function< M >)
 Second deviatoric invariant \( j_2(\sigma)=\sqrt{\bar\sigma\negthinspace:\negthinspace\bar\sigma} \) with \(\bar\sigma = \sigma - \frac{\mathrm{tr}(\sigma)}{n}I\) and \(\sigma\in\mathbb{R}^{n,n}\).
 
template<class Mat >
constexpr int dim ()
 Dimension \(n\) of a fixed size matrix in \(\mathbb{R}^{n,n}\).
 
template<class Mat >
auto frobenius_norm (const Mat &A)
 
template<Function F>
auto frobenius_norm (const F &f)
 
template<Matrix Mat>
auto i4 (const Mat &A, const Mat &M) requires(!Function< Mat >)
 Generate first mixed invariant \( \iota_4=\iota_1(AM) \) of a matrix \(A\in\mathbb{R}^{n,n}\) with respect to the structural tensor \(M\in\mathbb{R}^{n,n}\). More...
 
template<Function F, class Matrix >
auto i4 (const F &f, const Matrix &M)
 Generate first mixed invariant \( \iota_4\circ f \) with \(f\mapsto\mathbb{R}^{n,n}\) and structural tensor \(M\in\mathbb{R}^{n,n}\). More...
 
template<Matrix Mat>
auto i5 (const Mat &A, const Mat &M) requires(!Function< Mat >)
 Generate second mixed invariant \( \iota_5=\iota_1(A^2M) \) of a matrix \(A\in\mathbb{R}^{n,n}\) with respect to the structural tensor \(M\in\mathbb{R}^{n,n}\). More...
 
template<Function F, class Matrix >
auto i5 (const F &f, const Matrix &M)
 Generate second mixed invariant \( \iota_5\circ f \) with \(f\mapsto\mathbb{R}^{n,n}\) and structural tensor \(M\in\mathbb{R}^{n,n}\). More...
 
template<Matrix Mat>
auto i6 (const Mat &A, const Mat &M) requires(!Function< Mat >)
 Generate third mixed invariant \( \iota_6=\iota_1(AM^2) \) of a matrix \(A\in\mathbb{R}^{n,n}\) with respect to the structural tensor \(M\in\mathbb{R}^{n,n}\). More...
 
template<Function F, class Matrix >
auto i6 (const F &f, const Matrix &M)
 Generate third mixed invariant \( \iota_6\circ f \) with \(f\mapsto\mathbb{R}^{n,n}\) and structural tensor \(M\in\mathbb{R}^{n,n}\). More...
 
template<class Arg , class Matrix , int n = dim< Matrix >()>
auto mi4 (const Arg &x, const Matrix &M)
 Isochoric (volume-preserving), first modified mixed invariant \( \bar\iota_4(A)=\iota_4\iota_3^{-1/3} \), where \(\iota_4\) is the first mixed and \(\iota_3\) is the third principal invariant. More...
 
template<class Arg , class Matrix , int n = dim< Matrix >()>
auto mi5 (const Arg &x, const Matrix &M)
 Isochoric (volume-preserving), second modified principal invariant \( \bar\iota_5(A)=\iota_5\iota_3^{-2/3} \), where \(\iota_5\) is the second mixed and \(\iota_3\) is the third principal invariant. More...
 
template<class Arg , class Matrix , int n = dim< Matrix >()>
auto mi6 (const Arg &x, const Matrix &M)
 Isochoric (volume-preserving), second modified principal invariant \( \bar\iota_6(A)=\iota_6\iota_3^{-1/3} \), where \(\iota_6\) is the third mixed and \(\iota_3\) is the third principal invariant. More...
 
template<class Arg >
auto i1 (Arg &&x)
 Generate first principal invariant. More...
 
template<Matrix M>
auto i2 (M &&A)
 Convenient generation of second principal invariant \( \iota_2(A)=\mathrm{tr}(\mathrm{cof}(A)) \) for \(A\in\mathbb{R}^{n,n}\). More...
 
template<Function F>
auto i2 (const F &f)
 Convenient generation of second principal invariant \( \iota_2\circ f \) for \(f:\cdot\mapsto\mathbb{R}^{n,n}\). More...
 
template<class Arg >
auto i3 (const Arg &x)
 Generate third principal invariant. More...
 
template<class Arg , int n = dim< Arg >()>
auto mi1 (const Arg &x)
 Isochoric (volume-preserving), first modified principal invariant \( \bar\iota_1(A)=\iota_1\iota_3^{-1/3} \), where \(\iota_1\) is the first and \(\iota_3\) is the third principal invariant. More...
 
template<class Arg , int n = dim< Arg >()>
auto mi2 (const Arg &x)
 Isochoric (volume-preserving), second modified principal invariant \( \bar\iota_2(A)=\iota_2\iota_3^{-2/3} \), where \(\iota_2\) is the second and \(\iota_3\) is the third principal invariant. More...
 
template<class Mat >
auto rows (const Mat &A) requires(!ConstantSize< Mat > &&static_check
 Number of rows of a dynamic size matrix.
 
template<ConstantSize Mat>
constexpr auto rows ()
 Number of rows of a constant size matrix.
 
template<class Mat >
auto cols (const Mat &A) requires(!ConstantSize< Mat > &&static_check
 Number of columns of a dynamic size matrix.
 
template<ConstantSize Mat>
constexpr auto cols ()
 Number of columns of a constant size matrix.
 
template<class Mat >
auto strain_tensor (const Mat &A)
 Generate the right Cauchy-Green strain tensor \(A*A^T\). More...
 
template<Function F>
auto strain_tensor (const F &f)
 Generate the right Cauchy-Green strain tensor \(f*f^T\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \). More...
 
template<class Mat >
auto left_strain_tensor (const Mat &A)
 Generate the left Cauchy-Green strain tensor \(A^T*A\). More...
 
template<ConstantSize Matrix, class Vector1 , class Vector2 >
Matrix tensor_product (const Vector1 &v, const Vector2 &w)
 Compute tensor product \( M = v \otimes w \).
 
template<class Matrix , class Vector >
Matrix tensor_product (const Vector &v)
 Compute tensor product \( M = v \otimes v \).
 
template<class Mat >
auto trace (const Mat &A) requires(!Function< Mat > &&!ConstantSize< Mat >)
 Generate \(\mathrm{tr}(A)\in\mathbb{R}^{n,n}\). More...
 
template<ConstantSize Mat>
auto trace (const Mat &A) requires(!Function< Mat >)
 Generate \(\mathrm{tr}(A)\in\mathbb{R}^{n,n}\). More...
 
template<Function F>
auto trace (const F &f)
 Generate \(\mathrm{tr}\circ f\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \). More...
 
template<class Mat >
auto transpose (const Mat &A)
 Generate \(A^T\in\mathbb{R}^{n,n}\). More...
 
template<Function F>
auto transpose (const F &f)
 Generate \(f^T\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \). More...
 
template<ConstantSize Matrix>
Matrix unit_matrix ()
 
template<class Matrix >
Matrix unit_matrix (int rows)
 

Variables

auto int col
 
template<class V >
concept ConstantSize = linalg::detail::NumberOfRows< V >::value > 0
 Constant-size matrix concept.
 
template<class M >
concept SquareMatrix
 Constant-size square matrix concept. More...
 
template<class T >
concept Matrix
 clang-format off More...
 
template<class T >
concept Vector
 Vector concept. More...
 

Detailed Description

Functionality from linear algebra such as (modified) principal and mixed matrix invariants.

See also
Linear Algebra