Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action_F_Standard_eo.cpp
Go to the documentation of this file.
1 
14 #include "action_F_Standard_eo.h"
15 
16 const std::string Action_F_Standard_eo::class_name = "Action_F_Standard_eo";
17 
18 //====================================================================
20 {
22 
24 }
25 
26 
27 //====================================================================
29 {
30  int Nc = CommonParameters::Nc();
31  int Nvol = CommonParameters::Nvol();
32  int Ndim = CommonParameters::Ndim();
33  int NinG = 2 * Nc * Nc;
34 
35  vout.detailed(m_vl, "%s:\n", class_name.c_str());
36 
37  m_force.reset(NinG, Nvol, Ndim);
38 
39  // link variable update flag
40  m_status_linkv = 0;
41 }
42 
43 
44 //====================================================================
46 {
47  m_U = U;
48 
49  //- NB. only solver part is even-odd preconditioned.
50  m_fopr->set_config(U);
52 }
53 
54 
55 //====================================================================
57 {
58  int Nvol = CommonParameters::Nvol();
59  int Ndim = CommonParameters::Ndim();
60 
61  int NinF = m_fopr->field_nin();
62  int NvolF = m_fopr->field_nvol();
63  int NexF = m_fopr->field_nex();
64  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
65 
66  assert(NvolF == Nvol);
67  m_psf.reset(NinF, NvolF, NexF);
68 
69  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
70 
71  Field xi(NinF, NvolF, NexF);
72  rand->gauss_lex_global(xi);
73 
75  m_fopr->set_mode("Ddag");
76 
77  m_psf = m_fopr->mult(xi);
78 
79  double xi2 = xi.norm();
80  double H_psf = xi2 * xi2;
81 
82  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
83  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
84 
85  return H_psf;
86 }
87 
88 
89 //====================================================================
91 {
92  int Nvol = CommonParameters::Nvol();
93  int Ndim = CommonParameters::Ndim();
94 
95  int NinF = m_fopr->field_nin();
96  int NvolF = m_fopr->field_nvol();
97  int NexF = m_fopr->field_nex();
98  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
99 
100  Field v1(NinF, NvolF, NexF);
101 
102  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
103 
104  int Nconv;
105  double diff;
106 
108  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
109 
110  double H_psf = v1 * m_psf;
111 
112  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
113  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
114 
115  return H_psf;
116 }
117 
118 
119 //====================================================================
121 {
122  if (m_status_linkv == 0) {
123  int Nin = m_U->nin();
124  int Nvol = m_U->nvol();
125  int Nex = m_U->nex();
126  int Nc = CommonParameters::Nc();
127  int Ndim = CommonParameters::Ndim();
128 
129  int NinF = m_fopr->field_nin();
130  int NvolF = m_fopr->field_nvol();
131  int NexF = m_fopr->field_nex();
132  Field eta(NinF, NvolF, NexF);
133 
134  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
135 
136  int Nconv;
137  double diff;
138 
140  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
141 
142  // force of smeared fermion operator
144 
145  Field force(Nin, Nvol, Nex);
146  Field force1(Nin, Nvol, Nex);
147 
148  force = m_fopr_force->force_core(eta);
149 
150  m_force = force;
151  ++m_status_linkv;
152 
153  double Fave, Fmax, Fdev;
154  m_force.stat(Fave, Fmax, Fdev);
155  vout.general(m_vl,
156  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
157  Fave, Fmax, Fdev);
158 
159  return m_force;
160  } else {
161  vout.general(m_vl, " %s returns previous force.\n", class_name.c_str());
162  return m_force;
163  }
164 }
165 
166 
167 //====================================================================
168 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:207
void detailed(const char *format,...)
Definition: bridgeIO.cpp:50
static const std::string class_name
double langevin(RandomNumbers *)
Langevis step.
virtual void set_config(Field *)=0
virtual const Field mult(const Field &)=0
multiplies fermion operator to a given field and returns the resultant field.
void general(const char *format,...)
Definition: bridgeIO.cpp:38
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:37
virtual void set_config(Field *)=0
int nvol() const
Definition: field.h:101
Class for parameters.
Definition: parameters.h:40
double calcH()
calculate Hamiltonian of this action term.
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
virtual int field_nin()=0
returns the on-site d.o.f. for which the fermion operator is defined.
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: action.h:46
int nin() const
Definition: field.h:100
void set_config(Field *U)
setting pointer to the gauge configuration.
virtual void invert_DdagD(Field &, const Field &, int &, double &)=0
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:82
double norm() const
Definition: field.h:210
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:102
virtual void force_core(Field &, const Field &)
Definition: force.cpp:58
Bridge::VerboseLevel get_VerboseLevel() const
Definition: parameters.cpp:116
Bridge::VerboseLevel m_vl
Definition: action.h:64
Base class of random number generators.
Definition: randomNumbers.h:40
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:25
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr.h:75
void stat(double &Fave, double &Fmax, double &Fdev) const
determines the statistics of the field. average, maximum value, and deviation is determined over glob...
Definition: field.cpp:544
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
const Field force()
returns force for molcular dynamical update of conjugate momenta.
static int NPE()