Bridge++  Ver. 2.0.2
aforce_F_Smeared-tmpl.h
Go to the documentation of this file.
1 
10 //#include "Force/Fermion/aforce_F_Smeared.h"
11 
12 template<typename AFIELD>
14  = "AForce_F_Smeared<AFIELD>";
15 
16 //====================================================================
17 template<typename AFIELD>
19 {
20  // set_parameters(params);
21 }
22 
23 
24 //====================================================================
25 template<typename AFIELD>
27 {
28  m_U = (Field_G *)U;
29 
30  Index_lex_alt<real_t, AFIELD::IMPL> index_lex;
31 
32 #pragma omp parallel
33  {
34  convert_gauge(index_lex, m_Ucp, *U);
35  }
36 
37  m_director_smear->set_config(U);
38 
39  m_force->set_config(m_director_smear->get_config());
40 }
41 
42 
43 //====================================================================
44 template<typename AFIELD>
46 {
47  const string str_vlevel = params.get_string("verbose_level");
48 
49  m_vl = vout.set_verbose_level(str_vlevel);
50 }
51 
52 
53 //====================================================================
54 template<typename AFIELD>
56  const AFIELD& eta)
57 {
58  int Nc = CommonParameters::Nc();
59  int NinG = 2 * Nc * Nc;
60  int Nvol = CommonParameters::Nvol();
61  int Ndim = CommonParameters::Ndim();
62 
63  int Nsmear = m_director_smear->get_Nsmear();
64 
65  AFIELD force1(NinG, Nvol, Ndim);
66  Field_G force2(Nvol, Ndim);
67 
68  if (Nsmear == 0) {
69  m_force->force_udiv(force_, eta);
70  } else {
71  Index_lex_alt<real_t, AFIELD::IMPL> index_lex;
72 
73  Field_G *Uptr = m_director_smear->get_config();
74 
75  m_force->set_config(Uptr);
76 
77  m_force->force_udiv(force1, eta);
78 
79 #pragma omp parallel
80  {
81  reverse_gauge(index_lex, force2, force1);
82  }
83 
84  mult_jacobian(force2);
85 
86 #pragma omp parallel
87  {
88  convert_gauge(index_lex, force_, force2);
89  }
90  }
91 
92  // copy(force_, force1);
93 }
94 
95 
96 //====================================================================
97 template<typename AFIELD>
99  const AFIELD& zeta, const AFIELD& eta)
100 {
101  int Nc = CommonParameters::Nc();
102  int NinG = 2 * Nc * Nc;
103  int Nvol = CommonParameters::Nvol();
104  int Ndim = CommonParameters::Ndim();
105 
106  int Nsmear = m_director_smear->get_Nsmear();
107 
108  AFIELD force1(NinG, Nvol, Ndim);
109  Field_G force2(Nvol, Ndim);
110 
111  if (Nsmear == 0) {
112  m_force->force_udiv1(force_, zeta, eta);
113  } else {
114  Index_lex_alt<real_t, AFIELD::IMPL> index_lex;
115 
116  Field_G *Uptr = m_director_smear->get_config();
117 
118  m_force->set_config(Uptr);
119 
120  m_force->force_udiv1(force1, zeta, eta);
121 
122 #pragma omp parallel
123  {
124  reverse_gauge(index_lex, force2, force1);
125  }
126 
127  mult_jacobian(force2);
128 
129 #pragma omp parallel
130  {
131  convert_gauge(index_lex, force_, force2);
132  }
133  }
134 
135  // copy(force_, force); // force_ = force;
136 }
137 
138 
139 //====================================================================
140 template<typename AFIELD>
142 { // this function is not alt-coded.
143  const int Nsmear = m_director_smear->get_Nsmear();
144 
145  Field_G f_tmp(force); // copy to temporal field.
146 
147  for (int ismear = Nsmear - 1; ismear >= 0; --ismear) {
148  Field *Uptr = m_director_smear->get_config(ismear);
149 
150  m_director_smear->force_udiv(force, f_tmp, *Uptr);
151 
152  if (ismear > 0) copy(f_tmp, force); // ftmp = force;
153  }
154 }
155 
156 
157 //====================================================================
158 //============================================================END=====
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
Parameters
Class for parameters.
Definition: parameters.h:46
AForce_F_Smeared
Force calculation for smeared fermion operators.
Definition: aforce_F_Smeared.h:33
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
convert_gauge
void convert_gauge(INDEX &index, FIELD &v, const Field &w)
Definition: afield-inc.h:224
reverse_gauge
void reverse_gauge(INDEX &index, Field &v, FIELD &w)
Definition: afield-inc.h:417
copy
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:212
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
AForce_F_Smeared::force_udiv1
void force_udiv1(AFIELD &force, const AFIELD &zeta, const AFIELD &eta)
Definition: aforce_F_Smeared-tmpl.h:98
AForce_F_Smeared::init
void init()
initial setup.
Definition: aforce_F_Smeared-tmpl.h:18
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
AForce_F_Smeared::force_udiv
void force_udiv(AFIELD &force, const AFIELD &eta)
Definition: aforce_F_Smeared-tmpl.h:55
AForce_F_Smeared::set_parameters
void set_parameters(const Parameters &)
Definition: aforce_F_Smeared-tmpl.h:45
Parameters::get_string
string get_string(const string &key) const
Definition: parameters.cpp:221
Field
Container of Field-type object.
Definition: field.h:46
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AForce_F_Smeared::mult_jacobian
void mult_jacobian(Field_G &force)
Definition: aforce_F_Smeared-tmpl.h:141
AForce_F_Smeared::set_config
void set_config(Field *U)
Definition: aforce_F_Smeared-tmpl.h:26