v0.13.1
Classes | Typedefs | Functions
EigenMatrix Namespace Reference

Classes

struct  d2MCoefficients
 
struct  d2MImpl
 
struct  EigenMatrixImp
 
struct  Fdd4MImpl
 
struct  FirstMatrixDirectiveImpl
 
struct  GetDiffDiffMatImpl
 
struct  GetDiffDiffMatImpl< E, C, T1, FTensor::Tensor2_symmetric< VT2, DimT2 > >
 
struct  GetDiffMatImpl
 
struct  GetMatImpl
 
struct  ReconstructMatImpl
 
struct  SecondMatrixDirectiveImpl
 

Typedefs

template<typename T , int Dim>
using Val = const FTensor::Tensor1< T, Dim >
 
template<typename T , int Dim>
using Vec = const FTensor::Tensor2< T, Dim, Dim >
 
template<typename T >
using Fun = boost::function< T(const T)>
 
template<int N>
using Number = FTensor::Number< N >
 

Functions

template<typename T , int Dim>
FTensor::Tensor2_symmetric< double, Dim > getMatImpl (Val< T, Dim > &t_val, Vec< T, Dim > &t_vec, Fun< double > f)
 
template<typename T , int Dim>
FTensor::Ddg< double, Dim, Dim > getDiffMatImpl (Val< T, Dim > &t_val, Vec< T, Dim > &t_vec, Fun< double > f, Fun< double > d_f, const int nb)
 
template<typename T , typename S , int Dim>
FTensor::Ddg< double, Dim, Dim > getDiffDiffMatImpl (Val< T, Dim > &t_val, Vec< T, Dim > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, S &t_S, const int nb)
 
FTensor::Tensor2_symmetric< double, 3 > getMat (Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f)
 Get the Mat object. More...
 
FTensor::Tensor2_symmetric< double, 3 > getMat (Val< FTensor::PackPtr< double *, 1 >, 3 > &t_val, Vec< FTensor::PackPtr< double *, 1 >, 3 > &t_vec, Fun< double > f)
 Get the Mat object. More...
 
FTensor::Ddg< double, 3, 3 > getDiffMat (Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, const int nb)
 Get the Diff Mat object. More...
 
FTensor::Ddg< double, 3, 3 > getDiffMat (Val< FTensor::PackPtr< double *, 1 >, 3 > &t_val, Vec< FTensor::PackPtr< double *, 1 >, 3 > &t_vec, Fun< double > f, Fun< double > d_f, const int nb)
 Get the Diff Mat object. More...
 
FTensor::Ddg< double, 3, 3 > getDiffDiffMat (Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2< double, 3, 3 > &t_S, const int nb)
 
FTensor::Ddg< double, 3, 3 > getDiffDiffMat (Val< FTensor::PackPtr< double *, 1 >, 3 > &t_val, Vec< FTensor::PackPtr< double *, 1 >, 3 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2< double, 3, 3 > &t_S, const int nb)
 Get the Diff Mat object. More...
 
FTensor::Ddg< double, 3, 3 > getDiffDiffMat (Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2_symmetric< double, 3 > &t_S, const int nb)
 Get the Diff Diff Mat object. More...
 
FTensor::Tensor2_symmetric< double, 2 > getMat (Val< double, 2 > &t_val, Vec< double, 2 > &t_vec, Fun< double > f)
 Get the Mat object. More...
 
FTensor::Ddg< double, 2, 2 > getDiffMat (Val< double, 2 > &t_val, Vec< double, 2 > &t_vec, Fun< double > f, Fun< double > d_f, const int nb)
 Get the Diff Mat object. More...
 
FTensor::Ddg< double, 2, 2 > getDiffDiffMat (Val< double, 2 > &t_val, Vec< double, 2 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2< double, 2, 2 > &t_S, const int nb)
 
FTensor::Ddg< double, 2, 2 > getDiffDiffMat (Val< double, 2 > &t_val, Vec< double, 2 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2_symmetric< double, 2 > &t_S, const int nb)
 
template<int N1, int N2, int Dim>
auto get_sym_index (const Number< N1 > &, const Number< N2 > &, const Number< Dim > &)
 
auto get_sym_index (const int N1, const int N2, const int Dim)
 
template<int N1, int N2, int Dim>
auto get_nodiag_index (const Number< N1 > &, const Number< N2 > &, const Number< Dim > &)
 
auto get_nodiag_index (const int N1, const int N2, int Dim)
 

Typedef Documentation

◆ Fun

template<typename T >
using EigenMatrix::Fun = typedef boost::function<T(const T)>

Definition at line 79 of file MatrixFunction.hpp.

◆ Number

template<int N>
using EigenMatrix::Number = typedef FTensor::Number<N>

Definition at line 67 of file MatrixFunctionTemplate.hpp.

◆ Val

