Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
39  Index_lex m_index; // lexical only.
40  std::vector<int> m_source_position;
41  bool m_in_node;
42 
43  public:
45  : Source() {}
46 
47  void set_parameters(const Parameters& params);
48  void set_parameters(const std::vector<int>& source_position);
49 
50  void set(Field& v, const int idx);
51  void set(Field& v, const int i_color, const int i_spin);
52  void set_all_color(Field& v, const int i_spin);
53  void set_all_color_spin(Field& v);
54 
55 #ifdef USE_FACTORY
56  private:
57  static Source *create_object()
58  {
59  return new Source_Local();
60  }
61 
62  public:
63  static bool register_factory()
64  {
65  return Source::Factory::Register("Local", create_object);
66  }
67 #endif
68 };
69 #endif /* SOURCE_LOCAL_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:503
static const std::string class_name
Definition: source_Local.h:36
void set_all_color_spin(Field &v)
Index_lex m_index
Definition: source_Local.h:39
Container of Field-type object.
Definition: field.h:45
Class for parameters.
Definition: parameters.h:46
void set_parameters(const Parameters &params)
Local source for 4-spinor fermion.
Definition: source_Local.h:34
Lexical site index.
Definition: index_lex.h:34
void set_all_color(Field &v, const int i_spin)
void set(Field &v, const int idx)
Base class of source for a linear solver.
Definition: source.h:37
std::vector< int > m_source_position
Definition: source_Local.h:40