muMECH  1.0
mumech::MatrixOperations Namespace Reference

Namespace of the functions of various matrices/tensor/vector operations. More...

Functions

*** GENERAL TENSOR OPERATIONS ***

Operations with tensors of various notations

double giveTTproduct_1is2x2to3and2x2to3_SS (const double *T1, const double *T2)
 Function gives scalar left-right product of tensor and tensor. More...
 
void giveIsoTensAndVectorProduct (const double *tens, const double *vec, double *result, int dim)
 Function gives the product of the isotropic tensor of seccond order with a vector. More...
 
void giveTVproduct_6is6x6to12and6 (double *result, const double *T, const double *vect)
 Function gives product of tensor and vector - 'result = T * vect'. More...
 
void giveTVproduct_3is3x3to5and3 (double *result, const double *T, const double *vect)
 Function gives product of tensor and vector - 'result = T * vect'. More...
 
double giveVTVproduct_1is3and3x3to5and3 (const double *T, const double *vect)
 Function gives scalar left-right product of tensor and vector - 'result = vect^T * T * vect'. More...
 
void giveTTproduct_3x3to5is3x3to5and3x3to5 (double *result, const double *T1, const double *T2)
 Function gives product of tensor and tensor - 'result = T1 * T2'. More...
 
void giveInverseMatrix (double *mtrx, int n)
 Function computes inversion of squared matrix mtrx. More...
 
void giveInverseMatrix (double **mtrx, int n)
 Function computes inversion of squared matrix mtrx. More...
 
void giveInverseMatrix_core (double **answer, double **mtrx, int n, bool vect)
 Function gives inversion of squared matrix mtrx. More...
 
void printField (double **field, int n, int m, const char *notice)
 Function prints a field which is saved as 2D array. More...
 
void printField (double **field, int n, int m, int lineBreak, const char *notice)
 Function prints a field which is saved as 2D array. More...
 
void printAnisoField (double **field, int n, int *m, int lineBreak, const char *notice)
 Function prints an anisotropic field of type 'double' which is saved as 2D anisotropic array. More...
 
void printAnisoField (int **field, int n, int *m, int lineBreak, const char *notice)
 Function prints an anisotropic field of type 'int' which is saved as 2D anisotropic array. More...
 
void CopyTensorAndReduceToFeep (const double *a, double *b)
 Function copy two double tensor, 'a' -> 'b', saved as 9 component vectors. More...
 
void convert2Dtensor_TRtoROW_notation (double *t)
 Function convert the symmetric double 2D tensor 't'. More...
 
void convert3Dtensor_TFEEPtoROW_notation (double *t)
 Function convert the symmetric double 3D tensor 't'. More...
 
void convert2Dtensor_TRtoVR_notation (double *t)
 Function convert the symmetric double 2D tensor 't'. More...
 
void convert3Dtensor_TRtoVR_notation (double *t)
 Function convert the symmetric double 3D tensor 't'. More...
 
void convert3Dtensor_9ROWto6FEEP_notation (double *t)
 
void convert2Dtensor_4ROWto3FEEP_notation (double *t)
 
void copy3Dto2Dtensors_FEEPreduced (const double *a, double *b)
 Function copy the symmetric double 3D tensor 'a' to 2D tensor 'b'. More...
 
void copy2Dto3Dtensors_FEEPreduced (const double *a, double *b)
 Function copy the symmetric double 2D tensor 'a' to 3D tensor 'b'. More...
 
void copy3DeshelbyTensor_reduced2full (const double *a, double **b)
 Function copies and converts 3D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full 6x6 matrix 'b'. More...
 
void copy2DeshelbyTensor_reduced2full (const double *a, double **b)
 Function copies and converts 2D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full 3x3 matrix 'b'. More...
 
void copy3DeshelbyTensor_full2reduced (const double *a, double *b)
 Function copies and converts 3D eshelby/stiffness tensor saved in full row-wise vector 'a' to reduced row-wise vector 'b'. More...
 
void copy3DeshelbyTensor_reduced2full (const double *a, double *b)
 Function copies and converts 3D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full row-wise vector 'b'. More...
 
