Bridge++  Ver. 2.0.2
fopr_Staggered.h
Go to the documentation of this file.
1 
10 #ifndef FOPR_STAGGERED_INCLUDED
11 #define FOPR_STAGGERED_INCLUDED
12 
13 #include "Fopr/fopr.h"
14 //#include "Field/field_F_1spinor.h"
15 
16 //#include "Field/shiftField_lex.h"
17 
18 #include "IO/bridgeIO.h"
19 using Bridge::vout;
20 
22 
29 class Fopr_Staggered : public Fopr
30 {
31  public:
32  static const std::string class_name;
33 
34  private:
35  // input parameters
36  double m_mq;
37  std::vector<int> m_boundary;
39 
40  std::string m_mode;
41 
42  // internal data members
43  int m_Nc, m_Nvc, m_Ndf;
44  int m_Nx, m_Ny, m_Nz, m_Nt;
45  int m_Nvol, m_Ndim;
46 
49 
51 
54 
56  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
57  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
58  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
59  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
60 
61  public:
63  Fopr_Staggered(const Parameters& params) { init(params); }
64 
66  Fopr_Staggered() : Fopr() { init(); }
67 
70 
71  void set_parameters(const Parameters& params);
72 
73  void set_parameters(const double mq, const std::vector<int> bc);
74 
75  void get_parameters(Parameters& params) const;
76 
77  void set_config(Field *U);
78 
79  void set_mode(std::string mode);
80 
81  std::string get_mode() const { return m_mode; }
82 
83  void mult(Field&, const Field&);
84 
85  void mult_dag(Field&, const Field&);
86 
87  void mult_gm5(Field&, const Field&);
88 
89  void D(Field&, const Field&);
90  void Ddag(Field&, const Field&);
91  void DdagD(Field&, const Field&);
92  void H(Field&, const Field&);
93 
94  void mult_gm5(Field&);
95 
96  void mult_staggered_phase(Field&, int mu);
97 
98  void normalize_fprop(Field& v) { scal(v, 1.0 / m_mq); }
99 
100  void normalize_fopr_(Field& v) { scal(v, m_mq); }
101 
102  int field_nin() { return 2 * m_Nc; }
103  int field_nvol() { return m_Nvol; }
104  int field_nex() { return 1; }
105 
107  double flop_count() { return flop_count(m_mode); }
108 
110  double flop_count(const std::string mode);
111 
112  private:
114  void init();
115 
116  void init(const Parameters& params);
117 
118  void setup();
119 
121  void tidyup();
122 
123  void set_staggered_phase();
124 
125  void set_config_omp(Field *U);
126 
127  void set_config_impl(Field *U);
128 
129  void mult_xp(Field&, const Field&);
130  void mult_xm(Field&, const Field&);
131  void mult_yp(Field&, const Field&);
132  void mult_ym(Field&, const Field&);
133  void mult_zp(Field&, const Field&);
134  void mult_zm(Field&, const Field&);
135  void mult_tp(Field&, const Field&);
136  void mult_tm(Field&, const Field&);
137 
138 #ifdef USE_FACTORY
139  private:
140  static Fopr *create_object() { return new Fopr_Staggered(); }
141 
142  static Fopr *create_object_with_params(const Parameters& params)
143  { return new Fopr_Staggered(params); }
144 
145  public:
146  static bool register_factory()
147  {
148  bool init = true;
149  init &= Fopr::Factory_noarg::Register("Staggered", create_object);
150  init &= Fopr::Factory_params::Register("Staggered",
151  create_object_with_params);
152  return init;
153  }
154 #endif
155 };
156 #endif
Fopr_Staggered
Staggered fermion operator.
Definition: fopr_Staggered.h:29
Fopr_Staggered::m_v2
Field m_v2
working field
Definition: fopr_Staggered.h:53
Fopr_Staggered::vcp1_xm
double * vcp1_xm
Definition: fopr_Staggered.h:56
Fopr_Staggered::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Staggered.cpp:205
bridgeIO.h
Fopr_Staggered::m_mq
double m_mq
quark mass.
Definition: fopr_Staggered.h:36
Fopr_Staggered::mult_xm
void mult_xm(Field &, const Field &)
Definition: fopr_Staggered.cpp:604
Fopr_Staggered::vcp1_zm
double * vcp1_zm
Definition: fopr_Staggered.h:58
Fopr_Staggered::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Staggered.cpp:145
Fopr_Staggered::init
void init()
initial setup.
Definition: fopr_Staggered.cpp:53
AFopr< Field >
Fopr_Staggered::H
void H(Field &, const Field &)
Definition: fopr_Staggered.cpp:396
Parameters
Class for parameters.
Definition: parameters.h:46
Fopr_Staggered::m_mode
std::string m_mode
mult mode
Definition: fopr_Staggered.h:40
Fopr_Staggered::set_mode
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_Staggered.cpp:350
Fopr_Staggered::get_mode
std::string get_mode() const
Definition: fopr_Staggered.h:81
Fopr_Staggered::mult_dag
void mult_dag(Field &, const Field &)
hermitian conjugate of mult.
Definition: fopr_Staggered.cpp:378
Fopr_Staggered::vcp2_zp
double * vcp2_zp
Definition: fopr_Staggered.h:58
Fopr_Staggered::vcp2_ym
double * vcp2_ym
Definition: fopr_Staggered.h:57
Fopr_Staggered::mult_xp
void mult_xp(Field &, const Field &)
Definition: fopr_Staggered.cpp:539
Fopr_Staggered::vcp1_xp
double * vcp1_xp
communication buffer
Definition: fopr_Staggered.h:56
Fopr_Staggered::mult_zm
void mult_zm(Field &, const Field &)
Definition: fopr_Staggered.cpp:884
Fopr_Staggered::m_Nvol
int m_Nvol
Definition: fopr_Staggered.h:45
Fopr_Staggered::vcp2_xp
double * vcp2_xp
Definition: fopr_Staggered.h:56
Fopr_Staggered::m_Ndim
int m_Ndim
Definition: fopr_Staggered.h:45
Fopr_Staggered::set_config_impl
void set_config_impl(Field *U)
Definition: fopr_Staggered.cpp:329
Fopr_Staggered::m_Nx
int m_Nx
Definition: fopr_Staggered.h:44
Fopr_Staggered::mult
void mult(Field &, const Field &)
multiplies fermion operator to a given field.
Definition: fopr_Staggered.cpp:360
Fopr_Staggered::vcp1_ym
double * vcp1_ym
Definition: fopr_Staggered.h:57
Fopr_Staggered::mult_tp
void mult_tp(Field &, const Field &)
Definition: fopr_Staggered.cpp:957
Fopr_Staggered::setup
void setup()
Definition: fopr_Staggered.cpp:69
Fopr_Staggered::m_Nt
int m_Nt
Definition: fopr_Staggered.h:44
Fopr_Staggered::m_stg_phase
Field m_stg_phase
staggered phase
Definition: fopr_Staggered.h:47
Fopr_Staggered::vcp2_zm
double * vcp2_zm
Definition: fopr_Staggered.h:58
Fopr_Staggered::flop_count
double flop_count()
returns the number of floating point operations.
Definition: fopr_Staggered.h:107
Fopr_Staggered::~Fopr_Staggered
~Fopr_Staggered()
destructor.
Definition: fopr_Staggered.h:69
Fopr_Staggered::m_Nvc
int m_Nvc
Definition: fopr_Staggered.h:43
Fopr_Staggered::set_config_omp
void set_config_omp(Field *U)
Definition: fopr_Staggered.cpp:319
Fopr_Staggered::DdagD
void DdagD(Field &, const Field &)
Definition: fopr_Staggered.cpp:404
Fopr_Staggered::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_Staggered.cpp:301
Fopr_Staggered::Fopr_Staggered
DEPRECATED Fopr_Staggered()
Definition: fopr_Staggered.h:66
Fopr_Staggered::mult_zp
void mult_zp(Field &, const Field &)
Definition: fopr_Staggered.cpp:811
Fopr_Staggered::m_Ny
int m_Ny
Definition: fopr_Staggered.h:44
Fopr_Staggered::vcp1_yp
double * vcp1_yp
Definition: fopr_Staggered.h:57
Fopr_Staggered::set_staggered_phase
void set_staggered_phase()
Definition: fopr_Staggered.cpp:214
Fopr_Staggered::normalize_fprop
void normalize_fprop(Field &v)
normalize propagator if necessary (default: do nothing)
Definition: fopr_Staggered.h:98
Fopr_Staggered::Ddag
void Ddag(Field &, const Field &)
Definition: fopr_Staggered.cpp:449
Fopr_Staggered::m_Ndf
int m_Ndf
Definition: fopr_Staggered.h:43
Fopr_Staggered::normalize_fopr_
void normalize_fopr_(Field &v)
Definition: fopr_Staggered.h:100
Fopr_Staggered::mult_gm5
void mult_gm5(Field &, const Field &)
multiplies gamma_5 matrix.
Definition: fopr_Staggered.cpp:484
Fopr_Staggered::m_U
Field_G m_U
gauge field multiplied by staggered phase.
Definition: fopr_Staggered.h:50
Fopr_Staggered::m_Nc
int m_Nc
Definition: fopr_Staggered.h:43
Fopr_Staggered::vcp2_tp
double * vcp2_tp
Definition: fopr_Staggered.h:59
Fopr_Staggered::vcp1_zp
double * vcp1_zp
Definition: fopr_Staggered.h:58
fopr.h
Fopr_Staggered::m_parity
Field m_parity
site parity field
Definition: fopr_Staggered.h:48
Fopr_Staggered::D
void D(Field &, const Field &)
Definition: fopr_Staggered.cpp:414
Fopr_Staggered::m_boundary
std::vector< int > m_boundary
boundary conditions.
Definition: fopr_Staggered.h:37
Fopr_Staggered::vcp2_yp
double * vcp2_yp
Definition: fopr_Staggered.h:57
Fopr_Staggered::vcp2_tm
double * vcp2_tm
Definition: fopr_Staggered.h:59
Fopr_Staggered::tidyup
void tidyup()
final clean-up.
Definition: fopr_Staggered.cpp:120
Fopr_Staggered::vcp1_tm
double * vcp1_tm
Definition: fopr_Staggered.h:59
scal
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:261
Fopr_Staggered::vcp2_xm
double * vcp2_xm
Definition: fopr_Staggered.h:56
Fopr_Staggered::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_Staggered.h:104
Fopr_Staggered::mult_ym
void mult_ym(Field &, const Field &)
Definition: fopr_Staggered.cpp:740
Fopr_Staggered::mult_staggered_phase
void mult_staggered_phase(Field &, int mu)
Definition: fopr_Staggered.cpp:280
Fopr_Staggered::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: fopr_Staggered.h:38
Fopr_Staggered::m_v1
Field m_v1
working field
Definition: fopr_Staggered.h:52
Fopr_Staggered::vcp1_tp
double * vcp1_tp
Definition: fopr_Staggered.h:59
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Fopr_Staggered::class_name
static const std::string class_name
Definition: fopr_Staggered.h:32
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Fopr_Staggered::Fopr_Staggered
Fopr_Staggered(const Parameters &params)
constructor.
Definition: fopr_Staggered.h:63
Fopr_Staggered::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_Staggered.h:103
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Fopr_Staggered::mult_tm
void mult_tm(Field &, const Field &)
Definition: fopr_Staggered.cpp:1024
Fopr_Staggered::m_Nz
int m_Nz
Definition: fopr_Staggered.h:44
Fopr_Staggered::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_Staggered.h:102
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Fopr_Staggered::mult_yp
void mult_yp(Field &, const Field &)
Definition: fopr_Staggered.cpp:669