template<typename T , int Dim>
using EigenMatrix::Val = typedef const FTensor::Tensor1<T, Dim>

Definition at line 77 of file MatrixFunction.hpp.

◆ Vec

template<typename T , int Dim>
using EigenMatrix::Vec = typedef const FTensor::Tensor2<T, Dim, Dim>

Function Documentation

◆ get_nodiag_index() [1/2]

auto EigenMatrix::get_nodiag_index ( const int  N1,
const int  N2,
int  Dim 
)

Definition at line 95 of file MatrixFunctionTemplate.hpp.

95 {
96 if (N2 > N1)
97 return (Dim - 1) * N1 + N2 - 1;
98 else
99 return (Dim - 1) * N1 + N2;
100}
static Number< 2 > N2
static Number< 1 > N1

◆ get_nodiag_index() [2/2]

template<int N1, int N2, int Dim>
auto EigenMatrix::get_nodiag_index ( const Number< N1 > &  ,
const Number< N2 > &  ,
const Number< Dim > &   
)

Definition at line 86 of file MatrixFunctionTemplate.hpp.

87 {
88 static_assert(N1 != N2, "Bad index");
89 if constexpr (N2 > N1)
90 return (Dim - 1) * N1 + N2 - 1;
91 else
92 return (Dim - 1) * N1 + N2;
93}

◆ get_sym_index() [1/2]

auto EigenMatrix::get_sym_index ( const int  N1,
const int  N2,
const int  Dim 
)

Definition at line 78 of file MatrixFunctionTemplate.hpp.

78 {
79 if (N1 > N2)
80 return N1 + (N2 * (2 * Dim - N2 - 1)) / 2;
81 else
82 return N2 + (N1 * (2 * Dim - N1 - 1)) / 2;
83}

◆ get_sym_index() [2/2]

template<int N1, int N2, int Dim>
auto EigenMatrix::get_sym_index ( const Number< N1 > &  ,
const Number< N2 > &  ,
const Number< Dim > &   
)

Definition at line 70 of file MatrixFunctionTemplate.hpp.

71 {
72 if constexpr (N1 > N2)
73 return N1 + (N2 * (2 * Dim - N2 - 1)) / 2;
74 else
75 return N2 + (N1 * (2 * Dim - N1 - 1)) / 2;
76}

◆ getDiffDiffMat() [1/5]

FTensor::Ddg< double, 2, 2 > EigenMatrix::getDiffDiffMat ( Val< double, 2 > &  t_val,
Vec< double, 2 > &  t_vec,
Fun< double f,
Fun< double d_f,
Fun< double dd_f,
FTensor::Tensor2< double, 2, 2 > &  t_S,
const int  nb 
)

Definition at line 117 of file MatrixFunction.cpp.

121 {
122 return getDiffDiffMatImpl<double, FTensor::Tensor2<double, 2, 2>, 2>(
123 t_val, t_vec, f, d_f, dd_f, t_S, nb);
124}
auto dd_f
Definition: HenckyOps.hpp:21
auto d_f
Definition: HenckyOps.hpp:20

◆ getDiffDiffMat() [2/5]

FTensor::Ddg< double, 2, 2 > EigenMatrix::getDiffDiffMat ( Val< double, 2 > &  t_val,
Vec< double, 2 > &  t_vec,
Fun< double f,
Fun< double d_f,
Fun< double dd_f,
FTensor::Tensor2_symmetric< double, 2 > &  t_S,
const int  nb 
)

Definition at line 127 of file MatrixFunction.cpp.

129 {
130 return getDiffDiffMatImpl<double, FTensor::Tensor2_symmetric<double, 2>, 2>(
131 t_val, t_vec, f, d_f, dd_f, t_S, nb);
132}

◆ getDiffDiffMat() [3/5]

FTensor::Ddg< double, 3, 3 > EigenMatrix::getDiffDiffMat ( Val< double, 3 > &  t_val,
Vec< double, 3 > &  t_vec,
Fun< double f,
Fun< double d_f,
Fun< double dd_f,
FTensor::Tensor2< double, 3, 3 > &  t_S,
const int  nb 
)

Examples
EshelbianOperators.cpp, and matrix_function.cpp.

Definition at line 78 of file MatrixFunction.cpp.

82 {
83 return getDiffDiffMatImpl<double, FTensor::Tensor2<double, 3, 3>, 3>(
84 t_val, t_vec, f, d_f, dd_f, t_S, nb);
85}

◆ getDiffDiffMat() [4/5]

FTensor::Ddg< double, 3, 3 > EigenMatrix::getDiffDiffMat ( Val< double, 3 > &  t_val,
Vec< double, 3 > &  t_vec,
Fun< double f,
Fun< double d_f,
Fun< double dd_f,
FTensor::Tensor2_symmetric< double, 3 > &  t_S,
const int  nb 
)