void copy2DeshelbyTensor_full2reduced (const double *a, double *b)
 Function copies and converts 2D eshelby/stiffness tensor saved in full row-wise vector 'a' to reduced row-wise vector 'b'. More...
 
void copy2DeshelbyTensor_reduced2full (const double *a, double *b)
 Function copies and converts 2D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full row-wise vector 'b'. More...
 
void giveUnitSMatrixReduced_2d (double *m)
 Function sets reduced 2d SMatrix to unit matrix. More...
 
void giveUnitSMatrixReduced_3d (double *m)
 Function sets reduced 3d SMatrix to unit matrix. More...
 
void giveUnitSMatrixFull_2d (double *m)
 Function sets reduced 2d SMatrix to unit matrix. More...
 
void giveUnitSMatrixFull_3d (double *m)
 Function sets reduced 3d SMatrix to unit matrix. More...
 
void printSMatrixReduced (const double S[12], const char *notice, unsigned flag)
 Function prints an reduced SMatrix in matrix form. More...
 

Detailed Description

Namespace of the functions of various matrices/tensor/vector operations.

Isotropic tensor

3d 2-nd order tensor 3x3 -> 6

3x3 symetric tensor can be saved in vector of lenhgt 6 - theoretical FEEP notation 11 12 13 21 22 23 => 11 22 33 12 23 13 31 32 33

2d 2-nd order tensor 2x2 -> 3

2x2 symetric tensor can be saved in vector of lenhgt 3 - theoretical FEEP notation 11 12 21 22 => 11 22 12

3x3 matrix with 5 nonzero members can be saved in vector "3x3to5" of lenhgt 5 1 2 - 3 4 - => 1 2 3 4 5

3d 4-rh order tensor -> 6x6 -> 12

6x6 matrix with 12 nonzero members can be saved in vector "6x6to12" of lenhgt 12 1 2 3 - - - 4 5 6 - - - 7 8 9 - - - => 1 2 3 4 5 6 7 8 9 10 11 12

2d 4-rh order tensor -> 3x3 -> 5

3x3 matrix with 5 nonzero members can be saved in vector "3x3to5" of lenhgt 5 1 2 - 3 4 - => 1 2 3 4 5

Function Documentation

void mumech::MatrixOperations::convert2Dtensor_4ROWto3FEEP_notation ( double *  t)

Definition at line 516 of file matrixOperations.cpp.

References _errorr.

Referenced by mumech::MatrixRecord::convert_RS_ROWtoFEEP().

void mumech::MatrixOperations::convert2Dtensor_TRtoROW_notation ( double *  t)

Function convert the symmetric double 2D tensor 't'.

Function convert tensor from.

Tensor 't' is saved in reduced 3 component form in theoretical notation. It is converted to 4 component vector in rows form.

Definition at line 476 of file matrixOperations.cpp.

Referenced by mumech::convertTensorStrain(), mumech::convertTensorStress(), CopyTensorAndReduceToFeep(), and mumech::Problem::printVtkFileCompleteInclRec().

void mumech::MatrixOperations::convert2Dtensor_TRtoVR_notation ( double *  t)

Function convert the symmetric double 2D tensor 't'.

Tensor 't' is saved in reduced 3 component form in theoretical notation. It is converted to reduced 3 component form in Voigt notation.

Definition at line 493 of file matrixOperations.cpp.

Referenced by mumech::convertTensorStrain().

void mumech::MatrixOperations::convert3Dtensor_9ROWto6FEEP_notation ( double *  t)

Definition at line 506 of file matrixOperations.cpp.

References _errorr.

Referenced by mumech::MatrixRecord::convert_RS_ROWtoFEEP().

void mumech::MatrixOperations::convert3Dtensor_TFEEPtoROW_notation ( double *  t)

Function convert the symmetric double 3D tensor 't'.

Tensor 't' is saved in reduced 6 component form with "FEEP code" arrangement of the components in theoretical notation. It is converted to 9 component vector in rows form.

Definition at line 482 of file matrixOperations.cpp.

