svMultiPhysics
|
The classes defined here duplicate the data structures in the Fortran MATFUN module defined in MATFUN.f. More...
Typedefs | |
template<size_t nsd> | |
using | Matrix = Eigen::Matrix< double, nsd, nsd > |
template<size_t nsd> | |
using | Tensor = Eigen::TensorFixedSize< double, Eigen::Sizes< nsd, nsd, nsd, nsd > > |
Functions | |
double | mat_ddot (const Array< double > &A, const Array< double > &B, const int nd) |
Double dot product of 2 square matrices. | |
double | mat_det (const Array< double > &A, const int nd) |
Array< double > | mat_dev (const Array< double > &A, const int nd) |
Array< double > | mat_dyad_prod (const Vector< double > &u, const Vector< double > &v, const int nd) |
Create a matrix from outer product of two vectors. | |
Array< double > | mat_id (const int nd) |
Array< double > | mat_inv (const Array< double > &A, const int nd, bool debug) |
This function computes inverse of a square matrix. | |
Array< double > | mat_inv_ge (const Array< double > &Ain, const int n, bool debug) |
This function computes inverse of a square matrix using Gauss Elimination method. | |
Array< double > | mat_inv_ge_orig (const Array< double > &A, const int nd, bool debug) |
This function computes inverse of a square matrix using Gauss Elimination method. | |
Array< double > | mat_inv_lp (const Array< double > &A, const int nd) |
This function computes inverse of a square matrix using Lapack functions (DGETRF + DGETRI) | |
Array< double > | mat_inv_lp_eigen (const Array< double > &A, const int nd) |
not used, just a test. | |
Vector< double > | mat_mul (const Array< double > &A, const Vector< double > &v) |
Multiply a matrix by a vector. | |
Array< double > | mat_mul (const Array< double > &A, const Array< double > &B) |
Multiply a matrix by a matrix. | |
void | mat_mul (const Array< double > &A, const Array< double > &B, Array< double > &result) |
Multiply a matrix by a matrix. | |
Array< double > | mat_symm (const Array< double > &A, const int nd) |
Symmetric part of a matrix, S = (A + A.T)/2. | |
Array< double > | mat_symm_prod (const Vector< double > &u, const Vector< double > &v, const int nd) |
Create a matrix from symmetric product of two vectors. | |
double | mat_trace (const Array< double > &A, const int nd) |
Trace of second order matrix of rank nd. | |
Tensor4< double > | ten_asym_prod12 (const Array< double > &A, const Array< double > &B, const int nd) |
Create a 4th order tensor from antisymmetric outer product of two matrices. | |
Tensor4< double > | ten_ddot (const Tensor4< double > &A, const Tensor4< double > &B, const int nd) |
Double dot product of 2 4th order tensors T_ijkl = A_ijmn * B_klmn. | |
Tensor4< double > | ten_ddot_2412 (const Tensor4< double > &A, const Tensor4< double > &B, const int nd) |
T_ijkl = A_imjn * B_mnkl. | |
Tensor4< double > | ten_ddot_3424 (const Tensor4< double > &A, const Tensor4< double > &B, const int nd) |
void | ten_init (const int nd) |
Initialize tensor index pointer. | |
Tensor4< double > | ten_dyad_prod (const Array< double > &A, const Array< double > &B, const int nd) |
Create a 4th order tensor from outer product of two matrices. | |
Tensor4< double > | ten_ids (const int nd) |
Create a 4th order order symmetric identity tensor. | |
Array< double > | ten_mddot (const Tensor4< double > &A, const Array< double > &B, const int nd) |
Double dot product of a 4th order tensor and a 2nd order tensor. | |
Tensor4< double > | ten_symm_prod (const Array< double > &A, const Array< double > &B, const int nd) |
Create a 4th order tensor from symmetric outer product of two matrices. | |
Tensor4< double > | ten_transpose (const Tensor4< double > &A, const int nd) |
Array< double > | transpose (const Array< double > &A) |
Reproduces Fortran TRANSPOSE. | |
void | mat_mul6x3 (const Array< double > &A, const Array< double > &B, Array< double > &C) |
template<typename MatrixType > | |
MatrixType | convert_to_eigen_matrix (const Array< double > &src) |
template<typename MatrixType > | |
void | convert_to_array (const MatrixType &mat, Array< double > &dest) |
template<typename MatrixType > | |
void | copy_Dm (const MatrixType &mat, Array< double > &dest, int rows, int cols) |
template<int nsd> | |
Eigen::Matrix< double, nsd, 1 > | cross_product (const Eigen::Matrix< double, nsd, 1 > &u, const Eigen::Matrix< double, nsd, 1 > &v) |
template<int nsd> | |
double | double_dot_product (const Matrix< nsd > &A, const Matrix< nsd > &B) |
template<int nsd> | |
Tensor< nsd > | double_dot_product (const Tensor< nsd > &A, const std::array< int, 2 > &dimsA, const Tensor< nsd > &B, const std::array< int, 2 > &dimsB) |
Contracts two 4th order tensors A and B over two dimensions,. | |
template<int nsd> | |
Tensor< nsd > | dyadic_product (const Matrix< nsd > &A, const Matrix< nsd > &B) |
Compute the dyadic product of two 2nd order tensors A and B, C_ijkl = A_ij * B_kl. | |
template<int nsd> | |
Tensor< nsd > | fourth_order_identity () |
Create a 4th order identity tensor: I_ijkl = 0.5 * (δ_ik * δ_jl + δ_il * δ_jk) | |
template<int nsd> | |
Tensor< nsd > | symmetric_dyadic_product (const Matrix< nsd > &A, const Matrix< nsd > &B) |
Create a 4th order tensor from symmetric outer product of two matrices: C_ijkl = 0.5 * (A_ik * B_jl + A_il * B_jk) | |
template<int nsd> | |
Tensor< nsd > | transpose (const Tensor< nsd > &A) |
Performs a tensor transpose operation on a 4th order tensor A, B_ijkl = A_klij. | |
Variables | |
Array< int > | t_ind |
The classes defined here duplicate the data structures in the Fortran MATFUN module defined in MATFUN.f.
This module defines data structures for generally performed matrix and tensor operations.
Tensor< nsd > mat_fun::double_dot_product | ( | const Tensor< nsd > & | A, |
const std::array< int, 2 > & | dimsA, | ||
const Tensor< nsd > & | B, | ||
const std::array< int, 2 > & | dimsB | ||
) |
Contracts two 4th order tensors A and B over two dimensions,.
Tensor< nsd > mat_fun::dyadic_product | ( | const Matrix< nsd > & | A, |
const Matrix< nsd > & | B | ||
) |
Compute the dyadic product of two 2nd order tensors A and B, C_ijkl = A_ij * B_kl.
nsd,the | number of spatial dimensions |
A,the | first 2nd order tensor |
B,the | second 2nd order tensor |
Tensor< nsd > mat_fun::fourth_order_identity | ( | ) |
Create a 4th order identity tensor: I_ijkl = 0.5 * (δ_ik * δ_jl + δ_il * δ_jk)
nsd,the | number of spatial dimensions |
double mat_fun::mat_ddot | ( | const Array< double > & | A, |
const Array< double > & | B, | ||
const int | nd | ||
) |
Double dot product of 2 square matrices.
Array< double > mat_fun::mat_dyad_prod | ( | const Vector< double > & | u, |
const Vector< double > & | v, | ||
const int | nd | ||
) |
Create a matrix from outer product of two vectors.
Array< double > mat_fun::mat_inv | ( | const Array< double > & | A, |
const int | nd, | ||
bool | debug | ||
) |
This function computes inverse of a square matrix.
Array< double > mat_fun::mat_inv_ge | ( | const Array< double > & | Ain, |
const int | n, | ||
bool | debug | ||
) |
This function computes inverse of a square matrix using Gauss Elimination method.
Array< double > mat_fun::mat_inv_ge_orig | ( | const Array< double > & | A, |
const int | nd, | ||
bool | debug | ||
) |
This function computes inverse of a square matrix using Gauss Elimination method.
Array< double > mat_fun::mat_inv_lp | ( | const Array< double > & | A, |
const int | nd | ||
) |
This function computes inverse of a square matrix using Lapack functions (DGETRF + DGETRI)
Replaces 'FUNCTION MAT_INV_LP(A, nd) RESULT(Ainv)' defined in MATFUN.f.
Array< double > mat_fun::mat_inv_lp_eigen | ( | const Array< double > & | A, |
const int | nd | ||
) |
not used, just a test.
Array< double > mat_fun::mat_mul | ( | const Array< double > & | A, |
const Array< double > & | B | ||
) |
Multiply a matrix by a matrix.
Reproduces Fortran MATMUL.
void mat_fun::mat_mul | ( | const Array< double > & | A, |
const Array< double > & | B, | ||
Array< double > & | result | ||
) |
Multiply a matrix by a matrix.
Compute result directly into the passed argument.
Multiply a matrix by a vector.
Reproduces Fortran MATMUL.
Array< double > mat_fun::mat_symm | ( | const Array< double > & | A, |
const int | nd | ||
) |
Symmetric part of a matrix, S = (A + A.T)/2.
Array< double > mat_fun::mat_symm_prod | ( | const Vector< double > & | u, |
const Vector< double > & | v, | ||
const int | nd | ||
) |
Create a matrix from symmetric product of two vectors.
double mat_fun::mat_trace | ( | const Array< double > & | A, |
const int | nd | ||
) |
Trace of second order matrix of rank nd.
Tensor< nsd > mat_fun::symmetric_dyadic_product | ( | const Matrix< nsd > & | A, |
const Matrix< nsd > & | B | ||
) |
Create a 4th order tensor from symmetric outer product of two matrices: C_ijkl = 0.5 * (A_ik * B_jl + A_il * B_jk)
Reproduces 'FUNCTION TEN_SYMMPROD(A, B, nd) RESULT(C)'.
Tensor4< double > mat_fun::ten_asym_prod12 | ( | const Array< double > & | A, |
const Array< double > & | B, | ||
const int | nd | ||
) |
Create a 4th order tensor from antisymmetric outer product of two matrices.
Cijkl = Aij*Bkl-Ail*Bjk
Tensor4< double > mat_fun::ten_ddot | ( | const Tensor4< double > & | A, |
const Tensor4< double > & | B, | ||
const int | nd | ||
) |
Double dot product of 2 4th order tensors T_ijkl = A_ijmn * B_klmn.
Reproduces 'FUNCTION TEN_DDOT_3434(A, B, nd) RESULT(C)'.
Tensor4< double > mat_fun::ten_ddot_2412 | ( | const Tensor4< double > & | A, |
const Tensor4< double > & | B, | ||
const int | nd | ||
) |
T_ijkl = A_imjn * B_mnkl.
Tensor4< double > mat_fun::ten_dyad_prod | ( | const Array< double > & | A, |
const Array< double > & | B, | ||
const int | nd | ||
) |
Create a 4th order tensor from outer product of two matrices.
Tensor4< double > mat_fun::ten_ids | ( | const int | nd | ) |
Create a 4th order order symmetric identity tensor.
void mat_fun::ten_init | ( | const int | nd | ) |
Initialize tensor index pointer.
Array< double > mat_fun::ten_mddot | ( | const Tensor4< double > & | A, |
const Array< double > & | B, | ||
const int | nd | ||
) |
Double dot product of a 4th order tensor and a 2nd order tensor.
C_ij = (A_ijkl * B_kl)
Tensor4< double > mat_fun::ten_symm_prod | ( | const Array< double > & | A, |
const Array< double > & | B, | ||
const int | nd | ||
) |
Create a 4th order tensor from symmetric outer product of two matrices.
Reproduces 'FUNCTION TEN_SYMMPROD(A, B, nd) RESULT(C)'.
Array< double > mat_fun::transpose | ( | const Array< double > & | A | ) |
Reproduces Fortran TRANSPOSE.
Tensor< nsd > mat_fun::transpose | ( | const Tensor< nsd > & | A | ) |
Performs a tensor transpose operation on a 4th order tensor A, B_ijkl = A_klij.
nsd,the | number of spatial dimensions |
A,the | input 4th order tensor |