/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
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 // ----------------------------------------------------
29 // Setting scale k
30 // ----------------------------------------------------
31
32 template <typename T>
33 concept has_set_k = requires(T t, double k) { t.set_k(k); };
34
35 template <typename Int>
37 void invoke_set_k(Int &integrator, const double k)
38 {
39 integrator.set_k(k);
40 }
41 template <typename Int>
42 requires(!DiFfRG::has_set_k<Int>)
43 void invoke_set_k(Int &, const double)
44 {
45 // do nothing
46 }
47 template <typename Int>
49 void all_set_k(Int &integrator, const double k)
50 {
51 invoke_set_k(integrator.integrator, k);
52 invoke_set_k(integrator.integrator_AD, k);
53 }
54 template <typename Int>
56 void all_set_k(Int &integrator, const double k)
57 {
58 invoke_set_k(integrator.integrator, k);
59 }
60
61 // ----------------------------------------------------
62 // Setting temperature T
63 // ----------------------------------------------------
64
65 template <typename T>
66 concept has_set_T = requires(T t, double mT) { t.set_T(mT); };
67
68 template <typename Int>
70 void invoke_set_T(Int &integrator, const double T)
71 {
72 integrator.set_T(T);
73 }
74 template <typename Int>
75 requires(!DiFfRG::has_set_T<Int>)
76 void invoke_set_T(Int &, const double)
77 {
78 // do nothing
79 }
80 template <typename Int>
82 void all_set_T(Int &integrator, const double T)
83 {
84 invoke_set_T(integrator.integrator, T);
85 invoke_set_T(integrator.integrator_AD, T);
86 }
87 template <typename Int>
89 void all_set_T(Int &integrator, const double T)
90 {
91 invoke_set_T(integrator.integrator, T);
92 }
93
94 // ----------------------------------------------------
95 // Setting the typical energy scale
96 // ----------------------------------------------------
97
98 template <typename T>
99 concept has_set_typical_E = requires(T t, double typical_E) { t.set_typical_E(typical_E); };
100
101 template <typename Int>
103 void invoke_set_typical_E(Int &integrator, const double typical_E)
104 {
105 integrator.set_typical_E(typical_E);
106 }
107 template <typename Int>
109 void invoke_set_typical_E(Int &, const double)
110 {
111 // do nothing
112 }
113 template <typename Int>
115 void all_set_typical_E(Int &integrator, const double typical_E)
116 {
117 invoke_set_typical_E(integrator.integrator, typical_E);
118 invoke_set_typical_E(integrator.integrator_AD, typical_E);
119 }
120 template <typename Int>
122 void all_set_typical_E(Int &integrator, const double typical_E)
123 {
124 invoke_set_typical_E(integrator.integrator, typical_E);
125 }
126
127 // ----------------------------------------------------
128 // Setting the x-extent
129 // ----------------------------------------------------
130
131 template <typename T>
132 concept has_set_x_extent = requires(T t, double x_extent) { t.set_x_extent(x_extent); };
133
134 template <typename Int>
136 void invoke_set_x_extent(Int &integrator, const double x_extent)
137 {
138 integrator.set_x_extent(x_extent);
139 }
140 template <typename Int>
142 void invoke_set_x_extent(Int &, const double)
143 {
144 // do nothing
145 }
146 template <typename Int>
148 void all_set_x_extent(Int &integrator, const double x_extent)
149 {
150 invoke_set_x_extent(integrator.integrator, x_extent);
151 invoke_set_x_extent(integrator.integrator_AD, x_extent);
152 }
153 template <typename Int>
155 void all_set_x_extent(Int &integrator, const double x_extent)
156 {
157 invoke_set_x_extent(integrator.integrator, x_extent);
158 }
159} // namespace DiFfRG
Definition integration.hh:26
Definition integration.hh:66
Definition integration.hh:33
Definition integration.hh:99
Definition integration.hh:132
Definition complex_math.hh:10
void all_set_typical_E(Int &integrator, const double typical_E)
Definition integration.hh:115
void invoke_set_k(Int &integrator, const double k)
Definition integration.hh:37
void all_set_k(Int &integrator, const double k)
Definition integration.hh:49
void invoke_set_T(Int &integrator, const double T)
Definition integration.hh:70
void invoke_set_typical_E(Int &integrator, const double typical_E)
Definition integration.hh:103
void invoke_set_x_extent(Int &integrator, const double x_extent)
Definition integration.hh:136
void all_set_x_extent(Int &integrator, const double x_extent)
Definition integration.hh:148
void all_set_T(Int &integrator, const double T)
Definition integration.hh:82