26 bool init = Source::Factory::Register(
"Exponential", create_object);
37 const string str_vlevel = params.
get_string(
"verbose_level");
42 std::vector<int> source_position;
61 const double slope,
const double power)
67 std::vector<int> Lsize(Ndim);
75 std::vector<int> Nsize(Ndim);
83 for (
int mu = 0; mu < Ndim; ++mu) {
85 mu, source_position[mu]);
92 for (
int mu = 0; mu < Ndim; ++mu) {
103 assert(source_position.size() == Ndim);
107 for (
int mu = 0; mu < Ndim; ++mu) {
116 const int Lvol3 = Lsize[0] * Lsize[1] * Lsize[2];
117 const int Nvol3 = Nsize[0] * Nsize[1] * Nsize[2];
136 for (
int z = -Lsize[2] + 1; z < Lsize[2]; ++z) {
137 for (
int y = -Lsize[1] + 1; y < Lsize[1]; ++y) {
138 for (
int x = -Lsize[0] + 1; x < Lsize[0]; ++x) {
145 int xpe = x2 / Nsize[0];
146 int ype = y2 / Nsize[1];
147 int zpe = z2 / Nsize[2];
150 int xl = x2 % Nsize[0];
151 int yl = y2 % Nsize[1];
152 int zl = z2 % Nsize[2];
160 double r = sqrt((
double)(x * x + y * y + z * z));
162 double expf = exp(-
m_slope * ex);
164 int lsite = xl + Nsize[0] * (yl + Nsize[1] * zl);
174 for (
int i = 0; i < Nvol3; ++i) {
186 for (
int i = 0; i < Nvol3; i++) {
193 double epsilon_criterion2 = epsilon_criterion *
196 if (abs(sqrt(Fnorm_global) - 1.0) > epsilon_criterion2) {
200 abs(sqrt(Fnorm_global) - 1.0));
212 std::vector<int> Nsize(Ndim);
225 for (
int z = 0; z < Nsize[2]; ++z) {
226 for (
int y = 0; y < Nsize[1]; ++y) {
227 for (
int x = 0; x < Nsize[0]; ++x) {
228 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
void scal(Field &x, const double a)
scal(x, a): x = a * x
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.
int fetch_double(const string &key, double &value) const
double cmp(const int jin, const int site, const int jex) const
static int ipe(const int dir)
logical coordinate of current proc.
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
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...
std::vector< int > m_source_position
void set_parameters(const Parameters ¶ms)
Base class of source for a linear solver.
string get_string(const string &key) const
int fetch_int_vector(const string &key, vector< int > &value) const
static VerboseLevel set_verbose_level(const std::string &str)