Bridge++  Ver. 2.0.2
integrator_UpdateU.cpp
Go to the documentation of this file.
1 
14 #include "integrator_UpdateU.h"
15 
16 const std::string Integrator_UpdateU::class_name = "Integrator_UpdateU";
17 
18 //====================================================================
20 {
21  std::string vlevel;
22  if (!params.fetch_string("verbose_level", vlevel)) {
23  m_vl = vout.set_verbose_level(vlevel);
24  }
25 
26  //- fetch and check input parameters
27  int Nprec;
28 
29  int err = 0;
30  err += params.fetch_int("order_of_exp_iP", Nprec);
31 
32  if (err) {
33  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
34  exit(EXIT_FAILURE);
35  }
36 
37  set_parameters(Nprec);
38 }
39 
40 
41 //====================================================================
43 {
44  params.set_int("order_of_exp_iP", m_Nprec);
45 
46  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
47 }
48 
49 
50 //====================================================================
52 {
53  //- print input parameters
54  vout.general(m_vl, "%s:\n", class_name.c_str());
55  vout.general(m_vl, " Nprec = %d\n", Nprec);
56 
57  //- range check
58  int err = 0;
59  err += ParameterCheck::non_zero(Nprec);
60 
61  if (err) {
62  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n", class_name.c_str());
63  exit(EXIT_FAILURE);
64  }
65 
66  //- store values
67  m_Nprec = Nprec;
68 }
69 
70 
71 //====================================================================
73 {
74  m_Nprec = Nprec;
75 }
76 
77 
78 //====================================================================
79 void Integrator_UpdateU::evolve(const double step_size, Field_G& iP, Field_G& U)
80 {
81  //- alias
82  Field_G& W = U;
83 
84  mult_exp_Field_G(W, step_size, iP, U, m_Nprec);
85 
86  notify_update();
87 }
88 
89 
90 //====================================================================
92 {
93  for (size_t i = 0, n = m_integs.size(); i < n; ++i) {
94  m_integs[i]->invalidate_cache();
95  }
96  for (size_t i = 0, n = m_director.size(); i < n; ++i) {
97  m_director[i]->notify_linkv();
98  }
99 }
100 
101 
102 //====================================================================
103 //============================================================END=====
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
Parameters
Class for parameters.
Definition: parameters.h:46
Integrator_UpdateU::get_parameters
void get_parameters(Parameters &params) const
Definition: integrator_UpdateU.cpp:42
Integrator_UpdateU::set_parameter_Nprec
void set_parameter_Nprec(const int Nprec)
Definition: integrator_UpdateU.cpp:72
Integrator_UpdateU::m_Nprec
int m_Nprec
Definition: integrator_UpdateU.h:42
Integrator_UpdateU::m_director
std::vector< Director * > m_director
Definition: integrator_UpdateU.h:44
Integrator_UpdateU::evolve
void evolve(const double step_size, Field_G &iP, Field_G &U)
Definition: integrator_UpdateU.cpp:79
Integrator_UpdateU::class_name
static const std::string class_name
Definition: integrator_UpdateU.h:37
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
ParameterCheck::non_zero
int non_zero(const double v)
Definition: parameterCheck.cpp:32
Integrator_UpdateU::notify_update
void notify_update()
Definition: integrator_UpdateU.cpp:91
Parameters::set_int
void set_int(const string &key, const int value)
Definition: parameters.cpp:36
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
integrator_UpdateU.h
mult_exp_Field_G
void mult_exp_Field_G(Field_G &W, const double alpha, const Field_G &iP, const Field_G &U, const int Nprec)
Definition: field_G_imp.cpp:496
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Integrator_UpdateU::m_integs
std::vector< Integrator * > m_integs
Definition: integrator_UpdateU.h:45
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Parameters::fetch_int
int fetch_int(const string &key, int &value) const
Definition: parameters.cpp:346
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
Integrator_UpdateU::set_parameters
void set_parameters(const Parameters &params)
Definition: integrator_UpdateU.cpp:19
Integrator::m_vl
Bridge::VerboseLevel m_vl
Definition: integrator.h:60
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:154