16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Source_Exponential::register_factory();
27 const string str_vlevel = params.
get_string(
"verbose_level");
32 std::vector<int> source_position;
51 const double slope,
const double power)
57 std::vector<int> Lsize(Ndim);
65 std::vector<int> Nsize(Ndim);
73 for (
int mu = 0; mu < Ndim; ++mu) {
75 mu, source_position[mu]);
82 for (
int mu = 0; mu < Ndim; ++mu) {
93 assert(source_position.size() == Ndim);
97 for (
int mu = 0; mu < Ndim; ++mu) {
106 const int Lvol3 = Lsize[0] * Lsize[1] * Lsize[2];
107 const int Nvol3 = Nsize[0] * Nsize[1] * Nsize[2];
126 for (
int z = -Lsize[2] + 1; z < Lsize[2]; ++z) {
127 for (
int y = -Lsize[1] + 1; y < Lsize[1]; ++y) {
128 for (
int x = -Lsize[0] + 1; x < Lsize[0]; ++x) {
135 int xpe = x2 / Nsize[0];
136 int ype = y2 / Nsize[1];
137 int zpe = z2 / Nsize[2];
140 int xl = x2 % Nsize[0];
141 int yl = y2 % Nsize[1];
142 int zl = z2 % Nsize[2];
150 double r = sqrt((
double)(x * x + y * y + z * z));
152 double expf = exp(-
m_slope * ex);
154 int lsite = xl + Nsize[0] * (yl + Nsize[1] * zl);
164 for (
int i = 0; i < Nvol3; ++i) {
176 for (
int i = 0; i < Nvol3; i++) {
186 if (abs(sqrt(Fnorm_global) - 1.0) > epsilon_criterion2) {
190 abs(sqrt(Fnorm_global) - 1.0));
202 std::vector<int> Nsize(Ndim);
215 for (
int z = 0; z < Nsize[2]; ++z) {
216 for (
int y = 0; y < Nsize[1]; ++y) {
217 for (
int x = 0; x < Nsize[0]; ++x) {
218 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
235 const int idx = i_color + Nc * i_spin;
247 std::vector<int> Nsize(Ndim);
260 for (
int z = 0; z < Nsize[2]; ++z) {
261 for (
int y = 0; y < Nsize[1]; ++y) {
262 for (
int x = 0; x < Nsize[0]; ++x) {
263 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
267 for (
int i_color = 0; i_color < Nc; ++i_color) {
268 int idx = i_color + Nc * i_spin;
288 std::vector<int> Nsize(Ndim);
301 for (
int z = 0; z < Nsize[2]; ++z) {
302 for (
int y = 0; y < Nsize[1]; ++y) {
303 for (
int x = 0; x < Nsize[0]; ++x) {
304 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
308 for (
int idx = 0; idx < Nc * Nd; ++idx) {
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 set(Field &v, const int idx)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::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)
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_all_color_spin(Field &v)
void set_parameters(const Parameters ¶ms)
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)
void set_all_color(Field &v, const int i_spin)