Get the Diff Diff Mat object.

\[ LS_{klmn} = S_{ij} \frac{\partial^2 B_{ij}}{\partial A_{kl} \partial A_{mn} } \]

Note
Eiegn vetore are in rows.
Parameters
t_valeiegn values
t_veceigen vectors
ffunction
d_fdirective of function
dd_fsecond directive of function
t_SS tensor
nbnumber of nonzero eigen values
Returns
FTensor::Ddg<double, 3, 3>

Definition at line 98 of file MatrixFunction.cpp.

100 {
101 return getDiffDiffMatImpl<double, FTensor::Tensor2_symmetric<double, 3>, 3>(
102 t_val, t_vec, f, d_f, dd_f, t_S, nb);
103}

◆ getDiffDiffMat() [5/5]

FTensor::Ddg< double, 3, 3 > EigenMatrix::getDiffDiffMat ( Val< FTensor::PackPtr< double *, 1 >, 3 > &  t_val,
Vec< FTensor::PackPtr< double *, 1 >, 3 > &  t_vec,
Fun< double f,
Fun< double d_f,
Fun< double dd_f,
FTensor::Tensor2< double, 3, 3 > &  t_S,
const int  nb 
)

Get the Diff Mat object.

\[ P_{ijkl} = \frac{\partial B_{ij}}{\partial A_{kl}} \]

Note
Eiegn vetore are in rows.
Parameters
t_valeigen values
t_veceigen vector
ffunction
d_fdirective of function
nbnumber of nonequal eigen valuse
Returns
FTensor::Ddg<double, 3, 3>

Definition at line 88 of file MatrixFunction.cpp.

91 {
92 return getDiffDiffMatImpl<FTensor::PackPtr<double *, 1>,
94 t_val, t_vec, f, d_f, dd_f, t_S, nb);
95}

◆ getDiffDiffMatImpl()

template<typename T , typename S , int Dim>
FTensor::Ddg< double, Dim, Dim > EigenMatrix::getDiffDiffMatImpl ( Val< T, Dim > &  t_val,
Vec< T, Dim > &  t_vec,
Fun< double f,
Fun< double d_f,
Fun< double dd_f,
S &  t_S,
const int  nb 
)

Definition at line 35 of file MatrixFunction.cpp.

36 {
37 switch (nb) {
38 case 1:
39 return EigenMatrixImp<T, T, 1, Dim>(t_val, t_vec)
40 .getDiffDiffMat(f, d_f, dd_f, t_S);
41 case 2:
42 return EigenMatrixImp<T, T, 2, Dim>(t_val, t_vec)
43 .getDiffDiffMat(f, d_f, dd_f, t_S);
44 case 3:
45 break;
46 default:
47 THROW_MESSAGE("third parameter should be 1,2 or 3");
48 }
49 return EigenMatrixImp<T, T, 3, Dim>(t_val, t_vec)
50 .getDiffDiffMat(f, d_f, dd_f, t_S);
51};
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
auto getDiffDiffMat(Fun f, Fun d_f, Fun dd_f, T &t_S)
Get second direvarive of matrix.

◆ getDiffMat() [1/3]

FTensor::Ddg< double, 2, 2 > EigenMatrix::getDiffMat ( Val< double, 2 > &  t_val,
Vec< double, 2 > &  t_vec,
Fun< double f,
Fun< double d_f,
const int  nb 
)

Get the Diff Mat object.

\[ P_{ijkl} = \frac{\partial B_{ij}}{\partial A_{kl}} \]

Note
Eiegn vetore are in rows.
Parameters
t_valeigen values
t_veceigen vector
ffunction
d_fdirective of function
nbnumber of nonequal eigen valuse
Returns
FTensor::Ddg<double, 3, 3>

Definition at line 111 of file MatrixFunction.cpp.

113 {
114 return getDiffMatImpl<double, 2>(t_val, t_vec, f, d_f, nb);
115}

◆ getDiffMat() [2/3]

FTensor::Ddg< double, 3, 3 > EigenMatrix::getDiffMat ( Val< double, 3 > &  t_val,
Vec< double, 3 > &  t_vec,
Fun< double f,
Fun< double d_f,
const int  nb 
)

Get the Diff Mat object.

\[ P_{ijkl} = \frac{\partial B_{ij}}{\partial A_{kl}} \]

Note
Eiegn vetore are in rows.
Parameters
t_valeigen values
t_veceigen vector
ffunction
d_fdirective of function
nbnumber of nonequal eigen valuse
Returns
FTensor::Ddg<double, 3, 3>
Examples
EshelbianOperators.cpp, and matrix_function.cpp.

Definition at line 64 of file MatrixFunction.cpp.

66 {
67 return getDiffMatImpl<double, 3>(t_val, t_vec, f, d_f, nb);
68}

