v0.14.0
Public Types | Public Member Functions | Public Attributes | List of all members
EigenMatrix::Fdd4MImpl< E, C > Struct Template Reference

#include <src/ftensor/src/MatrixFunctionTemplate.hpp>

Collaboration diagram for EigenMatrix::Fdd4MImpl< E, C >:
[legend]

Public Types

using Val = typename E::Val
 
using Vec = typename E::Vec
 
using Fun = typename E::Fun
 
using NumberNb = typename E::NumberNb
 
using NumberDim = typename E::NumberDim
 

Public Member Functions

 Fdd4MImpl (E &e)
 
template<int A, int a, int b, int I, int J, int K, int L>
auto fd2M () const
 
template<int a, int b, int i, int j, int k, int l, int m, int n>
auto term_fd2S (const Number< a > &, const Number< b > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 
template<int NB, int a, int b, int i, int j, int k, int l, int m, int n>
term_SM (const Number< a > &, const Number< b > &, const Number< NB > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 
template<int nb, int a, int i, int j, int k, int l, int m, int n>
eval_fdS2 (const Number< nb > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 
template<int a, int i, int j, int k, int l, int m, int n>
eval_fdS2 (const Number< 1 > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 
template<int nb, int a, int i, int j, int k, int l, int m, int n>
eval_SM (const Number< nb > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 
template<int a, int i, int j, int k, int l, int m, int n>
eval_SM (const Number< 1 > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 
template<int nb, int a, int i, int j, int k, int l, int m, int n>
eval (const Number< nb > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
 

Public Attributes

Ee
 

Detailed Description

template<typename E, typename C>
struct EigenMatrix::Fdd4MImpl< E, C >

Definition at line 165 of file MatrixFunctionTemplate.hpp.

Member Typedef Documentation

◆ Fun

template<typename E , typename C >
using EigenMatrix::Fdd4MImpl< E, C >::Fun = typename E::Fun

Definition at line 168 of file MatrixFunctionTemplate.hpp.

◆ NumberDim

template<typename E , typename C >
using EigenMatrix::Fdd4MImpl< E, C >::NumberDim = typename E::NumberDim

Definition at line 174 of file MatrixFunctionTemplate.hpp.

◆ NumberNb

template<typename E , typename C >
using EigenMatrix::Fdd4MImpl< E, C >::NumberNb = typename E::NumberNb

Definition at line 173 of file MatrixFunctionTemplate.hpp.

◆ Val

template<typename E , typename C >
using EigenMatrix::Fdd4MImpl< E, C >::Val = typename E::Val

Definition at line 166 of file MatrixFunctionTemplate.hpp.

◆ Vec

template<typename E , typename C >
using EigenMatrix::Fdd4MImpl< E, C >::Vec = typename E::Vec

Definition at line 167 of file MatrixFunctionTemplate.hpp.

Constructor & Destructor Documentation

◆ Fdd4MImpl()

template<typename E , typename C >
EigenMatrix::Fdd4MImpl< E, C >::Fdd4MImpl ( E e)
inline

Definition at line 170 of file MatrixFunctionTemplate.hpp.

170 : e(e) {}

Member Function Documentation

◆ eval()

template<typename E , typename C >
template<int nb, int a, int i, int j, int k, int l, int m, int n>
C EigenMatrix::Fdd4MImpl< E, C >::eval ( const Number< nb > &  ,
const Number< a > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 340 of file MatrixFunctionTemplate.hpp.

342  {
343  return
344 
345  (2 * e.fVal(a)) * eval_SM(NumberDim(), Number<a>(), Number<i>(),
346  Number<j>(), Number<k>(), Number<l>(),
347  Number<m>(), Number<n>())
348 
349  +
350 
351  eval_fdS2(NumberDim(), Number<a>(), Number<i>(), Number<j>(),
352  Number<k>(), Number<l>(), Number<m>(), Number<n>());
353  }

◆ eval_fdS2() [1/2]

template<typename E , typename C >
template<int a, int i, int j, int k, int l, int m, int n>
C EigenMatrix::Fdd4MImpl< E, C >::eval_fdS2 ( const Number< 1 > &  ,
const Number< a > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 301 of file MatrixFunctionTemplate.hpp.

303  {
304  if constexpr (a != 0)
305  return term_fd2S(Number<a>(), Number<0>(), Number<i>(), Number<j>(),
306  Number<k>(), Number<l>(), Number<m>(), Number<n>());
307  else
308  return 0;
309  }

◆ eval_fdS2() [2/2]

template<typename E , typename C >
template<int nb, int a, int i, int j, int k, int l, int m, int n>
C EigenMatrix::Fdd4MImpl< E, C >::eval_fdS2 ( const Number< nb > &  ,
const Number< a > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 287 of file MatrixFunctionTemplate.hpp.

289  {
290  if constexpr (a != nb - 1)
291  return term_fd2S(Number<a>(), Number<nb - 1>(), Number<i>(), Number<j>(),
292  Number<k>(), Number<l>(), Number<m>(), Number<n>()) +
293  eval_fdS2(Number<nb - 1>(), Number<a>(), Number<i>(), Number<j>(),
294  Number<k>(), Number<l>(), Number<m>(), Number<n>());
295  else
296  return eval_fdS2(Number<nb - 1>(), Number<a>(), Number<i>(), Number<j>(),
297  Number<k>(), Number<l>(), Number<m>(), Number<n>());
298  }

◆ eval_SM() [1/2]

template<typename E , typename C >
template<int a, int i, int j, int k, int l, int m, int n>
C EigenMatrix::Fdd4MImpl< E, C >::eval_SM ( const Number< 1 > &  ,
const Number< a > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 328 of file MatrixFunctionTemplate.hpp.

330  {
331  if constexpr (a != 0)
332  return term_SM(Number<a>(), Number<0>(), NumberNb(), Number<i>(),
333  Number<j>(), Number<k>(), Number<l>(), Number<m>(),
334  Number<n>());
335  else
336  return 0;
337  }

◆ eval_SM() [2/2]

template<typename E , typename C >
template<int nb, int a, int i, int j, int k, int l, int m, int n>
C EigenMatrix::Fdd4MImpl< E, C >::eval_SM ( const Number< nb > &  ,
const Number< a > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 312 of file MatrixFunctionTemplate.hpp.

314  {
315  if constexpr (a != nb - 1)
316  return term_SM(Number<a>(), Number<nb - 1>(), NumberNb(), Number<i>(),
317  Number<j>(), Number<k>(), Number<l>(), Number<m>(),
318  Number<n>()) +
319  eval_SM(Number<nb - 1>(), Number<a>(), Number<i>(), Number<j>(),
320  Number<k>(), Number<l>(), Number<m>(), Number<n>());
321 
322  else
323  return eval_SM(Number<nb - 1>(), Number<a>(), Number<i>(), Number<j>(),
324  Number<k>(), Number<l>(), Number<m>(), Number<n>());
325  }

◆ fd2M()

template<typename E , typename C >
template<int A, int a, int b, int I, int J, int K, int L>
auto EigenMatrix::Fdd4MImpl< E, C >::fd2M ( ) const
inline

Definition at line 178 of file MatrixFunctionTemplate.hpp.

178  {
179  return e.d2MType1[b][get_sym_index(Number<A>(), Number<a>(), NumberDim())](
180  Number<I>(), Number<J>(), Number<K>(), Number<L>());
181  }

◆ term_fd2S()

template<typename E , typename C >
template<int a, int b, int i, int j, int k, int l, int m, int n>
auto EigenMatrix::Fdd4MImpl< E, C >::term_fd2S ( const Number< a > &  ,
const Number< b > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 184 of file MatrixFunctionTemplate.hpp.

186  {
187  if constexpr (i == j && k == l) {
188  return 4 *
189  (
190 
191  fd2M<a, a, b, i, k, m, n>() * e.aM[b](Number<j>(), Number<l>())
192 
193  +
194 
195  fd2M<b, a, b, i, k, m, n>() * e.aM[a](Number<j>(), Number<l>())
196 
197  );
198 
199  } else if constexpr (i == j)
200  return 2 *
201  (
202 
203  fd2M<a, a, b, i, k, m, n>() *
204  e.aM[b](Number<j>(), Number<l>()) +
205  fd2M<b, a, b, j, l, m, n>() * e.aM[a](Number<i>(), Number<k>())
206 
207  +
208 
209  fd2M<b, a, b, i, k, m, n>() *
210  e.aM[a](Number<j>(), Number<l>()) +
211  fd2M<a, a, b, j, l, m, n>() * e.aM[b](Number<i>(), Number<k>())
212 
213  );
214  else if constexpr (k == l)
215  return 2 *
216  (
217 
218  fd2M<a, a, b, i, k, m, n>() *
219  e.aM[b](Number<j>(), Number<l>()) +
220  fd2M<b, a, b, j, l, m, n>() *
221  e.aM[a](Number<i>(), Number<k>()) +
222 
223  +
224 
225  fd2M<b, a, b, i, k, m, n>() *
226  e.aM[a](Number<j>(), Number<l>()) +
227  fd2M<a, a, b, j, l, m, n>() * e.aM[b](Number<i>(), Number<k>())
228 
229  );
230  else
231  return fd2M<a, a, b, i, k, m, n>() * e.aM[b](Number<j>(), Number<l>()) +
232  fd2M<b, a, b, j, l, m, n>() * e.aM[a](Number<i>(), Number<k>()) +
233  fd2M<a, a, b, i, l, m, n>() * e.aM[b](Number<j>(), Number<k>()) +
234  fd2M<b, a, b, j, k, m, n>() * e.aM[a](Number<i>(), Number<l>())
235 
236  +
237 
238  fd2M<b, a, b, i, k, m, n>() * e.aM[a](Number<j>(), Number<l>()) +
239  fd2M<a, a, b, j, l, m, n>() * e.aM[b](Number<i>(), Number<k>()) +
240  fd2M<b, a, b, i, l, m, n>() * e.aM[a](Number<j>(), Number<k>()) +
241  fd2M<a, a, b, j, k, m, n>() * e.aM[b](Number<i>(), Number<l>());
242  }

◆ term_SM()

template<typename E , typename C >
template<int NB, int a, int b, int i, int j, int k, int l, int m, int n>
C EigenMatrix::Fdd4MImpl< E, C >::term_SM ( const Number< a > &  ,
const Number< b > &  ,
const Number< NB > &  ,
const Number< i > &  ,
const Number< j > &  ,
const Number< k > &  ,
const Number< l > &  ,
const Number< m > &  ,
const Number< n > &   
) const
inline

Definition at line 245 of file MatrixFunctionTemplate.hpp.

248  {
249 
250  if constexpr (NB == 1) {
251  return 0;
252 
253  } else if constexpr (NB == 2) {
254 
255  if constexpr (a == 1 || b == 1) {
256  return
257 
258  e.aF2(Number<a>(), Number<b>()) *
259  (e.aSM[get_nodiag_index(Number<b>(), Number<a>(), NumberDim())]
260  [get_sym_index(Number<m>(), Number<n>(), NumberDim())](
261  Number<i>(), Number<j>(), Number<k>(), Number<l>()) -
262  e.aSM[get_nodiag_index(Number<a>(), Number<b>(), NumberDim())]
263  [get_sym_index(Number<m>(), Number<n>(), NumberDim())](
264  Number<i>(), Number<j>(), Number<k>(), Number<l>()));
265 
266  } else {
267  return 0;
268  }
269 
270  } else {
271 
272  return
273 
274  e.aF2(Number<a>(), Number<b>()) *
275  (e.aSM[get_nodiag_index(Number<b>(), Number<a>(), NumberDim())]
276  [get_sym_index(Number<m>(), Number<n>(), NumberDim())](
277  Number<i>(), Number<j>(), Number<k>(), Number<l>()) -
278  e.aSM[get_nodiag_index(Number<a>(), Number<b>(), NumberDim())]
279  [get_sym_index(Number<m>(), Number<n>(), NumberDim())](
280  Number<i>(), Number<j>(), Number<k>(), Number<l>()));
281  }
282 
283  return 0;
284  }

Member Data Documentation

◆ e

template<typename E , typename C >
E& EigenMatrix::Fdd4MImpl< E, C >::e

Definition at line 171 of file MatrixFunctionTemplate.hpp.


The documentation for this struct was generated from the following file:
EigenMatrix::Fdd4MImpl::eval_SM
C eval_SM(const Number< nb > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
Definition: MatrixFunctionTemplate.hpp:312
EigenMatrix::get_sym_index
auto get_sym_index(const Number< N1 > &, const Number< N2 > &, const Number< Dim > &)
Definition: MatrixFunctionTemplate.hpp:58
EigenMatrix::Fdd4MImpl::NumberNb
typename E::NumberNb NumberNb
Definition: MatrixFunctionTemplate.hpp:173
EigenMatrix::Fdd4MImpl::term_fd2S
auto term_fd2S(const Number< a > &, const Number< b > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
Definition: MatrixFunctionTemplate.hpp:184
EigenMatrix::Number
FTensor::Number< N > Number
Definition: MatrixFunctionTemplate.hpp:55
a
constexpr double a
Definition: approx_sphere.cpp:30
EigenMatrix::Fdd4MImpl::e
E & e
Definition: MatrixFunctionTemplate.hpp:171
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
convert.n
n
Definition: convert.py:82
EigenMatrix::Fdd4MImpl::eval_fdS2
C eval_fdS2(const Number< nb > &, const Number< a > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
Definition: MatrixFunctionTemplate.hpp:287
EigenMatrix::get_nodiag_index
auto get_nodiag_index(const Number< N1 > &, const Number< N2 > &, const Number< Dim > &)
Definition: MatrixFunctionTemplate.hpp:74
EigenMatrix::Fdd4MImpl::NumberDim
typename E::NumberDim NumberDim
Definition: MatrixFunctionTemplate.hpp:174
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
EigenMatrix::Fdd4MImpl::term_SM
C term_SM(const Number< a > &, const Number< b > &, const Number< NB > &, const Number< i > &, const Number< j > &, const Number< k > &, const Number< l > &, const Number< m > &, const Number< n > &) const
Definition: MatrixFunctionTemplate.hpp:245
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21