Bridge++  Version 1.4.4
 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 
38 
39 //====================================================================
41 {
42  m_U = U;
43 
44  //- NB. only solver part is even-odd preconditioned.
45  m_fopr->set_config(U);
47 }
48 
49 
50 //====================================================================
52 {
53  int Nvol = CommonParameters::Nvol();
54  int Ndim = CommonParameters::Ndim();
55 
56  int NinF = m_fopr->field_nin();
57  int NvolF = m_fopr->field_nvol();
58  int NexF = m_fopr->field_nex();
59  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
60 
61  assert(NvolF == Nvol);
62  m_psf.reset(NinF, NvolF, NexF);
63 
64  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
65 
66  Field xi(NinF, NvolF, NexF);
67  rand->gauss_lex_global(xi);
68 
70  m_fopr->set_mode("Ddag");
71 
72  m_fopr->mult(m_psf, xi);
73 
74  double xi2 = xi.norm();
75  double H_psf = xi2 * xi2;
76 
77  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
78  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
79 
80  return H_psf;
81 }
82 
83 
84 //====================================================================
86 {
87  int Nvol = CommonParameters::Nvol();
88  int Ndim = CommonParameters::Ndim();
89 
90  int NinF = m_fopr->field_nin();
91  int NvolF = m_fopr->field_nvol();
92  int NexF = m_fopr->field_nex();
93  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
94 
95  Field v1(NinF, NvolF, NexF);
96 
97  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
98 
99  int Nconv;
100  double diff;
101 
103  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
104 
105  double H_psf = dot(v1, m_psf);
106 
107  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
108  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
109 
110  return H_psf;
111 }
112 
113 
114 //====================================================================
116 {
117  int Nin = m_U->nin();
118  int Nvol = m_U->nvol();
119  int Nex = m_U->nex();
120  int Nc = CommonParameters::Nc();
121  int Ndim = CommonParameters::Ndim();
122 
123  assert(force.nin() == Nin);
124  assert(force.nvol() == Nvol);
125  assert(force.nex() == Nex);
126 
127  int NinF = m_fopr->field_nin();
128  int NvolF = m_fopr->field_nvol();
129  int NexF = m_fopr->field_nex();
130  Field eta(NinF, NvolF, NexF);
131 
132  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
133 
134  int Nconv;
135  double diff;
136 
138  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
139 
140  // force of smeared fermion operator
142  m_fopr_force->force_core(force, eta);
143 
144  double Fave, Fmax, Fdev;
145  force.stat(Fave, Fmax, Fdev);
146  vout.general(m_vl,
147  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
148  Fave, Fmax, Fdev);
149 }
150 
151 
152 //====================================================================
153 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:495
void detailed(const char *format,...)
Definition: bridgeIO.cpp:212
static const std::string class_name
double langevin(RandomNumbers *)
Langevis step.
double dot(const Field &y, const Field &x)
Definition: field.cpp:46
virtual void set_config(Field *)=0
void general(const char *format,...)
Definition: bridgeIO.cpp:195
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:39
virtual void set_config(Field *)=0
int nvol() const
Definition: field.h:116
Class for parameters.
Definition: parameters.h:46
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:53
int nin() const
Definition: field.h:115
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:84
double norm() const
Definition: field.h:211
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:117
virtual void force_core(Field &, const Field &)
Definition: force_F.cpp:18
Bridge::VerboseLevel get_VerboseLevel() const
Definition: parameters.cpp:204
void force(Field &)
returns force for molcular dynamical update of conjugate momenta.
Bridge::VerboseLevel m_vl
Definition: action.h:75
Base class of random number generators.
Definition: randomNumbers.h:36
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:42
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
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:96
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:516
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
static int NPE()