Bridge++  Ver. 2.0.2
source_Local.h
Go to the documentation of this file.
1 
14 #ifndef SOURCE_LOCAL_INCLUDED
15 #define SOURCE_LOCAL_INCLUDED
16 
17 #include "source.h"
18 #include "Field/index_lex.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
34 class Source_Local : public Source {
35  public:
36  static const std::string class_name;
37 
38  private:
40 
41  Index_lex m_index; // lexical only.
42  std::vector<int> m_source_position;
43  bool m_in_node;
44 
45  public:
47 
48  Source_Local(const Parameters& params)
49  : m_vl(CommonParameters::Vlevel())
50  {
51  set_parameters(params);
52  }
53 
54  void set_parameters(const Parameters& params);
55  void set_parameters(const std::vector<int>& source_position);
56 
57  void get_parameters(Parameters& params) const;
58 
59  void set(Field& v, const int idx);
60  void set(Field& v, const int i_color, const int i_spin);
61  void set_all_color(Field& v, const int i_spin);
62  void set_all_color_spin(Field& v);
63 
64 #ifdef USE_FACTORY
65  private:
66  static Source *create_object()
67  {
68  return new Source_Local();
69  }
70 
71  static Source *create_object_with_params(const Parameters& params)
72  {
73  return new Source_Local(params);
74  }
75 
76  public:
77  static bool register_factory()
78  {
79  bool init = true;
80  init &= Source::Factory::Register("Local", create_object);
81  init &= Source::Factory_params::Register("Local", create_object_with_params);
82  return init;
83  }
84 #endif
85 };
86 #endif /* SOURCE_LOCAL_INCLUDED */
bridgeIO.h
Source_Local::Source_Local
Source_Local()
Definition: source_Local.h:46
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
Index_lex
Lexical site index.
Definition: index_lex.h:34
Source_Local::set_all_color_spin
void set_all_color_spin(Field &v)
Definition: source_Local.cpp:188
Parameters
Class for parameters.
Definition: parameters.h:46
Source_Local::m_source_position
std::vector< int > m_source_position
Definition: source_Local.h:42
Source_Local::m_index
Index_lex m_index
Definition: source_Local.h:41
Source_Local::get_parameters
void get_parameters(Parameters &params) const
Definition: source_Local.cpp:48
source.h
Source
Base class of source for a linear solver.
Definition: source.h:37
AIndex_eo_qxs::idx
int idx(const int in, const int Nin, const int ist, const int Nx2, const int Ny, const int leo, const int Nvol2, const int ex)
Definition: aindex_eo.h:27
index_lex.h
Source_Local::set_parameters
void set_parameters(const Parameters &params)
Definition: source_Local.cpp:25
Source_Local::m_in_node
bool m_in_node
Definition: source_Local.h:43
Source_Local::class_name
static const std::string class_name
Definition: source_Local.h:36
Source_Local::Source_Local
Source_Local(const Parameters &params)
Definition: source_Local.h:48
Source_Local
Local source for 4-spinor fermion.
Definition: source_Local.h:34
Source_Local::set
void set(Field &v, const int idx)
Definition: source_Local.cpp:135
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Source_Local::set_all_color
void set_all_color(Field &v, const int i_spin)
Definition: source_Local.cpp:163
Source_Local::m_vl
Bridge::VerboseLevel m_vl
Definition: source_Local.h:39
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512