Grid 0.7.0
Integrator.h
Go to the documentation of this file.
1/*************************************************************************************
2
3Grid physics library, www.github.com/paboyle/Grid
4
5Source file: ./lib/qcd/hmc/integrators/Integrator.h
6
7Copyright (C) 2015
8
9Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
10Author: Peter Boyle <paboyle@ph.ed.ac.uk>
11Author: Guido Cossu <cossu@post.kek.jp>
12
13This program is free software; you can redistribute it and/or modify
14it under the terms of the GNU General Public License as published by
15the Free Software Foundation; either version 2 of the License, or
16(at your option) any later version.
17
18This program is distributed in the hope that it will be useful,
19but WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License along
24with this program; if not, write to the Free Software Foundation, Inc.,
2551 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26
27See the full license in the file "LICENSE" in the top level distribution
28directory
29*************************************************************************************/
30 /* END LEGAL */
31 //--------------------------------------------------------------------
32#ifndef INTEGRATOR_INCLUDED
33#define INTEGRATOR_INCLUDED
34
35#include <memory>
36
38
39class IntegratorParameters: Serializable {
40public:
42 std::string, name, // name of the integrator
43 unsigned int, MDsteps, // number of outer steps
44 RealD, trajL) // trajectory length
45
46 IntegratorParameters(int MDsteps_ = 10, RealD trajL_ = 1.0)
47 : MDsteps(MDsteps_),
48 trajL(trajL_) {};
49
50 template <class ReaderClass, typename std::enable_if<isReader<ReaderClass>::value, int >::type = 0 >
51 IntegratorParameters(ReaderClass & Reader)
52 {
53 std::cout << GridLogMessage << "Reading integrator\n";
54 read(Reader, "Integrator", *this);
55 }
56
57 void print_parameters() const {
58 std::cout << GridLogMessage << "[Integrator] Type : " << name << std::endl;
59 std::cout << GridLogMessage << "[Integrator] Trajectory length : " << trajL << std::endl;
60 std::cout << GridLogMessage << "[Integrator] Number of MD steps : " << MDsteps << std::endl;
61 std::cout << GridLogMessage << "[Integrator] Step size : " << trajL/MDsteps << std::endl;
62 }
63};
64
66template <class FieldImplementation_, class SmearingPolicy, class RepresentationPolicy>
68protected:
69public:
70 typedef FieldImplementation_ FieldImplementation;
71 typedef typename FieldImplementation::Field MomentaField; //for readability
72 typedef typename FieldImplementation::Field Field;
73
74 int levels; // number of integration levels
75 double t_U; // Track time passing on each level and for U and for P
76 std::vector<double> t_P;
77
79 SmearingPolicy& Smearer;
80 RepresentationPolicy Representations;
82
83 //Filters allow the user to manipulate the conjugate momentum, for example to freeze links in DDHMC
84 //It is applied whenever the momentum is updated / refreshed
85 //The default filter does nothing
87
89
91
92 //Get a pointer to a shared static instance of the "do-nothing" momentum filter to serve as a default
95 return &filter;
96 }
97
98 void update_P(Field& U, int level, double ep)
99 {
100 t_P[level] += ep;
101 update_P(P, U, level, ep);
102 std::cout << GridLogIntegrator << "[" << level << "] P " << " dt " << ep << " : t_P " << t_P[level] << std::endl;
103 }
104
105 // to be used by the actionlevel class to iterate
106 // over the representations
107 struct _updateP
108 {
109 template <class FieldType, class GF, class Repr>
110 void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep,
111 GF& Mom, GF& U, double ep) {
112 for (int a = 0; a < repr_set.size(); ++a) {
113 FieldType forceR(U.Grid());
114 // Implement smearing only for the fundamental representation now
115 repr_set.at(a)->deriv(Rep.U, forceR);
116 GF force = Rep.RtoFundamentalProject(forceR); // Ta for the fundamental rep
117 Real force_abs = std::sqrt(norm2(force)/(U.Grid()->gSites()));
118 std::cout << GridLogIntegrator << "Hirep Force average: " << force_abs << std::endl;
119 Mom -= force * ep* HMC_MOMENTUM_DENOMINATOR;;
120 }
121 }
123
124
125 void update_P(MomentaField& Mom, Field& U, int level, double ep) {
126 // input U actually not used in the fundamental case
127 // Fundamental updates, include smearing
128
129 assert(as.size()==LevelForces.size());
130
131 Field level_force(U.Grid()); level_force =Zero();
132 for (int a = 0; a < as[level].actions.size(); ++a) {
133
134 double start_full = usecond();
135 Field force(U.Grid());
136 conformable(U.Grid(), Mom.Grid());
137
138 double start_force = usecond();
139
140 as[level].actions.at(a)->deriv_timer_start();
141 as[level].actions.at(a)->deriv(Smearer, force); // deriv should NOT include Ta
142 as[level].actions.at(a)->deriv_timer_stop();
143
144 auto name = as[level].actions.at(a)->action_name();
145
146 force = FieldImplementation::projectForce(force); // Ta for gauge fields
147 double end_force = usecond();
148
149 MomFilter->applyFilter(force);
150
151 std::cout << GridLogIntegrator << " update_P : Level [" << level <<"]["<<a <<"] "<<name<<" dt "<<ep<< std::endl;
152
153 // track the total
154 level_force = level_force+force;
155
156 Real force_abs = std::sqrt(norm2(force)/U.Grid()->gSites()); //average per-site norm. nb. norm2(latt) = \sum_x norm2(latt[x])
157 Real impulse_abs = force_abs * ep * HMC_MOMENTUM_DENOMINATOR;
158
159 Real force_max = std::sqrt(maxLocalNorm2(force));
160 Real impulse_max = force_max * ep * HMC_MOMENTUM_DENOMINATOR;
161
162 as[level].actions.at(a)->deriv_log(force_abs,force_max,impulse_abs,impulse_max);
163
164 std::cout << GridLogIntegrator<< "["<<level<<"]["<<a<<"] dt : " << ep <<" "<<name<<std::endl;
165 std::cout << GridLogIntegrator<< "["<<level<<"]["<<a<<"] Force average: " << force_abs <<" "<<name<<std::endl;
166 std::cout << GridLogIntegrator<< "["<<level<<"]["<<a<<"] Force max : " << force_max <<" "<<name<<std::endl;
167 std::cout << GridLogIntegrator<< "["<<level<<"]["<<a<<"] Fdt average : " << impulse_abs <<" "<<name<<std::endl;
168 std::cout << GridLogIntegrator<< "["<<level<<"]["<<a<<"] Fdt max : " << impulse_max <<" "<<name<<std::endl;
169
170 Mom -= force * ep* HMC_MOMENTUM_DENOMINATOR;;
171 double end_full = usecond();
172 double time_full = (end_full - start_full) / 1e3;
173 double time_force = (end_force - start_force) / 1e3;
174 std::cout << GridLogMessage << "["<<level<<"]["<<a<<"] P update elapsed time: " << time_full << " ms (force: " << time_force << " ms)" << std::endl;
175
176 }
177
178 {
179 // total force
180 Real force_abs = std::sqrt(norm2(level_force)/U.Grid()->gSites()); //average per-site norm. nb. norm2(latt) = \sum_x norm2(latt[x])
181 Real impulse_abs = force_abs * ep * HMC_MOMENTUM_DENOMINATOR;
182
183 Real force_max = std::sqrt(maxLocalNorm2(level_force));
184 Real impulse_max = force_max * ep * HMC_MOMENTUM_DENOMINATOR;
185 LevelForces[level].actions.at(0)->deriv_log(force_abs,force_max,impulse_abs,impulse_max);
186 }
187
188 // Force from the other representations
189 as[level].apply(update_P_hireps, Representations, Mom, U, ep);
190
191 }
192
193 void update_U(Field& U, double ep)
194 {
195 update_U(P, U, ep);
196
197 t_U += ep;
198 int fl = levels - 1;
199 std::cout << GridLogIntegrator << " " << "[" << fl << "] U " << " dt " << ep << " : t_U " << t_U << std::endl;
200 }
201
202 void update_U(MomentaField& Mom, Field& U, double ep)
203 {
204 MomentaField MomFiltered(Mom.Grid());
205 MomFiltered = Mom;
206 MomFilter->applyFilter(MomFiltered);
207
208 // exponential of Mom*U in the gauge fields case
209 FieldImplementation::update_field(MomFiltered, U, ep);
210
211 // Update the smeared fields, can be implemented as observer
212 Smearer.set_Field(U);
213
214 // Update the higher representations fields
215 Representations.update(U); // void functions if fundamental representation
216 }
217
218 virtual void step(Field& U, int level, int first, int last) = 0;
219
220public:
223 SmearingPolicy& Sm)
224 : Params(Par),
225 as(Aset),
226 P(grid),
227 levels(Aset.size()),
228 Smearer(Sm),
229 Representations(grid)
230 {
231 t_P.resize(levels, 0.0);
232 t_U = 0.0;
233 // initialization of smearer delegated outside of Integrator
234
235 //Default the momentum filter to "do-nothing"
237
238 for (int level = 0; level < as.size(); ++level) {
239 int multiplier = as.at(level).multiplier;
241 Level->push_back(new EmptyAction<Field>);
242 LevelForces.push_back(*Level);
243 // does it copy by value or reference??
244 // - answer it copies by value, BUT the action level contains a reference that is NOT updated.
245 // Unsafe code in Guido's area
246 }
247 };
248
249 virtual ~Integrator()
250 {
251 // Pain in the ass to clean up the Level pointers
252 // Guido's design is at fault as per comment above in constructor
253 }
254
255 virtual std::string integrator_name() = 0;
256
257 //Set the momentum filter allowing for manipulation of the conjugate momentum
259 MomFilter = &filter;
260 }
261
262 //Access the conjugate momentum
263 const MomentaField & getMomentum() const{ return P; }
264
265
266 void reset_timer(void)
267 {
268 assert(as.size()==LevelForces.size());
269 for (int level = 0; level < as.size(); ++level) {
270 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
271 as[level].actions.at(actionID)->reset_timer();
272 }
273 int actionID=0;
274 assert(LevelForces.at(level).actions.size()==1);
275 LevelForces.at(level).actions.at(actionID)->reset_timer();
276 }
277 }
278 void print_timer(void)
279 {
280 std::cout << GridLogMessage << ":::::::::::::::::::::::::::::::::::::::::" << std::endl;
281 std::cout << GridLogMessage << " Refresh cumulative timings "<<std::endl;
282 std::cout << GridLogMessage << "--------------------------- "<<std::endl;
283 for (int level = 0; level < as.size(); ++level) {
284 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
285 std::cout << GridLogMessage
286 << as[level].actions.at(actionID)->action_name()
287 <<"["<<level<<"]["<< actionID<<"] "
288 << as[level].actions.at(actionID)->refresh_us*1.0e-6<<" s"<< std::endl;
289 }
290 }
291 std::cout << GridLogMessage << "--------------------------- "<<std::endl;
292 std::cout << GridLogMessage << " Action cumulative timings "<<std::endl;
293 std::cout << GridLogMessage << "--------------------------- "<<std::endl;
294 for (int level = 0; level < as.size(); ++level) {
295 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
296 std::cout << GridLogMessage
297 << as[level].actions.at(actionID)->action_name()
298 <<"["<<level<<"]["<< actionID<<"] "
299 << as[level].actions.at(actionID)->S_us*1.0e-6<<" s"<< std::endl;
300 }
301 }
302 std::cout << GridLogMessage << "--------------------------- "<<std::endl;
303 std::cout << GridLogMessage << " Force cumulative timings "<<std::endl;
304 std::cout << GridLogMessage << "------------------------- "<<std::endl;
305 for (int level = 0; level < as.size(); ++level) {
306 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
307 std::cout << GridLogMessage
308 << as[level].actions.at(actionID)->action_name()
309 <<"["<<level<<"]["<< actionID<<"] "
310 << as[level].actions.at(actionID)->deriv_us*1.0e-6<<" s"<< std::endl;
311 }
312 }
313 std::cout << GridLogMessage << "--------------------------- "<<std::endl;
314 std::cout << GridLogMessage << " Dslash counts "<<std::endl;
315 std::cout << GridLogMessage << "------------------------- "<<std::endl;
316 uint64_t full, partial, dirichlet;
317 DslashGetCounts(dirichlet,partial,full);
318 std::cout << GridLogMessage << " Full BCs : "<<full<<std::endl;
319 std::cout << GridLogMessage << " Partial dirichlet BCs : "<<partial<<std::endl;
320 std::cout << GridLogMessage << " Dirichlet BCs : "<<dirichlet<<std::endl;
321
322 std::cout << GridLogMessage << "--------------------------- "<<std::endl;
323 std::cout << GridLogMessage << " Force average size "<<std::endl;
324 std::cout << GridLogMessage << "------------------------- "<<std::endl;
325 for (int level = 0; level < as.size(); ++level) {
326 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
327 std::cout << GridLogMessage
328 << as[level].actions.at(actionID)->action_name()
329 <<"["<<level<<"]["<< actionID<<"] :\n\t\t "
330 <<" force max " << as[level].actions.at(actionID)->deriv_max_average()
331 <<" norm " << as[level].actions.at(actionID)->deriv_norm_average()
332 <<" Fdt max " << as[level].actions.at(actionID)->Fdt_max_average()
333 <<" Fdt norm " << as[level].actions.at(actionID)->Fdt_norm_average()
334 <<" calls " << as[level].actions.at(actionID)->deriv_num
335 << std::endl;
336 }
337 int actionID=0;
338 std::cout << GridLogMessage
339 << LevelForces[level].actions.at(actionID)->action_name()
340 <<"["<<level<<"]["<< actionID<<"] :\n\t\t "
341 <<" force max " << LevelForces[level].actions.at(actionID)->deriv_max_average()
342 <<" norm " << LevelForces[level].actions.at(actionID)->deriv_norm_average()
343 <<" Fdt max " << LevelForces[level].actions.at(actionID)->Fdt_max_average()
344 <<" Fdt norm " << LevelForces[level].actions.at(actionID)->Fdt_norm_average()
345 <<" calls " << LevelForces[level].actions.at(actionID)->deriv_num
346 << std::endl;
347 }
348 std::cout << GridLogMessage << ":::::::::::::::::::::::::::::::::::::::::"<< std::endl;
349 }
350
352 {
353 std::cout << GridLogMessage << "[Integrator] Name : "<< integrator_name() << std::endl;
354 Params.print_parameters();
355 }
356
358 {
359 std::cout << GridLogMessage << ":::::::::::::::::::::::::::::::::::::::::" << std::endl;
360 std::cout << GridLogMessage << "[Integrator] Action summary: "<<std::endl;
361 for (int level = 0; level < as.size(); ++level) {
362 std::cout << GridLogMessage << "[Integrator] ---- Level: "<< level << std::endl;
363 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
364 std::cout << GridLogMessage << "["<< as[level].actions.at(actionID)->action_name() << "] ID: " << actionID << std::endl;
365 std::cout << as[level].actions.at(actionID)->LogParameters();
366 }
367 }
368 std::cout << " [Integrator] Total Force loggers: "<< LevelForces.size() <<std::endl;
369 for (int level = 0; level < LevelForces.size(); ++level) {
370 std::cout << GridLogMessage << "[Integrator] ---- Level: "<< level << std::endl;
371 for (int actionID = 0; actionID < LevelForces[level].actions.size(); ++actionID) {
372 std::cout << GridLogMessage << "["<< LevelForces[level].actions.at(actionID)->action_name() << "] ID: " << actionID << std::endl;
373 }
374 }
375 std::cout << GridLogMessage << ":::::::::::::::::::::::::::::::::::::::::"<< std::endl;
376 }
377
379 {
380 P *= -1.0;
381 }
382
383 // to be used by the actionlevel class to iterate
384 // over the representations
385 struct _refresh {
386 template <class FieldType, class Repr>
387 void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep, GridSerialRNG & sRNG, GridParallelRNG& pRNG) {
388 for (int a = 0; a < repr_set.size(); ++a){
389 repr_set.at(a)->refresh(Rep.U, sRNG, pRNG);
390
391 std::cout << GridLogDebug << "Hirep refreshing pseudofermions" << std::endl;
392 }
393 }
395
396 // Initialization of momenta and actions
398 {
399 assert(P.Grid() == U.Grid());
400 std::cout << GridLogIntegrator << "Integrator refresh" << std::endl;
401
402 std::cout << GridLogIntegrator << "Generating momentum" << std::endl;
403 FieldImplementation::generate_momenta(P, sRNG, pRNG);
404
405 // Update the smeared fields, can be implemented as observer
406 // necessary to keep the fields updated even after a reject
407 // of the Metropolis
408 std::cout << GridLogIntegrator << "Updating smeared fields" << std::endl;
409 Smearer.set_Field(U);
410 // Set the (eventual) representations gauge fields
411
412 std::cout << GridLogIntegrator << "Updating representations" << std::endl;
413 Representations.update(U);
414
415 // The Smearer is attached to a pointer of the gauge field
416 // automatically gets the correct field
417 // whether or not has been accepted in the previous sweep
418 for (int level = 0; level < as.size(); ++level) {
419 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
420 // get gauge field from the SmearingPolicy and
421 // based on the boolean is_smeared in actionID
422 auto name = as[level].actions.at(actionID)->action_name();
423 std::cout << GridLogMessage << "refresh [" << level << "][" << actionID << "] "<<name << std::endl;
424
425 as[level].actions.at(actionID)->refresh_timer_start();
426 as[level].actions.at(actionID)->refresh(Smearer, sRNG, pRNG);
427 as[level].actions.at(actionID)->refresh_timer_stop();
428
429 }
430
431 // Refresh the higher representation actions
432 as[level].apply(refresh_hireps, Representations, sRNG, pRNG);
433 }
434
435 }
436
437 // to be used by the actionlevel class to iterate
438 // over the representations
439 struct _S {
440 template <class FieldType, class Repr>
441 void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep, int level, RealD& H) {
442
443 for (int a = 0; a < repr_set.size(); ++a) {
444 RealD Hterm = repr_set.at(a)->S(Rep.U);
445 std::cout << GridLogMessage << "S Level " << level << " term " << a << " H Hirep = " << Hterm << std::endl;
446 H += Hterm;
447
448 }
449 }
451
452 // Calculate action
454 { // here also U not used
455
456 assert(as.size()==LevelForces.size());
457 std::cout << GridLogIntegrator << "Integrator action\n";
458
459 RealD H = - FieldImplementation::FieldSquareNorm(P)/HMC_MOMENTUM_DENOMINATOR; // - trace (P*P)/denom
460
461 RealD Hterm;
462
463 // Actions
464 for (int level = 0; level < as.size(); ++level) {
465 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
466
467 // get gauge field from the SmearingPolicy and
468 // based on the boolean is_smeared in actionID
469 std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] action eval " << std::endl;
470 as[level].actions.at(actionID)->S_timer_start();
471 Hterm = as[level].actions.at(actionID)->S(Smearer);
472 as[level].actions.at(actionID)->S_timer_stop();
473 std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] H = " << Hterm << std::endl;
474 H += Hterm;
475
476 }
477 as[level].apply(S_hireps, Representations, level, H);
478 }
479
480 return H;
481 }
482
483 struct _Sinitial {
484 template <class FieldType, class Repr>
485 void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep, int level, RealD& H) {
486
487 for (int a = 0; a < repr_set.size(); ++a) {
488
489 RealD Hterm = repr_set.at(a)->Sinitial(Rep.U);
490
491 std::cout << GridLogMessage << "Sinitial Level " << level << " term " << a << " H Hirep = " << Hterm << std::endl;
492 H += Hterm;
493
494 }
495 }
497
499 { // here also U not used
500
501 std::cout << GridLogIntegrator << "Integrator initial action\n";
502
503 RealD H = - FieldImplementation::FieldSquareNorm(P)/HMC_MOMENTUM_DENOMINATOR; // - trace (P*P)/denom
504
505 RealD Hterm;
506
507 // Actions
508 for (int level = 0; level < as.size(); ++level) {
509 for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) {
510 // get gauge field from the SmearingPolicy and
511 // based on the boolean is_smeared in actionID
512 std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] action eval " << std::endl;
513
514 as[level].actions.at(actionID)->S_timer_start();
515 Hterm = as[level].actions.at(actionID)->S(Smearer);
516 as[level].actions.at(actionID)->S_timer_stop();
517
518 std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] H = " << Hterm << std::endl;
519 H += Hterm;
520 }
521 as[level].apply(Sinitial_hireps, Representations, level, H);
522 }
523
524 return H;
525 }
526
527
529 {
530 // reset the clocks
531 t_U = 0;
532 for (int level = 0; level < as.size(); ++level) {
533 t_P[level] = 0;
534 }
535
536 for (int stp = 0; stp < Params.MDsteps; ++stp) { // MD step
537 int first_step = (stp == 0);
538 int last_step = (stp == Params.MDsteps - 1);
539 this->step(U, 0, first_step, last_step);
540 }
541
542 // Check the clocks all match on all levels
543 for (int level = 0; level < as.size(); ++level) {
544 assert(fabs(t_U - t_P[level]) < 1.0e-6); // must be the same
545 std::cout << GridLogIntegrator << " times[" << level << "]= " << t_P[level] << " " << t_U << std::endl;
546 }
547
548 FieldImplementation::Project(U);
549
550 // and that we indeed got to the end of the trajectory
551 assert(fabs(t_U - Params.trajL) < 1.0e-6);
552
553 }
554
555};
556
558
559#endif // INTEGRATOR_INCLUDED
560
std::vector< ActionLevel< GaugeField, R > > ActionSet
Definition ActionSet.h:108
#define HMC_MOMENTUM_DENOMINATOR
void conformable(const Lattice< obj1 > &lhs, const Lattice< obj2 > &rhs)
RealD maxLocalNorm2(const Lattice< vobj > &arg)
RealD norm2(const Lattice< vobj > &arg)
GridLogger GridLogDebug(1, "Debug", GridLogColours, "PURPLE")
GridLogger GridLogIntegrator(1, "Integrator", GridLogColours, "BLUE")
GridLogger GridLogMessage(1, "Message", GridLogColours, "NORMAL")
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
RealF Real
Definition Simd.h:65
double RealD
Definition Simd.h:61
void DslashGetCounts(uint64_t &dirichlet, uint64_t &partial, uint64_t &full)
Definition Stencil.cc:42
double usecond(void)
Definition Timer.h:50
static INTERNAL_PRECISION U
Definition Zolotarev.cc:230
Base class for all actions.
Definition ActionBase.h:64
A trivial action, which may be used as a placeholder.
Definition ActionBase.h:229
GRID_SERIALIZABLE_CLASS_MEMBERS(IntegratorParameters, std::string, name, unsigned int, MDsteps, RealD, trajL) IntegratorParameters(int MDsteps_
IntegratorParameters(ReaderClass &Reader)
Definition Integrator.h:51
void print_parameters() const
Definition Integrator.h:57
void reverse_momenta()
Definition Integrator.h:378
void print_parameters()
Definition Integrator.h:351
void print_timer(void)
Definition Integrator.h:278
MomentumFilterBase< MomentaField > const * MomFilter
Definition Integrator.h:86
void refresh(Field &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
Definition Integrator.h:397
virtual void step(Field &U, int level, int first, int last)=0
void integrate(Field &U)
Definition Integrator.h:528
virtual std::string integrator_name()=0
RealD S(Field &U)
Definition Integrator.h:453
const ActionSet< Field, RepresentationsPolicy > as
Definition Integrator.h:88
struct Integrator::_S S_hireps
void reset_timer(void)
Definition Integrator.h:266
void update_P(MomentaField &Mom, Field &U, int level, double ep)
Definition Integrator.h:125
struct Integrator::_updateP update_P_hireps
ActionSet< Field, RepresentationsPolicy > LevelForces
Definition Integrator.h:90
const MomentaField & getMomentum() const
Definition Integrator.h:263
struct Integrator::_refresh refresh_hireps
Integrator(GridBase *grid, IntegratorParameters Par, ActionSet< Field, RepresentationPolicy > &Aset, SmearingPolicy &Sm)
Definition Integrator.h:221
static MomentumFilterBase< MomentaField > const * getDefaultMomFilter()
Definition Integrator.h:93
virtual ~Integrator()
Definition Integrator.h:249
void setMomentumFilter(const MomentumFilterBase< MomentaField > &filter)
Definition Integrator.h:258
struct Integrator::_Sinitial Sinitial_hireps
void print_actions()
Definition Integrator.h:357
RealD Sinitial(Field &U)
Definition Integrator.h:498
void update_U(Field &U, double ep)
Definition Integrator.h:193
void update_P(Field &U, int level, double ep)
Definition Integrator.h:98
void update_U(MomentaField &Mom, Field &U, double ep)
Definition Integrator.h:202
Definition Simd.h:194
void push_back(Action< GenField > *ptr)
Definition ActionSet.h:84
void operator()(std::vector< Action< FieldType > * > repr_set, Repr &Rep, int level, RealD &H)
Definition Integrator.h:441
void operator()(std::vector< Action< FieldType > * > repr_set, Repr &Rep, int level, RealD &H)
Definition Integrator.h:485
void operator()(std::vector< Action< FieldType > * > repr_set, Repr &Rep, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
Definition Integrator.h:387
void operator()(std::vector< Action< FieldType > * > repr_set, Repr &Rep, GF &Mom, GF &U, double ep)
Definition Integrator.h:110