Bridge++  Version 1.5.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 {
21  const Bridge::VerboseLevel vl = params.get_VerboseLevel();
22 
24 }
25 
26 
27 //====================================================================
29 {
30  m_U = U;
31 
32  //- NB. only solver part is even-odd preconditioned.
33  m_fopr->set_config(U);
35 }
36 
37 
38 //====================================================================
40 {
41  const int Nvol = CommonParameters::Nvol();
42  const int Ndim = CommonParameters::Ndim();
43 
44  const int NinF = m_fopr->field_nin();
45  const int NvolF = m_fopr->field_nvol();
46  const int NexF = m_fopr->field_nex();
47  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
48 
49  assert(NvolF == Nvol);
50  m_psf.reset(NinF, NvolF, NexF);
51 
52  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
53 
54  Field xi(NinF, NvolF, NexF);
55  rand->gauss_lex_global(xi);
56 
58  m_fopr->set_mode("Ddag");
59 
60  m_fopr->mult(m_psf, xi);
61 
62  const double xi2 = xi.norm();
63  const double H_psf = xi2 * xi2;
64 
65  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
66  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
67 
68  return H_psf;
69 }
70 
71 
72 //====================================================================
74 {
75  const int Nvol = CommonParameters::Nvol();
76  const int Ndim = CommonParameters::Ndim();
77 
78  const int NinF = m_fopr->field_nin();
79  const int NvolF = m_fopr->field_nvol();
80  const int NexF = m_fopr->field_nex();
81  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
82 
83  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
84 
85  Field v1(NinF, NvolF, NexF);
86  int Nconv;
87  double diff;
89  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
90 
91  const double H_psf = dot(v1, m_psf);
92 
93  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
94  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
95 
96  return H_psf;
97 }
98 
99 
100 //====================================================================
102 {
103  const int Nin = m_U->nin();
104  const int Nvol = m_U->nvol();
105  const int Nex = m_U->nex();
106  const int Nc = CommonParameters::Nc();
107  const int Ndim = CommonParameters::Ndim();
108 
109  assert(force.nin() == Nin);
110  assert(force.nvol() == Nvol);
111  assert(force.nex() == Nex);
112 
113  const int NinF = m_fopr->field_nin();
114  const int NvolF = m_fopr->field_nvol();
115  const int NexF = m_fopr->field_nex();
116 
117  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
118 
119  Field eta(NinF, NvolF, NexF);
120  int Nconv;
121  double diff;
123  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
124 
125  // force of smeared fermion operator
127  m_fopr_force->force_core(force, eta);
128 
129  double Fave, Fmax, Fdev;
130  force.stat(Fave, Fmax, Fdev);
131  vout.general(m_vl,
132  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
133  Fave, Fmax, Fdev);
134 }
135 
136 
137 //====================================================================
138 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
void detailed(const char *format,...)
Definition: bridgeIO.cpp:216
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:197
virtual void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr.h:94
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:45
virtual void set_config(Field *)=0
int nvol() const
Definition: field.h:127
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:126
void set_config(Field *U)
setting pointer to the gauge configuration.
virtual void invert_DdagD(Field &, const Field &, int &, double &)=0
double norm() const
Definition: field.h:222
void set_parameters(const Parameters &)
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:128
virtual void force_core(Field &, const Field &)
Definition: force_F.cpp:18
Bridge::VerboseLevel get_VerboseLevel() const
Definition: parameters.cpp:320
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
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:43
Bridge::VerboseLevel vl
VerboseLevel
Definition: bridgeIO.h:42
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
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:667
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.