Bridge++  Version 1.4.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 
17 
18 const std::string Integrator_UpdateP::class_name = "Integrator_UpdateP";
19 
20 //====================================================================
22 {
23  const string str_vlevel = params.get_string("verbose_level");
24 
25  m_vl = vout.set_verbose_level(str_vlevel);
26 
27  //- fetch and check input parameters
28  int err = 0;
29 
30  if (err) {
31  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
32  exit(EXIT_FAILURE);
33  }
34 
36 }
37 
38 
39 //====================================================================
41 {
42  //- print input parameters
43  vout.general(m_vl, "%s:\n", class_name.c_str());
44 
45  //- range check
46  int err = 0;
47 
48  if (err) {
49  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n", class_name.c_str());
50  exit(EXIT_FAILURE);
51  }
52 
53  //- store values
54 }
55 
56 
57 //====================================================================
58 void Integrator_UpdateP::evolve(const double step_size, Field_G& iP, Field_G& U)
59 {
60  if (not is_cache_valid()) { // recalc force
61  m_force.set(0.0);
62 
63  Field force_tmp(iP.nin(), iP.nvol(), iP.nex());
64  for (unsigned int i = 0, n = m_action.size(); i < n; ++i) {
65  m_action[i]->force(force_tmp);
66  vout.detailed(m_vl, "updated p by action %d finished.\n", i);
67  axpy(m_force, 1.0, force_tmp);
68  }
69 
71 
72  vout.detailed(m_vl, "%s: force updated.\n", class_name.c_str());
73  } else {
74  vout.general(m_vl, "%s: returns previous force.\n", class_name.c_str());
75  }
76 
77  axpy(iP, step_size, m_force);
78 }
79 
80 
81 //====================================================================
82 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:495
void detailed(const char *format,...)
Definition: bridgeIO.cpp:212
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:164
void general(const char *format,...)
Definition: bridgeIO.cpp:195
Container of Field-type object.
Definition: field.h:39
int nvol() const
Definition: field.h:116
static const std::string class_name
Class for parameters.
Definition: parameters.h:46
int nin() const
Definition: field.h:115
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:117
Bridge::VerboseLevel m_vl
Definition: integrator.h:60
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:168
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
bool is_cache_valid() const
string get_string(const string &key) const
Definition: parameters.cpp:116
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
std::vector< Action * > m_action