Referenced by mumech::convertTensorStrain(), mumech::convertTensorStress(), and mumech::Problem::printVtkFileCompleteInclRec().

void mumech::MatrixOperations::convert3Dtensor_TRtoVR_notation ( double *  t)

Function convert the symmetric double 3D tensor 't'.

Tensor 't' is saved in reduced 6 component form in theoretical notation. It is converted to reduced 6 component form in Voigt notation.

Definition at line 498 of file matrixOperations.cpp.

Referenced by mumech::convertTensorStrain().

void mumech::MatrixOperations::copy2DeshelbyTensor_full2reduced ( const double *  a,
double *  b 
)

Function copies and converts 2D eshelby/stiffness tensor saved in full row-wise vector 'a' to reduced row-wise vector 'b'.

Definition at line 619 of file matrixOperations.cpp.

void mumech::MatrixOperations::copy2DeshelbyTensor_reduced2full ( const double *  a,
double **  b 
)

Function copies and converts 2D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full 3x3 matrix 'b'.

Definition at line 563 of file matrixOperations.cpp.

References mumech::CleanArray2d().

Referenced by mumech::Inclusion::give_EshelbyMatrixFull(), mumech::Inclusion::give_StiffnessMatrixFull(), mumech::Homogenization::giveFullMatrixFromReducedMatrix(), and mumech::MatrixRecord::giveFullStiffMatrix().

void mumech::MatrixOperations::copy2DeshelbyTensor_reduced2full ( const double *  a,
double *  b 
)

Function copies and converts 2D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full row-wise vector 'b'.

Definition at line 627 of file matrixOperations.cpp.

References mumech::CleanVector().

void mumech::MatrixOperations::copy2Dto3Dtensors_FEEPreduced ( const double *  a,
double *  b 
)

Function copy the symmetric double 2D tensor 'a' to 3D tensor 'b'.

The 2D tensor is supposed to be in the plane xy. The 'z' components of 3D tensor are set to zero. Both tensors are saved in reduced forms. The arrangement of the components of reduced tensor is done as in FEEP code.

Definition at line 531 of file matrixOperations.cpp.

void mumech::MatrixOperations::copy3DeshelbyTensor_full2reduced ( const double *  a,
double *  b 
)

Function copies and converts 3D eshelby/stiffness tensor saved in full row-wise vector 'a' to reduced row-wise vector 'b'.

Definition at line 579 of file matrixOperations.cpp.

void mumech::MatrixOperations::copy3DeshelbyTensor_reduced2full ( const double *  a,
double **  b 
)

Function copies and converts 3D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full 6x6 matrix 'b'.

Definition at line 542 of file matrixOperations.cpp.

References mumech::CleanArray2d().

Referenced by mumech::Inclusion::give_EshelbyMatrixFull(), mumech::Inclusion::give_StiffnessMatrixFull(), mumech::Homogenization::giveFullMatrixFromReducedMatrix(), and mumech::MatrixRecord::giveFullStiffMatrix().

void mumech::MatrixOperations::copy3DeshelbyTensor_reduced2full ( const double *  a,
double *  b 
)

Function copies and converts 3D eshelby/stiffness tensor saved in reduced row-wise vector 'a' to full row-wise vector 'b'.

Definition at line 598 of file matrixOperations.cpp.

References mumech::CleanVector().

void mumech::MatrixOperations::copy3Dto2Dtensors_FEEPreduced ( const double *  a,
double *  b 
)

Function copy the symmetric double 3D tensor 'a' to 2D tensor 'b'.

The 2D tensor is supposed to be in the plane xy. Both tensors are saved in reduced forms. The arrangement of the components of reduced tensor is done as in FEEP code.

Definition at line 524 of file matrixOperations.cpp.

Referenced by mumech::mElement::give_strain(), and mumech::mElement::give_stress().

void mumech::MatrixOperations::CopyTensorAndReduceToFeep ( const double *  a,
double *  b 
)

Function copy two double tensor, 'a' -> 'b', saved as 9 component vectors.

Function copy the symmetric double tensor from 'a' -> 'b'. Tensor 'a' is saved as 9 component vector and tensor 'b' as its reduced 6 component form. The arrangement of the components of reduced tensor is done as in FEEP code.

