Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fprop_Standard_eo.cpp
Go to the documentation of this file.
1 
14 #include "fprop_Standard_eo.h"
15 
16 const std::string Fprop_Standard_eo::class_name = "Fprop_Standard_eo";
17 
18 //====================================================================
20 {
21  m_index->convertField(*m_Ueo, *U);
22 
23  // m_solver->get_fopr()->set_config(m_Ueo);
25 }
26 
27 
28 //====================================================================
29 void Fprop_Standard_eo::invert_D(Field& xq, const Field& b, int& Nconv, double& diff)
30 {
31  int Nin = b.nin();
32  int Nvol = b.nvol();
33  int Nex = b.nex();
34 
35  Field Be(Nin, Nvol / 2, Nex);
36  Field bo(Nin, Nvol / 2, Nex);
37  Field xe(Nin, Nvol / 2, Nex);
38 
39  int Nconv1;
40 
41  Fopr_eo *fopr = (Fopr_eo *)m_solver->get_fopr();
42 
43  fopr->set_mode("D");
44  fopr->preProp(Be, bo, b);
45 
46 #pragma omp parallel
47  {
48  m_solver->solve(xe, Be, Nconv1, diff);
49  }
50 
51  fopr->postProp(xq, xe, bo);
52 
53  //- NB. #mult is doubled for even-odd
54  Nconv = 2 * Nconv1;
55 }
56 
57 
58 //====================================================================
59 void Fprop_Standard_eo::invert_DdagD(Field& xq, const Field& b, int& Nconv, double& diff)
60 {
61  int Nin = b.nin();
62  int Nvol = b.nvol();
63  int Nex = b.nex();
64 
65  Field Be(Nin, Nvol / 2, Nex);
66  Field bo(Nin, Nvol / 2, Nex);
67  Field xe(Nin, Nvol / 2, Nex);
68 
69  int Nconv1, Nconv2;
70  double diff1, diff2;
71 
72  Fopr_eo *fopr = (Fopr_eo *)m_solver->get_fopr();
73 
74  fopr->set_mode("Ddag");
75  fopr->preProp(Be, bo, b);
76 
77 #pragma omp parallel
78  {
79  m_solver->solve(xe, Be, Nconv1, diff1);
80  }
81 
82  fopr->postProp(xq, xe, bo);
83 
84  fopr->set_mode("D");
85  fopr->preProp(Be, bo, xq);
86 
87 #pragma omp parallel
88  {
89  m_solver->solve(xe, Be, Nconv2, diff2);
90  }
91 
92  fopr->postProp(xq, xe, bo);
93 
94  //- NB. #mult is doubled for even-odd
95  Nconv = 2 * (Nconv1 + Nconv2);
96 
97  //- rough estimate of diff
98  diff = (diff1 + diff2) / 2.0;
99 }
100 
101 
102 //====================================================================
103 //============================================================END=====
void set_config(Field *)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
virtual void postProp(Field &, const Field &, const Field &)=0
Container of Field-type object.
Definition: field.h:37
static const std::string class_name
int nvol() const
Definition: field.h:101
virtual Fopr * get_fopr()=0
void invert_D(Field &, const Field &, int &, double &)
void convertField(Field &eo, const Field &lex)
Definition: index_eo.cpp:20
int nin() const
Definition: field.h:100
void invert_DdagD(Field &, const Field &, int &, double &)
Base class of fermion operator family.
Definition: fopr_eo.h:33
int nex() const
Definition: field.h:102
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_eo.h:63
virtual void preProp(Field &, Field &, const Field &)=0
virtual void solve(Field &solution, const Field &source, int &Nconv, double &diff)=0