v0.14.0
Loading...
Searching...
No Matches
Ddg_Expr.hpp
Go to the documentation of this file.
1/* Declares a wrapper class for rank 4 Tensor expressions symmetric on
2 the first two and last two indices. */
3
4#pragma once
5
6#include "Ddg_and_Ddg.hpp"
8#include "Ddg_carat_Ddg.hpp"
10#include "Ddg_minus_Ddg.hpp"
12#include "Ddg_or_Ddg.hpp"
13#include "Ddg_plus_Ddg.hpp"
14#include "Ddg_times_Ddg.hpp"
15#include "Ddg_times_Tensor1.hpp"
16#include "Ddg_times_Tensor2.hpp"
17#include "Ddg_times_Tensor4.hpp"
18#include "Ddg_times_Dg.hpp"
20#include "Ddg_times_generic.hpp"
21#include "minus_Ddg.hpp"
22// #include "Ddg_mod_Ddg.hpp"
23
24namespace FTensor
25{
26 template <class A, class T, int Dim01, int Dim23, char i, char j, char k,
27 char l>
29 {
31
32 public:
33 Ddg_Expr(const A &a) : iter(a) {}
34 T operator()(const int N1, const int N2, const int N3, const int N4) const
35 {
36 return iter(N1, N2, N3, N4);
37 }
38 };
39
40 template <class A, class T, int Tensor_Dim01, int Tensor_Dim23, int Dim01,
41 int Dim23, char i, char j, char k, char l>
42 class Ddg_Expr<Ddg<A, Tensor_Dim01, Tensor_Dim23>, T, Dim01, Dim23, i, j, k,
43 l>
44 {
46
47 public:
49 T operator()(const int N1, const int N2, const int N3, const int N4) const
50 {
51 return iter(N1, N2, N3, N4);
52 }
53
54 /* Various assignment operators. I have to explicitly declare the
55 second operator= because otherwise the compiler will generate its
56 own and not use the template code. */
57
58 template <class B, class U>
60 operator=(const Ddg_Expr<B, U, Dim01, Dim23, i, j, k, l> &result);
61
63 operator=(const Ddg_Expr<Ddg<A, Tensor_Dim01, Tensor_Dim23>, T, Dim01,
64 Dim23, i, j, k, l> &result);
65
66 template <class B, class U>
68 operator+=(const Ddg_Expr<B, U, Dim01, Dim23, i, j, k, l> &result);
69
71 operator+=(const Ddg_Expr<Ddg<A, Tensor_Dim01, Tensor_Dim23>, T, Dim01,
72 Dim23, i, j, k, l> &result);
73
74 template <class B, class U>
76 operator-=(const Ddg_Expr<B, U, Dim01, Dim23, i, j, k, l> &result);
77
79 operator-=(const Ddg_Expr<Ddg<A, Tensor_Dim01, Tensor_Dim23>, T, Dim01,
80 Dim23, i, j, k, l> &result);
81
82 template <class U>
84 operator*=(const U &d);
85
86 template <class U>
88 operator=(const U &d);
89 };
90}
91
92#include "Ddg_Expr_equals.hpp"
static Number< 2 > N2
static Number< 1 > N1
Ddg times Dg.
constexpr double a
T operator()(const int N1, const int N2, const int N3, const int N4) const
Definition Ddg_Expr.hpp:49
Ddg_Expr(const A &a)
Definition Ddg_Expr.hpp:33
T operator()(const int N1, const int N2, const int N3, const int N4) const
Definition Ddg_Expr.hpp:34
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const double T
Tensors class implemented by Walter Landry.
Definition FTensor.hpp:51
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition dTensor0.hpp:27
constexpr AssemblyType A