Definition at line 460 of file matrixOperations.cpp.

References convert2Dtensor_TRtoROW_notation().

void mumech::MatrixOperations::giveInverseMatrix ( double *  mtrx,
int  n 
)

Function computes inversion of squared matrix mtrx.

The inverted matrix is return in the sama matrix mtrx.

Parameters
mtrxSquared matrix to be inverted.
nSize of matrix.

Definition at line 378 of file matrixOperations.cpp.

References _errorr, mumech::AllocateArray2D(), mumech::copyMatrix_1Dto2D(), mumech::DeleteArray2D(), and giveInverseMatrix_core().

Referenced by mumech::Dilute::giveFullDiluteConcentrationFactorOfInclusionInLC(), mumech::MoriTanaka::giveHomogenizedStiffnessMatrix(), mumech::RegGrid::giveHomogenizedStiffnessMatrix(), and mumech::DifferentialScheme::giveHomogenizedStiffnessMatrix().

void mumech::MatrixOperations::giveInverseMatrix ( double **  mtrx,
int  n 
)

Function computes inversion of squared matrix mtrx.

The inverted matrix is return in the sama matrix mtrx.

Parameters
mtrxSquared matrix to be inverted.
nSize of matrix.

Definition at line 401 of file matrixOperations.cpp.

References _errorr, mumech::AllocateArray2D(), mumech::CopyArray2D(), mumech::DeleteArray2D(), and giveInverseMatrix_core().

void mumech::MatrixOperations::giveInverseMatrix_core ( double **  answer,
double **  mtrx,
int  n,
bool  vect 
)

Function gives inversion of squared matrix mtrx.

Parameters
answerInverse matrix.
mtrxSquared matrix to be inverted.
nSize of matrix.

Definition at line 424 of file matrixOperations.cpp.

References _errorr, mumech::lubksb(), and mumech::ludcmp().

Referenced by giveInverseMatrix().

void mumech::MatrixOperations::giveIsoTensAndVectorProduct ( const double *  tens,
const double *  vec,
double *  result,
int  dim 
)

Function gives the product of the isotropic tensor of seccond order with a vector.

The seccond order tensor object is stored as a vector of 6 components in FEEP notation. e.i. e_ij = {e_11, e_22, e_33, e_12, e_23, e_13 }^T

Parameters
tens6 member vector (tensor 3 x 3 in tensorial notation).
vecVector of 3 components.
resVecResulting vector of 3 components.
dimDimension, 2 or 3.

Definition at line 75 of file matrixOperations.cpp.

References _errorr, and mumech::CopyVector().

Referenced by mumech::MatrixRecord::give_globHomog_Displc().

double mumech::MatrixOperations::giveTTproduct_1is2x2to3and2x2to3_SS ( const double *  T1,
const double *  T2 
)

Function gives scalar left-right product of tensor and tensor.

Energy = Strain * stress -> strain is converted from theoretical to voight notation

Parameters
*T1Tensor - 2d 2-nd order tensor of dimension 2x2 saved in 1d array of TVRN_THEORETICAL_FEEP.
*T2Tensor - 2d 2-nd order tensor of dimension 2x2 saved in 1d array of TVRN_THEORETICAL_FEEP.

Definition at line 43 of file matrixOperations.cpp.

Referenced by mumech::mElement::give_energy(), and mumech::Mesh::give_homog_energy().

void mumech::MatrixOperations::giveTTproduct_3x3to5is3x3to5and3x3to5 ( double *  result,
const double *  T1,
const double *  T2 
)

Function gives product of tensor and tensor - 'result = T1 * T2'.

Parameters
*resultResulting tensor of dimension 3x3 saved in 1d array with 5 nonzero notation.
*T1Tensor of dimension 3x3 saved in 1d array with 5 nonzero notation.
*T2Tensor of dimension 3x3 saved in 1d array with 5 nonzero notation.

Definition at line 170 of file matrixOperations.cpp.

References _errorr.

