Bridge++
Ver. 1.1.x
Main Page
Namespaces
Classes
Files
File List
File Members
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
//====================================================================
17
void
Action_F_Standard_eo::set_parameters
(
const
Parameters
& params)
18
{
19
Bridge::VerboseLevel
vl
= params.
get_VerboseLevel
();
20
21
set_parameter_verboselevel
(vl);
22
}
23
24
25
//====================================================================
26
void
Action_F_Standard_eo::set_parameters
()
27
{
28
int
Nc =
CommonParameters::Nc
();
29
int
Nvol =
CommonParameters::Nvol
();
30
int
Ndim =
CommonParameters::Ndim
();
31
int
NinG = 2 * Nc * Nc;
32
33
vout
.
detailed
(
m_vl
,
"Action_Fstandard_eo:\n"
);
34
35
m_force
.
reset
(NinG, Nvol, Ndim);
36
37
// link variable update flag
38
m_status_linkv
= 0;
39
}
40
41
42
//====================================================================
43
void
Action_F_Standard_eo::set_config
(
Field
*U)
44
{
45
m_U
= U;
46
47
//- NB. only solver part is even-odd preconditioned.
48
m_fopr
->
set_config
(U);
49
m_fopr_force
->
set_config
(U);
50
}
51
52
53
//====================================================================
54
double
Action_F_Standard_eo::langevin
(
RandomNumbers
*rand)
55
{
56
int
Nvol =
CommonParameters::Nvol
();
57
int
Ndim =
CommonParameters::Ndim
();
58
59
int
NinF =
m_fopr
->
field_nin
();
60
int
NvolF =
m_fopr
->
field_nvol
();
61
int
NexF =
m_fopr
->
field_nex
();
62
int
size_psf = NinF * NvolF * NexF *
CommonParameters::NPE
();
63
64
assert(NvolF == Nvol);
65
m_psf
.
reset
(NinF, NvolF, NexF);
66
67
vout
.
general
(
m_vl
,
" Action_Fstandard_eo: %s\n"
,
m_label
.c_str());
68
69
Field
xi(NinF, NvolF, NexF);
70
rand->
gauss_lex_global
(xi);
71
72
m_fopr
->
set_config
(
m_U
);
73
m_fopr
->
set_mode
(
"Ddag"
);
74
75
m_psf
=
m_fopr
->
mult
(xi);
76
77
double
xi2 = xi.
norm
();
78
double
H_psf = xi2 * xi2;
79
80
vout
.
general
(
m_vl
,
" H_Fstandard = %18.8f\n"
, H_psf);
81
vout
.
general
(
m_vl
,
" H_F/dof = %18.8f\n"
, H_psf / size_psf);
82
83
return
H_psf;
84
}
85
86
87
//====================================================================
88
double
Action_F_Standard_eo::calcH
()
89
{
90
int
Nvol =
CommonParameters::Nvol
();
91
int
Ndim =
CommonParameters::Ndim
();
92
93
int
NinF =
m_fopr
->
field_nin
();
94
int
NvolF =
m_fopr
->
field_nvol
();
95
int
NexF =
m_fopr
->
field_nex
();
96
int
size_psf = NinF * NvolF * NexF *
CommonParameters::NPE
();
97
98
Field
v1(NinF, NvolF, NexF);
99
100
vout
.
detailed
(
m_vl
,
" Action_Fstandard_eo: %s\n"
,
m_label
.c_str());
101
102
int
Nconv;
103
double
diff;
104
105
m_fprop_H
->
set_config
(
m_U
);
106
m_fprop_H
->
invert_DdagD
(v1,
m_psf
, Nconv, diff);
107
108
double
H_psf = v1 *
m_psf
;
109
110
vout
.
general
(
m_vl
,
" H_Fstandard = %18.8f\n"
, H_psf);
111
vout
.
general
(
m_vl
,
" H_F/dof = %18.8f\n"
, H_psf / size_psf);
112
113
return
H_psf;
114
}
115
116
117
//====================================================================
118
const
Field
Action_F_Standard_eo::force
()
119
{
120
if
(
m_status_linkv
== 0) {
121
int
Nin =
m_U
->
nin
();
122
int
Nvol =
m_U
->
nvol
();
123
int
Nex =
m_U
->
nex
();
124
int
Nc =
CommonParameters::Nc
();
125
int
Ndim =
CommonParameters::Ndim
();
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
,
" Action_Fstandard_eo: %s\n"
,
m_label
.c_str());
133
134
int
Nconv;
135
double
diff;
136
137
m_fprop_MD
->
set_config
(
m_U
);
138
m_fprop_MD
->
invert_DdagD
(eta,
m_psf
, Nconv, diff);
139
140
// force of smeared fermion operator
141
m_fopr_force
->
set_config
(
m_U
);
142
143
Field
force
(Nin, Nvol, Nex);
144
Field
force1(Nin, Nvol, Nex);
145
146
force =
m_fopr_force
->
force_core
(eta);
147
148
m_force
=
force
;
149
++
m_status_linkv
;
150
151
double
Fave, Fmax, Fdev;
152
m_force
.
stat
(Fave, Fmax, Fdev);
153
vout
.
general
(
m_vl
,
154
" Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n"
,
155
Fave, Fmax, Fdev);
156
157
return
m_force
;
158
}
else
{
159
vout
.
general
(
m_vl
,
" Fstandard returns previous force.\n"
);
160
return
m_force
;
161
}
162
}
163
164
165
//====================================================================
166
//============================================================END=====
src
Action
action_F_Standard_eo.cpp
Generated on Tue Jul 23 2013 10:48:47 for Bridge++ by
1.8.3.1