16 #ifdef USE_PARAMETERS_FACTORY
30 bool init = Source::Factory::Register(
"MomentumWall", create_object);
45 #ifdef USE_PARAMETERS_FACTORY
60 const string str_vlevel = params.
get_string(
"verbose_level");
65 valarray<int> source_position;
66 valarray<double> source_momentum;
83 const valarray<double>& source_momentum)
89 valarray<int> Lsize(Ndim);
96 valarray<int> Nsize(Ndim);
102 const int t_dir = Ndim - 1;
105 vout.
general(
m_vl,
"Source for spinor field - momentum wall smeared:\n");
106 for (
int mu = 0; mu < Ndim; ++mu) {
108 mu, source_position[mu]);
110 for (
int mu = 0; mu < Ndim - 1; ++mu) {
112 mu, source_momentum[mu]);
118 for (
int mu = 0; mu < Ndim; ++mu) {
130 for (
int mu = 0; mu < Ndim; ++mu) {
159 const int Lvol3 = Lx * Ly * Lz;
162 valarray<int> Nsize(Ndim);
174 for (
int z = 0; z < Nsize[2]; ++z) {
175 for (
int y = 0; y < Nsize[1]; ++y) {
176 for (
int x = 0; x < Nsize[0]; ++x) {
189 src.
set(2 * j + 0, isite, 0, cos(theta) / Lvol3);
190 src.
set(2 * j + 1, isite, 0, sin(theta) / Lvol3);
std::valarray< int > m_source_position
void Register_string(const string &, const string &)
Momentum wall source for 4-spinor fermion.
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
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.
int fetch_int_vector(const string &key, std::valarray< int > &val) const
int fetch_double_vector(const string &key, std::valarray< double > &val) const
void set(Field &v, int j)
Parameters_Source_MomentumWall()
void crucial(const char *format,...)
static bool Register(const std::string &realm, const creator_callback &cb)
std::valarray< double > m_source_momentum
Bridge::VerboseLevel m_vl
int non_negative(const int v)
void Register_double_vector(const string &, const std::valarray< double > &)
void Register_int_vector(const string &, const std::valarray< int > &)
Base class of sources for a linear solver.
string get_string(const string &key) const
void set_parameters(const Parameters ¶ms)
static VerboseLevel set_verbose_level(const std::string &str)