v0.14.0
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)
 
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::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_symmetric< double, 3 > &t_S, const int nb)
 
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 67 of file MatrixFunction.hpp.

◆ Number

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

Definition at line 55 of file MatrixFunctionTemplate.hpp.

◆ Val

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

Definition at line 65 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 
)
inline

Definition at line 83 of file MatrixFunctionTemplate.hpp.

83  {
84  if (N2 > N1)
85  return (Dim - 1) * N1 + N2 - 1;
86  else
87  return (Dim - 1) * N1 + N2;
88 }

◆ 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 > &   
)
inline

Definition at line 74 of file MatrixFunctionTemplate.hpp.

75  {
76  static_assert(N1 != N2, "Bad index");
77  if constexpr (N2 > N1)
78  return (Dim - 1) * N1 + N2 - 1;
79  else
80  return (Dim - 1) * N1 + N2;
81 }

◆ get_sym_index() [1/2]

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

Definition at line 66 of file MatrixFunctionTemplate.hpp.

66  {
67  if (N1 > N2)
68  return N1 + (N2 * (2 * Dim - N2 - 1)) / 2;
69  else
70  return N2 + (N1 * (2 * Dim - N1 - 1)) / 2;
71 }

◆ 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 > &   
)
inline

Definition at line 58 of file MatrixFunctionTemplate.hpp.

59  {
60  if constexpr (N1 > N2)
61  return N1 + (N2 * (2 * Dim - N2 - 1)) / 2;
62  else
63  return N2 + (N1 * (2 * Dim - N1 - 1)) / 2;
64 }

◆ getDiffDiffMat() [1/6]

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 127 of file MatrixFunction.cpp.

131  {
132  return getDiffDiffMatImpl<double, FTensor::Tensor2<double, 2, 2>, 2>(
133  t_val, t_vec, f, d_f, dd_f, t_S, nb);
134 }

◆ getDiffDiffMat() [2/6]

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 137 of file MatrixFunction.cpp.

139  {
140  return getDiffDiffMatImpl<double, FTensor::Tensor2_symmetric<double, 2>, 2>(
141  t_val, t_vec, f, d_f, dd_f, t_S, nb);
142 }

◆ getDiffDiffMat() [3/6]

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/6]

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
Eigen vector are in rows.
Parameters
t_valeigen 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/6]

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 
)

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 }

◆ getDiffDiffMat() [6/6]

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_symmetric< double, 3 > &  t_S,
const int  nb 
)

Definition at line 106 of file MatrixFunction.cpp.

109  {
110  return getDiffDiffMatImpl<FTensor::PackPtr<double *, 1>,
112  t_val, t_vec, f, d_f, dd_f, t_S, nb);
113 }

◆ 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 };

◆ 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 121 of file MatrixFunction.cpp.

123  {
124  return getDiffMatImpl<double, 2>(t_val, t_vec, f, d_f, nb);
125 }

◆ 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 };

◆ 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 115 of file MatrixFunction.cpp.

117  {
118  return getMatImpl<double, 2>(t_val, t_vec, f);
119 }

◆ 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 }
HenckyOps::d_f
auto d_f
Definition: HenckyOps.hpp:16
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
FTensor::Tensor2< double, 3, 3 >
HenckyOps::dd_f
auto dd_f
Definition: HenckyOps.hpp:17
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15