Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
integrator_UpdateP.cpp
Go to the documentation of this file.
1 
14 #include "integrator_UpdateP.h"
15 
16 const std::string Integrator_UpdateP::class_name = "Integrator_UpdateP";
17 
18 //====================================================================
20 {
21  const string str_vlevel = params.get_string("verbose_level");
22 
23  m_vl = vout.set_verbose_level(str_vlevel);
24 
25  //- fetch and check input parameters
26  int err = 0;
27 
28  if (err) {
29  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
30  exit(EXIT_FAILURE);
31  }
32 }
33 
34 
35 //====================================================================
36 void Integrator_UpdateP::evolve(const double step_size, Field_G& iP, Field_G& U)
37 {
38  if (not is_cache_valid()) { // recalc force
39  m_force.set(0.0);
40 
41  Field force_tmp(iP.nin(), iP.nvol(), iP.nex());
42  for (unsigned int i = 0, n = m_action.size(); i < n; ++i) {
43  m_action[i]->force(force_tmp);
44  vout.detailed(m_vl, "updated p by action %d finished.\n", i);
45  axpy(m_force, 1.0, force_tmp);
46  }
47 
49 
50  vout.detailed(m_vl, "%s: force updated.\n", class_name.c_str());
51  } else {
52  vout.general(m_vl, "%s: returns previous force.\n", class_name.c_str());
53  }
54 
55  axpy(iP, step_size, m_force);
56 }
57 
58 
59 //====================================================================
60 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
void detailed(const char *format,...)
Definition: bridgeIO.cpp:216
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
void general(const char *format,...)
Definition: bridgeIO.cpp:197
Container of Field-type object.
Definition: field.h:45
int nvol() const
Definition: field.h:127
static const std::string class_name
Class for parameters.
Definition: parameters.h:46
int nin() const
Definition: field.h:126
SU(N) gauge field.
Definition: field_G.h:38
void evolve(const double step_size, Field_G &iP, Field_G &U)
int nex() const
Definition: field.h:128
Bridge::VerboseLevel m_vl
Definition: integrator.h:58
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:319
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
bool is_cache_valid() const
string get_string(const string &key) const
Definition: parameters.cpp:221
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
std::vector< Action * > m_action