◆ getDiffMat() [3/3]

FTensor::Ddg< double, 3, 3 > EigenMatrix::getDiffMat ( Val< FTensor::PackPtr< double *, 1 >, 3 > &  t_val,
Vec< FTensor::PackPtr< double *, 1 >, 3 > &  t_vec,
Fun< double f,
Fun< double d_f,
const int  nb 
)

Get the Diff Mat object.

\[ P_{ijkl} = \frac{\partial B_{ij}}{\partial A_{kl}} \]

Note
Eiegn vetore are in rows.
Parameters
t_valeigen values
t_veceigen vector
ffunction
d_fdirective of function
nbnumber of nonequal eigen valuse
Returns
FTensor::Ddg<double, 3, 3>

Definition at line 71 of file MatrixFunction.cpp.

73 {
74 return getDiffMatImpl<FTensor::PackPtr<double *, 1>, 3>(t_val, t_vec, f, d_f,
75 nb);
76}

◆ getDiffMatImpl()

template<typename T , int Dim>
FTensor::Ddg< double, Dim, Dim > EigenMatrix::getDiffMatImpl ( Val< T, Dim > &  t_val,
Vec< T, Dim > &  t_vec,
Fun< double f,
Fun< double d_f,
const int  nb 
)

Definition at line 17 of file MatrixFunction.cpp.

19 {
20 switch (nb) {
21 case 1:
22 return EigenMatrixImp<T, T, 1, Dim>(t_val, t_vec).getDiffMat(f, d_f);
23 case 2:
24 return EigenMatrixImp<T, T, 2, Dim>(t_val, t_vec).getDiffMat(f, d_f);
25 case 3:
26 break;
27 default:
28 THROW_MESSAGE("third parameter should be 1,2 or 3");
29 }
30 return EigenMatrixImp<T, T, 3, Dim>(t_val, t_vec).getDiffMat(f, d_f);
31};
auto getDiffMat(Fun f, Fun d_f)
Get derivative of matrix.

◆ getMat() [1/3]

FTensor::Tensor2_symmetric< double, 2 > EigenMatrix::getMat ( Val< double, 2 > &  t_val,
Vec< double, 2 > &  t_vec,
Fun< double f 
)

Get the Mat object.

\[ \mathbf{B} = f(\mathbf{A}) \]

\[ B_{ij} = \sum_{a}^d f(\lambda^a) n^a_i n^a_j \]

where \(a\) is eigen value number.

Parameters
t_valeigen values
t_veceigen vector
ffunction
Returns
FTensor::Tensor2_symmetric<double, 3>

Definition at line 105 of file MatrixFunction.cpp.

107 {
108 return getMatImpl<double, 2>(t_val, t_vec, f);
109}

◆ getMat() [2/3]

FTensor::Tensor2_symmetric< double, 3 > EigenMatrix::getMat ( Val< double, 3 > &  t_val,
Vec< double, 3 > &  t_vec,
Fun< double f 
)

Get the Mat object.

\[ \mathbf{B} = f(\mathbf{A}) \]

\[ B_{ij} = \sum_{a}^d f(\lambda^a) n^a_i n^a_j \]

where \(a\) is eigen value number.

Parameters
t_valeigen values
t_veceigen vector
ffunction
Returns
FTensor::Tensor2_symmetric<double, 3>
Examples
EshelbianOperators.cpp, and matrix_function.cpp.

Definition at line 53 of file MatrixFunction.cpp.

54 {
55 return getMatImpl<double, 3>(t_val, t_vec, f);
56}

◆ getMat() [3/3]

FTensor::Tensor2_symmetric< double, 3 > EigenMatrix::getMat ( Val< FTensor::PackPtr< double *, 1 >, 3 > &  t_val,
Vec< FTensor::PackPtr< double *, 1 >, 3 > &  t_vec,
Fun< double f 
)

Get the Mat object.

\[ \mathbf{B} = f(\mathbf{A}) \]

\[ B_{ij} = \sum_{a}^d f(\lambda^a) n^a_i n^a_j \]

where \(a\) is eigen value number.

Parameters
t_valeigen values
t_veceigen vector
ffunction
Returns
FTensor::Tensor2_symmetric<double, 3>

Definition at line 59 of file MatrixFunction.cpp.

60 {
61 return getMatImpl<FTensor::PackPtr<double *, 1>, 3>(t_val, t_vec, f);
62}

◆ getMatImpl()

template<typename T , int Dim>
FTensor::Tensor2_symmetric< double, Dim > EigenMatrix::getMatImpl ( Val< T, Dim > &  t_val,
Vec< T, Dim > &  t_vec,
Fun< double f 
)

Definition at line 12 of file MatrixFunction.cpp.

12 {
13 return EigenMatrixImp<T, T, 3, Dim>(t_val, t_vec).getMat(f);
14}