Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gradientFlow_RungeKutta_3rd.cpp
Go to the documentation of this file.
1 
15 
16 const std::string GradientFlow_RungeKutta_3rd::class_name = "GradientFlow_RungeKutta_3rd";
17 
18 //====================================================================
19 void GradientFlow_RungeKutta_3rd::flow(double& t, double& Estep, Field_G& U)
20 {
21  const double a0 = 0.25;
22 
23  const double b0 = -17.0 / 36.0;
24  const double b1 = 8.0 / 9.0;
25 
26  const double c0 = 17.0 / 36.0;
27  const double c1 = -8.0 / 9.0;
28  const double c2 = 0.75;
29 
30  //- aliases
31  Field_G& w0 = U;
32  Field_G& w3 = U;
33 
34  Field_G& w1 = m_w1;
35  Field_G& w2 = m_w2;
36 
37  Field_G& z0 = m_z0;
38  Field_G& z1 = m_z1;
39  Field_G& z2 = m_z2;
40 
41  Field_G& zt = m_zt;
42 
43  //- step 0
44  // calculate gradient of m_action Z_0 (SA)
45  m_action->force(z0, w0);
46 
47  // zt = a0 * z0 = 1/4 z0
48  copy(zt, z0);
49  scal(zt, a0);
50 
51  // W_1=e^{Z_0/4}*U (SA)
52  mult_exp_Field_G(w1, Estep, zt, w0, m_Nprec);
53 
54  //- step 1
55  // Z_1 (SA)
56  m_action->force(z1, w1);
57 
58  // zt = b1 * z1 + b0 * z0 = 8/9 z1 - 17/36 z0
59  copy(zt, z1);
60  scal(zt, b1);
61  axpy(zt, b0, z0);
62 
63  // W_2=e^{8*Z_1/9-17*Z_0/36}*W_1 (SA)
64  mult_exp_Field_G(w2, Estep, zt, w1, m_Nprec);
65 
66  //- step 2
67  // Z_2 (SA)
68  m_action->force(z2, w2);
69 
70  // zt = c2 * z2 + c1 * z1 * c0 * z0
71  // = 3/4 z2 - 8/9 z1 + 17/36 z0
72  // = 3/4 z2 - zt_prev
73  copy(zt, z2);
74  scal(zt, c2);
75  axpy(zt, c1, z1);
76  axpy(zt, c0, z0);
77 
78  // V_out=e^{3*Z_2/4-8*Z_1/9+17*Z_0/36}*W_2 (SA)
79  mult_exp_Field_G(w3, Estep, zt, w2, m_Nprec);
80 
81  t += Estep;
82 }
83 
84 
85 //====================================================================
86 //============================================================END=====
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:433
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:532
void flow(double &t, double &Estep, Field_G &U)
SU(N) gauge field.
Definition: field_G.h:38
virtual void force(Field &)=0
returns force for molcular dynamical update of conjugate momenta.
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:319
void mult_exp_Field_G(Field_G &W, const double alpha, const Field_G &iP, const Field_G &U, const int Nprec)