31 #ifdef USE_PARAMETERS_FACTORY
56 m_action(action.get()),
74 const string str_vlevel = params.
get_string(
"verbose_level");
82 double tol_RK, safety;
86 err += params.
fetch_int(
"order_of_RungeKutta", order_RK);
88 err += params.
fetch_int(
"order_of_approx_for_exp_iP", Nprec);
90 err += params.
fetch_int(
"adaptive", is_adaptive);
92 if (is_adaptive != 0) {
105 set_parameters(order_RK, Estep, Nprec, tol_RK, safety, is_adaptive);
112 const double Estep,
const int Nprec,
113 const double tol_RK,
const double safety,
114 const int is_adaptive)
144 m_adaptive = (is_adaptive == 0) ?
false :
true;
164 virtual void flow(
double& t,
double& Estep,
Field_G& U) = 0;
168 virtual int order()
const = 0;
189 for (
int iprec = 0; iprec < nprec; ++iprec) {
190 double exf = alpha / (nprec - iprec);
211 for (
int ex = 0; ex < Nex; ++ex) {
212 for (
int site = 0; site < Nvol; ++site) {
213 u0 = U.
mat(site, ex);
214 v0 = iP.
mat(site, ex);
216 exponential(w0, Estep, v0, u0,
m_Nprec);
256 update_u(w1, Estep, z0, w0);
299 update_u(w1, 0.5 * Estep, z0, w0);
306 update_u(w2, Estep, z1, w0);
342 const double a0 = 0.25;
344 const double b0 = -17.0 / 36.0;
345 const double b1 = 8.0 / 9.0;
347 const double c0 = 17.0 / 36.0;
348 const double c1 = -8.0 / 9.0;
349 const double c2 = 0.75;
371 update_u(w1, Estep, zt, w0);
383 update_u(w2, Estep, zt, w1);
398 update_u(w3, Estep, zt, w2);
461 update_u(w1, Estep, zt, w0);
471 update_u(w2, Estep, zt, w0);
482 update_u(w3, Estep, zt, w1);
491 axpy(zt, 1.0 / 6.0, z1);
492 axpy(zt, 1.0 / 6.0, z2);
493 axpy(zt, -1.0 / 12.0, z3);
496 update_u(w4, Estep, zt, w0);
502 scal(zt, -1.0 / 12.0);
503 axpy(zt, 1.0 / 6.0, z1);
504 axpy(zt, 1.0 / 6.0, z2);
508 update_u(w5, Estep, zt, w4);
555 double estep2 = 2.0 * Estep;
557 m_rk->flow(t2, estep2, u_rough);
561 double estep1 = Estep;
563 m_rk->flow(t1, estep1, u_fine);
564 m_rk->flow(t1, estep1, u_fine);
566 double diff = max_diff(u_rough, u_fine);
596 int Nvol = f1.
nvol();
602 double max_norm = 0.0;
604 for (
int ex = 0; ex < Nex; ++ex) {
605 for (
int site = 0; site < Nvol; ++site) {
606 f1.
mat(u0, site, ex);
607 f2.
mat(u1, site, ex);
611 double norm = sqrt(u2.
norm2()) / Nc;
613 if (norm > max_norm) max_norm = norm;
677 double Eplaq = t_flow * t_flow * 36.0 * (1.0 - plaq);
679 vout.
general(
m_vl,
" (t, plaq, t^2 E_plaq) = %.8f %.16f %.16f\n", t_flow, plaq, Eplaq);
681 double result = Eplaq;
static const std::string class_name
void scal(Field &x, const double a)
scal(x, a): x = a * x
AdaptiveRungeKutta(RungeKutta *rk, double tol, double safety, Bridge::VerboseLevel vl)
void Register_string(const string &, const string &)
static int reduce_max(int count, double *recv_buf, double *send_buf, int pattern=0)
find a global maximum of an array of double over the communicator. pattern specifies the dimensions t...
void general(const char *format,...)
void set_parameter_order(const int order, const bool is_adaptive)
void Register_int(const string &, const int)
void flow(double &t, double &Estep, Field_G &U)
void reset(const int Nvol, const int Nex)
void flow(double &t, double &Estep, Field_G &U)
void flow(double &t, double &Estep, Field_G &U)
double plaquette(const Field_G &)
calculates plaquette value.
virtual int order() const =0
GradientFlow(Action *action)
void copy(Field &y, const Field &x)
copy(y, x): y = x
Bridge::VerboseLevel m_vl
Base class of HMC action class family.
void flow(double &t, double &Estep, Field_G &U)
int square_non_zero(const double v)
RungeKutta_2nd(Action *action, int nprec, Bridge::VerboseLevel vl)
RungeKutta_3rd(Action *action, int nprec, Bridge::VerboseLevel vl)
double max_diff(const Field_G &u1, const Field_G &u2) const
virtual void force(Field &)=0
returns force for molcular dynamical update of conjugate momenta.
Common parameter class: provides parameters as singleton.
RungeKutta(Action *action, int nprec, Bridge::VerboseLevel vl)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
static bool Register(const std::string &realm, const creator_callback &cb)
Bridge::VerboseLevel m_vl
RungeKutta_4th(Action *action, int nprec, Bridge::VerboseLevel vl)
void flow(double &t, double &Estep, Field_G &U)
int non_negative(const int v)
void Register_double(const string &, const double)
double evolve(double &t_flow, Field_G &U)
int fetch_double(const string &key, double &val) const
string get_string(const string &key) const
void set_mat(const int site, const int mn, const Mat_SU_N &U)
Parameters_GradientFlow()
Mat_SU_N mat(const int site, const int mn=0) const
int fetch_int(const string &key, int &val) const
void set_parameters(const Parameters ¶ms)
RungeKutta_1st(Action *action, int nprec, Bridge::VerboseLevel vl)
virtual void flow(double &t, double &Estep, Field_G &U)=0
static VerboseLevel set_verbose_level(const std::string &str)
void update_u(Field_G &W, const double Estep, Field_G &iP, Field_G &U)