16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Source_MomentumWall::register_factory();
27 const string str_vlevel = params.
get_string(
"verbose_level");
32 std::vector<int> source_position;
33 std::vector<int> source_momentum;
50 const std::vector<int>& source_momentum)
54 const int t_dir = Ndim - 1;
57 std::vector<int> Lsize(Ndim);
68 vout.
general(
m_vl,
"Source for spinor field - momentum wall smeared:\n");
69 for (
int mu = 0; mu < Ndim; ++mu) {
71 mu, source_position[mu]);
73 for (
int mu = 0; mu < Ndim - 1; ++mu) {
75 mu, source_momentum[mu]);
81 for (
int mu = 0; mu < Ndim; ++mu) {
93 for (
int mu = 0; mu < Ndim; ++mu) {
120 const int t_dir = Ndim - 1;
126 const int Lvol3 = Lx * Ly * Lz;
134 static const double PI = 4.0 * atan(1.0);
136 std::vector<double> p_unit(Ndim - 1);
142 std::vector<int> ipe(Ndim - 1);
153 for (
int z = 0; z < Nz; ++z) {
154 for (
int y = 0; y < Ny; ++y) {
155 for (
int x = 0; x < Nx; ++x) {
158 int x_global = x + ipe[x_dir] * Nx;
159 int y_global = y + ipe[y_dir] * Ny;
160 int z_global = z + ipe[z_dir] * Nz;
166 double theta = p_x + p_y + p_z;
169 int idx_i = 2 * idx + 1;
172 src.
set(idx_r, site, 0, cos(theta) / Lvol3);
173 src.
set(idx_i, site, 0, sin(theta) / Lvol3);
185 const int idx = i_color + Nc * i_spin;
200 const int t_dir = Ndim - 1;
206 const int Lvol3 = Lx * Ly * Lz;
214 static const double PI = 4.0 * atan(1.0);
216 std::vector<double> p_unit(Ndim - 1);
222 std::vector<int> ipe(Ndim - 1);
233 for (
int z = 0; z < Nz; ++z) {
234 for (
int y = 0; y < Ny; ++y) {
235 for (
int x = 0; x < Nx; ++x) {
238 int x_global = x + ipe[x_dir] * Nx;
239 int y_global = y + ipe[y_dir] * Ny;
240 int z_global = z + ipe[z_dir] * Nz;
246 double theta = p_x + p_y + p_z;
248 for (
int i_color = 0; i_color < Nc; ++i_color) {
249 int idx = i_color + Nc * i_spin;
251 int idx_i = 2 * idx + 1;
254 src.
set(idx_r, site, 0, cos(theta) / Lvol3);
255 src.
set(idx_i, site, 0, sin(theta) / Lvol3);
274 const int t_dir = Ndim - 1;
280 const int Lvol3 = Lx * Ly * Lz;
288 static const double PI = 4.0 * atan(1.0);
290 std::vector<double> p_unit(Ndim - 1);
296 std::vector<int> ipe(Ndim - 1);
307 for (
int z = 0; z < Nz; ++z) {
308 for (
int y = 0; y < Ny; ++y) {
309 for (
int x = 0; x < Nx; ++x) {
312 int x_global = x + ipe[x_dir] * Nx;
313 int y_global = y + ipe[y_dir] * Ny;
314 int z_global = z + ipe[z_dir] * Nz;
320 double theta = p_x + p_y + p_z;
322 for (
int idx = 0; idx < Nc * Nd; ++idx) {
324 int idx_i = 2 * idx + 1;
327 src.
set(idx_r, site, 0, cos(theta) / Lvol3);
328 src.
set(idx_i, site, 0, sin(theta) / Lvol3);
void set_all_color_spin(Field &v)
void set(const int jin, const int site, const int jex, double v)
int site(const int &x, const int &y, const int &z, const int &t) const
std::vector< int > m_source_momentum
void general(const char *format,...)
static const std::string class_name
Container of Field-type object.
static int ipe(const int dir)
logical coordinate of current proc.
void set_all_color(Field &v, const int i_spin)
void crucial(const char *format,...)
Bridge::VerboseLevel m_vl
int non_negative(const int v)
string get_string(const string &key) const
int fetch_int_vector(const string &key, vector< int > &value) const
std::vector< int > m_source_position
void set_parameters(const Parameters ¶ms)
static VerboseLevel set_verbose_level(const std::string &str)
void set(Field &v, const int idx)