Referenced by mumech::InclusionRecord2D::compute_eps_tau(), mumech::InclusionRecord2D::compute_initial_eps_tau(), mumech::InclusionRecord2D::compute_strain_pert_from_eps_zero_ext(), mumech::InclusionRecord2D::compute_strain_pert_from_eps_zero_int(), mumech::Inclusion::Eps02EpsTau(), and mumech::InclusionRecord2D::update_eps_tau().

void mumech::MatrixOperations::giveTVproduct_3is3x3to5and3 ( double *  result,
const double *  T,
const double *  vect 
)
void mumech::MatrixOperations::giveTVproduct_6is6x6to12and6 ( double *  result,
const double *  T,
const double *  vect 
)
void mumech::MatrixOperations::giveUnitSMatrixFull_2d ( double *  m)
inline

Function sets reduced 2d SMatrix to unit matrix.

Definition at line 297 of file matrixOperations.h.

References mumech::CleanVector().

Referenced by mumech::TransformTensors::give_Te(), mumech::TransformTensors::give_TeInv(), and mumech::Homogenization::giveFullUnitMatrix().

void mumech::MatrixOperations::giveUnitSMatrixFull_3d ( double *  m)
inline

Function sets reduced 3d SMatrix to unit matrix.

Definition at line 299 of file matrixOperations.h.

References mumech::CleanVector(), and printSMatrixReduced().

Referenced by mumech::TransformTensors::give_Te(), mumech::TransformTensors::give_TeInv(), and mumech::Homogenization::giveFullUnitMatrix().

void mumech::MatrixOperations::giveUnitSMatrixReduced_2d ( double *  m)
inline

Function sets reduced 2d SMatrix to unit matrix.

Definition at line 292 of file matrixOperations.h.

References mumech::CleanVector().

Referenced by mumech::Homogenization::giveReducedUnitMatrix().

void mumech::MatrixOperations::giveUnitSMatrixReduced_3d ( double *  m)
inline

Function sets reduced 3d SMatrix to unit matrix.

Definition at line 294 of file matrixOperations.h.

References mumech::CleanVector().

Referenced by mumech::Homogenization::giveReducedUnitMatrix().

double mumech::MatrixOperations::giveVTVproduct_1is3and3x3to5and3 ( const double *  T,
const double *  vect 
)

Function gives scalar left-right product of tensor and vector - 'result = vect^T * T * vect'.

Parameters
*TTensor of dimension 3x3 saved in 1d array with 5 nonzero notation.
*vectVector of dimension 3.

Definition at line 161 of file matrixOperations.cpp.

Referenced by mumech::Mesh::give_error().

void mumech::MatrixOperations::printAnisoField ( double **  field,
int  n,
int *  m,
int  lineBreak,
const char *  notice 
)

Function prints an anisotropic field of type 'double' which is saved as 2D anisotropic array.

Definition at line 231 of file matrixOperations.cpp.

References ABS, and MACHINE_EPS_PRN.

void mumech::MatrixOperations::printAnisoField ( int **  field,
int  n,
int *  m,
int  lineBreak,
const char *  notice 
)

Function prints an anisotropic field of type 'int' which is saved as 2D anisotropic array.

Definition at line 264 of file matrixOperations.cpp.

References ABS, and MACHINE_EPS_PRN.

void mumech::MatrixOperations::printField ( double **  field,
int  n,
int  m,
const char *  notice 
)

Function prints a field which is saved as 2D array.

Definition at line 57 of file matrixOperations.cpp.

References ABS, and MACHINE_EPS_PRN.

void mumech::MatrixOperations::printField ( double **  field,
int  n,
int  m,
int  lineBreak,
const char *  notice 
)

Function prints a field which is saved as 2D array.

Definition at line 198 of file matrixOperations.cpp.

References ABS, and MACHINE_EPS_PRN.

void mumech::MatrixOperations::printSMatrixReduced ( const double  S[12],
const char *  notice,
unsigned  flag 
)

Function prints an reduced SMatrix in matrix form.

Parameters
s[12]SMatrix
flagMATEMATHICA_SYNTAX or STANDARD_SYNTAX

Referenced by giveUnitSMatrixFull_3d().