/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration.hh Source File#

DiFfRG: /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration.hh Source File
DiFfRG
Discretization Framework for functional Renormalization Group flows
integration.hh
Go to the documentation of this file.
1#pragma once
2
4
7
12
17
22
23namespace DiFfRG
24{
25 template <typename T>
26 concept has_integrator_AD = requires(T t) { t.integrator_AD; };
27
28 template <typename T>
29 concept has_integrator_AD2 = requires(T t) { t.integrator_AD2; };
30
31 // ----------------------------------------------------
32 // Setting scale k
33 // ----------------------------------------------------
34
35 template <typename T>
36 concept has_set_k = requires(T t, double k) { t.set_k(k); };
37
38 template <typename Int>
40 void invoke_set_k(Int &integrator, const double k)
41 {
42 integrator.set_k(k);
43 }
44 template <typename Int>
45 requires(!DiFfRG::has_set_k<Int>)
46 void invoke_set_k(Int &, const double)
47 {
48 // do nothing
49 }
50 template <typename Int> void all_set_k(Int &integrator, const double k)
51 {
52 invoke_set_k(integrator.integrator, k);
53 if constexpr (DiFfRG::has_integrator_AD<Int>) invoke_set_k(integrator.integrator_AD, k);
54 if constexpr (DiFfRG::has_integrator_AD2<Int>) invoke_set_k(integrator.integrator_AD2, k);
55 }
56
57 // ----------------------------------------------------
58 // Setting temperature T
59 // ----------------------------------------------------
60
61 template <typename T>
62 concept has_set_T = requires(T t, double mT) { t.set_T(mT); };
63
64 template <typename Int>
66 void invoke_set_T(Int &integrator, const double T)
67 {
68 integrator.set_T(T);
69 }
70 template <typename Int>
71 requires(!DiFfRG::has_set_T<Int>)
72 void invoke_set_T(Int &, const double)
73 {
74 // do nothing
75 }
76 template <typename Int> void all_set_T(Int &integrator, const double T)
77 {
78 invoke_set_T(integrator.integrator, T);
79 if constexpr (DiFfRG::has_integrator_AD<Int>) invoke_set_T(integrator.integrator_AD, T);
80 if constexpr (DiFfRG::has_integrator_AD2<Int>) invoke_set_T(integrator.integrator_AD2, T);
81 }
82
83 // ----------------------------------------------------
84 // Setting the typical energy scale
85 // ----------------------------------------------------
86
87 template <typename T>
88 concept has_set_typical_E = requires(T t, double typical_E) { t.set_typical_E(typical_E); };
89
90 template <typename Int>
92 void invoke_set_typical_E(Int &integrator, const double typical_E)
93 {
94 integrator.set_typical_E(typical_E);
95 }
96 template <typename Int>
98 void invoke_set_typical_E(Int &, const double)
99 {
100 // do nothing
101 }
102 template <typename Int> void all_set_typical_E(Int &integrator, const double typical_E)
103 {
104 invoke_set_typical_E(integrator.integrator, typical_E);
105 if constexpr (DiFfRG::has_integrator_AD<Int>) invoke_set_typical_E(integrator.integrator_AD, typical_E);
106 if constexpr (DiFfRG::has_integrator_AD2<Int>) invoke_set_typical_E(integrator.integrator_AD2, typical_E);
107 }
108
109 // ----------------------------------------------------
110 // Setting the x-extent
111 // ----------------------------------------------------
112
113 template <typename T>
114 concept has_set_x_extent = requires(T t, double x_extent) { t.set_x_extent(x_extent); };
115
116 template <typename Int>
118 void invoke_set_x_extent(Int &integrator, const double x_extent)
119 {
120 integrator.set_x_extent(x_extent);
121 }
122 template <typename Int>
124 void invoke_set_x_extent(Int &, const double)
125 {
126 // do nothing
127 }
128 template <typename Int> void all_set_x_extent(Int &integrator, const double x_extent)
129 {
130 invoke_set_x_extent(integrator.integrator, x_extent);
131 if constexpr (DiFfRG::has_integrator_AD<Int>) invoke_set_x_extent(integrator.integrator_AD, x_extent);
132 if constexpr (DiFfRG::has_integrator_AD2<Int>) invoke_set_x_extent(integrator.integrator_AD2, x_extent);
133 }
134} // namespace DiFfRG
Definition integration.hh:29
Definition integration.hh:26
Definition integration.hh:62
Definition integration.hh:36
Definition integration.hh:88
Definition integration.hh:114
Definition complex_math.hh:10
void all_set_T(Int &integrator, const double T)
Definition integration.hh:76
void all_set_typical_E(Int &integrator, const double typical_E)
Definition integration.hh:102
void invoke_set_k(Int &integrator, const double k)
Definition integration.hh:40
void all_set_k(Int &integrator, const double k)
Definition integration.hh:50
void invoke_set_T(Int &integrator, const double T)
Definition integration.hh:66
void invoke_set_typical_E(Int &integrator, const double typical_E)
Definition integration.hh:92
void invoke_set_x_extent(Int &integrator, const double x_extent)
Definition integration.hh:118
void all_set_x_extent(Int &integrator, const double x_extent)
Definition integration.hh:128