Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action_F_Standard_lex.cpp
Go to the documentation of this file.
1 
14 #include "action_F_Standard_lex.h"
15 
16 const std::string Action_F_Standard_lex::class_name = "Action_F_Standard_lex";
17 
18 //====================================================================
20 {
21  const Bridge::VerboseLevel vl = params.get_VerboseLevel();
22 
24 }
25 
26 
27 //====================================================================
29 {
30  m_U = U;
31 
32  m_fopr->set_config(U);
34 }
35 
36 
37 //====================================================================
39 {
40  const int Nvol = CommonParameters::Nvol();
41  const int Ndim = CommonParameters::Ndim();
42 
43  const int NinF = m_fopr->field_nin();
44  const int NvolF = m_fopr->field_nvol();
45  const int NexF = m_fopr->field_nex();
46  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
47 
48  assert(NvolF == Nvol);
49  m_psf.reset(NinF, NvolF, NexF);
50 
51  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
52 
53  Field xi(NinF, NvolF, NexF);
54  rand->gauss_lex_global(xi);
55 
57  m_fopr->set_mode("Ddag");
58 
59  m_fopr->mult(m_psf, xi);
60 
61  const double xi2 = xi.norm();
62  const double H_psf = xi2 * xi2;
63 
64  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
65  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
66 
67  return H_psf;
68 }
69 
70 
71 //====================================================================
73 {
74  const int Nvol = CommonParameters::Nvol();
75  const int Ndim = CommonParameters::Ndim();
76 
77  const int NinF = m_fopr->field_nin();
78  const int NvolF = m_fopr->field_nvol();
79  const int NexF = m_fopr->field_nex();
80  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
81 
82  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
83 
84  Field v1(NinF, NvolF, NexF);
85  int Nconv;
86  double diff;
88  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
89 
90  vout.general(m_vl, " Fprop_H: %6d %18.15e\n", Nconv, diff);
91 
92  const double H_psf = dot(v1, m_psf);
93 
94  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
95  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
96 
97  return H_psf;
98 }
99 
100 
101 //====================================================================
103 {
104  const int Nin = m_U->nin();
105  const int Nvol = m_U->nvol();
106  const int Nex = m_U->nex();
107  const int Nc = CommonParameters::Nc();
108  const int Ndim = CommonParameters::Ndim();
109 
110  assert(force.nin() == Nin);
111  assert(force.nvol() == Nvol);
112  assert(force.nex() == Nex);
113 
114  const int NinF = m_fopr->field_nin();
115  const int NvolF = m_fopr->field_nvol();
116  const int NexF = m_fopr->field_nex();
117 
118 
119  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
120 
121  Field eta(NinF, NvolF, NexF);
122  int Nconv;
123  double diff;
125  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
126 
127  vout.detailed(m_vl, " Fprop_MD: %6d %18.15e\n", Nconv, diff);
128 
130 
131  m_fopr_force->force_core(force, eta);
132 
133  double Fave, Fmax, Fdev;
134  force.stat(Fave, Fmax, Fdev);
135  vout.general(m_vl,
136  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
137  Fave, Fmax, Fdev);
138 }
139 
140 
141 //====================================================================
142 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_config(Field *U)
setting pointer to the gauge configuration.
void detailed(const char *format,...)
Definition: bridgeIO.cpp:216
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
double calcH()
calculate Hamiltonian of this action term.
double langevin(RandomNumbers *)
Langevis step.
int nvol() const
Definition: field.h:127
Class for parameters.
Definition: parameters.h:46
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
virtual void invert_DdagD(Field &, const Field &, int &, double &)=0
double norm() const
Definition: field.h:222
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
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
void force(Field &)
returns force for molcular dynamical update of conjugate momenta.
void set_parameters(const Parameters &)
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
static const std::string class_name