16 #ifdef USE_PARAMETERS_FACTORY
30 bool init = Source::Factory::Register(
"Exponential", create_object);
46 #ifdef USE_PARAMETERS_FACTORY
61 const string str_vlevel = params.
get_string(
"verbose_level");
66 valarray<int> source_position;
85 const double slope,
const double power)
91 valarray<int> Lsize(Ndim);
98 valarray<int> Nsize(Ndim);
105 vout.
general(
m_vl,
"Source for spinor field - exponential smeared:\n");
106 for (
int mu = 0; mu < Ndim; ++mu) {
108 mu, source_position[mu]);
115 for (
int mu = 0; mu < Ndim; ++mu) {
126 assert(source_position.size() == Ndim);
130 for (
int mu = 0; mu < Ndim; ++mu) {
139 const int Lvol3 = Lsize[0] * Lsize[1] * Lsize[2];
140 const int Nvol3 = Nsize[0] * Nsize[1] * Nsize[2];
158 for (
int z = -Lsize[2] + 1; z < Lsize[2]; ++z) {
159 for (
int y = -Lsize[1] + 1; y < Lsize[1]; ++y) {
160 for (
int x = -Lsize[0] + 1; x < Lsize[0]; ++x) {
167 int xpe = x2 / Nsize[0];
168 int ype = y2 / Nsize[1];
169 int zpe = z2 / Nsize[2];
172 int xl = x2 % Nsize[0];
173 int yl = y2 % Nsize[1];
174 int zl = z2 % Nsize[2];
182 double r = sqrt((
double)(x * x + y * y + z * z));
184 double expf = exp(-
m_slope * ex);
186 int lsite = xl + Nsize[0] * (yl + Nsize[1] * zl);
196 for (
int i = 0; i < Nvol3; ++i) {
207 for (
int i = 0; i < Nvol3; i++) {
214 double epsilon_criterion2 = epsilon_criterion *
217 if (abs(sqrt(Fnorm_global) - 1.0) > epsilon_criterion2) {
221 abs(sqrt(Fnorm_global) - 1.0));
233 valarray<int> Nsize(Ndim);
245 for (
int z = 0; z < Nsize[2]; ++z) {
246 for (
int y = 0; y < Nsize[1]; ++y) {
247 for (
int x = 0; x < Nsize[0]; ++x) {
248 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
void Register_string(const string &, const string &)
static double epsilon_criterion()
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,...)
Container of Field-type object.
double cmp(const int jin, const int site, const int jex) const
static int ipe(const int dir)
logical coordinate of current proc.
int fetch_int_vector(const string &key, std::valarray< int > &val) const
Parameters_Source_Exponential()
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
void crucial(const char *format,...)
static const std::string class_name
static bool Register(const std::string &realm, const creator_callback &cb)
valarray< int > m_source_position
void add(const int jin, const int site, const int jex, double v)
void set(Field &v, int j)
Exponentially smeared source for 4-spinor fermion.
Bridge::VerboseLevel m_vl
int non_negative(const int v)
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
void Register_double(const string &, const double)
void Register_int_vector(const string &, const std::valarray< int > &)
void set_parameters(const Parameters ¶ms)
int fetch_double(const string &key, double &val) const
Base class of sources for a linear solver.
string get_string(const string &key) const
static VerboseLevel set_verbose_level(const std::string &str)