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_lex.cpp
Go to the documentation of this file.
1
14
#include "
action_F_Standard_lex.h
"
15
16
//====================================================================
17
void
Action_F_Standard_lex::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_lex::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_lex:\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_lex::set_config
(
Field
*U)
44
{
45
m_U
= U;
46
47
m_fopr
->
set_config
(U);
48
m_fopr_force
->
set_config
(U);
49
}
50
51
52
//====================================================================
53
double
Action_F_Standard_lex::langevin
(
RandomNumbers
*rand)
54
{
55
int
Nvol =
CommonParameters::Nvol
();
56
int
Ndim =
CommonParameters::Ndim
();
57
58
int
NinF =
m_fopr
->
field_nin
();
59
int
NvolF =
m_fopr
->
field_nvol
();
60
int
NexF =
m_fopr
->
field_nex
();
61
int
size_psf = NinF * NvolF * NexF *
CommonParameters::NPE
();
62
63
assert(NvolF == Nvol);
64
m_psf
.
reset
(NinF, NvolF, NexF);
65
66
vout
.
general
(
m_vl
,
" Action_Fstandard_lex: %s\n"
,
m_label
.c_str());
67
68
Field
xi(NinF, NvolF, NexF);
69
rand->
gauss_lex_global
(xi);
70
71
m_fopr
->
set_config
(
m_U
);
72
m_fopr
->
set_mode
(
"Ddag"
);
73
74
m_psf
=
m_fopr
->
mult
(xi);
75
76
double
xi2 = xi.
norm
();
77
double
H_psf = xi2 * xi2;
78
79
vout
.
general
(
m_vl
,
" H_Fstandard = %18.8f\n"
, H_psf);
80
vout
.
general
(
m_vl
,
" H_F/dof = %18.8f\n"
, H_psf / size_psf);
81
82
return
H_psf;
83
}
84
85
86
//====================================================================
87
double
Action_F_Standard_lex::calcH
()
88
{
89
int
Nvol =
CommonParameters::Nvol
();
90
int
Ndim =
CommonParameters::Ndim
();
91
92
int
NinF =
m_fopr
->
field_nin
();
93
int
NvolF =
m_fopr
->
field_nvol
();
94
int
NexF =
m_fopr
->
field_nex
();
95
int
size_psf = NinF * NvolF * NexF *
CommonParameters::NPE
();
96
97
Field
v1(NinF, NvolF, NexF);
98
99
vout
.
detailed
(
m_vl
,
" Action_Fstandard_lex: %s\n"
,
m_label
.c_str());
100
101
int
Nconv;
102
double
diff;
103
104
m_fprop_H
->
set_config
(
m_U
);
105
m_fprop_H
->
invert_DdagD
(v1,
m_psf
, Nconv, diff);
106
107
vout
.
general
(
m_vl
,
" Fprop_H: %6d %18.15e\n"
, Nconv, diff);
108
109
double
H_psf = v1 *
m_psf
;
110
111
vout
.
general
(
m_vl
,
" H_Fstandard = %18.8f\n"
, H_psf);
112
vout
.
general
(
m_vl
,
" H_F/dof = %18.8f\n"
, H_psf / size_psf);
113
114
return
H_psf;
115
}
116
117
118
//====================================================================
119
const
Field
Action_F_Standard_lex::force
()
120
{
121
if
(
m_status_linkv
== 0) {
122
int
Nin =
m_U
->
nin
();
123
int
Nvol =
m_U
->
nvol
();
124
int
Nex =
m_U
->
nex
();
125
int
Nc =
CommonParameters::Nc
();
126
int
Ndim =
CommonParameters::Ndim
();
127
128
int
NinF =
m_fopr
->
field_nin
();
129
int
NvolF =
m_fopr
->
field_nvol
();
130
int
NexF =
m_fopr
->
field_nex
();
131
Field
eta(NinF, NvolF, NexF);
132
133
vout
.
detailed
(
m_vl
,
" Action_Fstandard_lex: %s\n"
,
m_label
.c_str());
134
135
int
Nconv;
136
double
diff;
137
138
m_fprop_MD
->
set_config
(
m_U
);
139
m_fprop_MD
->
invert_DdagD
(eta,
m_psf
, Nconv, diff);
140
141
vout
.
detailed
(
m_vl
,
" Fprop_MD: %6d %18.15e\n"
, Nconv, diff);
142
143
m_fopr_force
->
set_config
(
m_U
);
144
145
Field
force
(Nin, Nvol, Nex);
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_lex.cpp
Generated on Tue Jul 23 2013 10:48:47 for Bridge++ by
1.8.3.1