Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gradientFlow_RungeKutta_4th.cpp
Go to the documentation of this file.
1 
15 
16 const std::string GradientFlow_RungeKutta_4th::class_name = "GradientFlow_RungeKutta_4th";
17 
18 //====================================================================
19 void GradientFlow_RungeKutta_4th::flow(double& t, double& Estep, Field_G& U)
20 {
21  //- aliases
22  Field_G& w0 = U;
23  Field_G& w5 = U;
24 
25  Field_G& w1 = m_w1;
26  Field_G& w2 = m_w2;
27  Field_G& w3 = m_w3;
28  Field_G& w4 = m_w4;
29 
30  Field_G& z0 = m_z0;
31  Field_G& z1 = m_z1;
32  Field_G& z2 = m_z2;
33  Field_G& z3 = m_z3;
34 
35  Field_G& zt = m_zt;
36 
37  //- step 0
38  // calculate gradient of m_action Z_0 (SA)
39  m_action->force(z0, w0);
40 
41  copy(zt, z0);
42  scal(zt, 0.5);
43 
44  // W_1=e^{Z_0/2}*U (SA)
45  mult_exp_Field_G(w1, Estep, zt, w0, m_Nprec);
46 
47  //- step 1
48  // Z_1
49  m_action->force(z1, w1);
50 
51  copy(zt, z1);
52  scal(zt, 0.5);
53 
54  // W_2=e^{(1/2)*Z_1}*W_0
55  mult_exp_Field_G(w2, Estep, zt, w0, m_Nprec);
56 
57  //- step 2
58  // Z_2
59  m_action->force(z2, w2);
60 
61  // Z_2 - (1/2)*Z_0
62  copy(zt, z2);
63  axpy(zt, -0.5, z0);
64 
65  // W_3=e^{Z_2 - (1/2)*Z_0}*W_1 NB. not W_0
66  mult_exp_Field_G(w3, Estep, zt, w1, m_Nprec);
67 
68  //- step 3
69  // Z_3
70  m_action->force(z3, w3);
71 
72  // 3*Z_0+2*Z_1+2*Z_2-Z_3
73  copy(zt, z0);
74  scal(zt, 0.25);
75  axpy(zt, 1.0 / 6.0, z1);
76  axpy(zt, 1.0 / 6.0, z2);
77  axpy(zt, -1.0 / 12.0, z3);
78 
79  // W_4=e^{(1/12)*(3*Z_0+2*Z_1+2*Z_2-Z_3)}*W_0
80  mult_exp_Field_G(w4, Estep, zt, w0, m_Nprec);
81 
82  //- step 4 (extra step)
83  // 1/12*(-Z_0+2*Z_1+2*Z_2+3*Z_3)
84  copy(zt, z0);
85  scal(zt, -1.0 / 12.0);
86  axpy(zt, 1.0 / 6.0, z1);
87  axpy(zt, 1.0 / 6.0, z2);
88  axpy(zt, 0.25, z3);
89 
90  // V_t=e^{(1/12)*(-Z_0+2*Z_1+2*Z_2+3*Z_3)}*W_4 NB. not W_0
91  mult_exp_Field_G(w5, Estep, zt, w4, m_Nprec);
92 
93  t += Estep;
94 }
95 
96 
97 //====================================================================
98 //============================================================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
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)
void flow(double &t, double &Estep, Field_G &U)