16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Source_Exponential::register_factory();
33 std::vector<int> source_position;
63 const double slope,
const double power)
69 std::vector<int> Lsize(Ndim);
77 std::vector<int> Nsize(Ndim);
85 for (
int mu = 0; mu < Ndim; ++mu) {
87 mu, source_position[mu]);
94 for (
int mu = 0; mu < Ndim; ++mu) {
105 assert(source_position.size() == Ndim);
109 for (
int mu = 0; mu < Ndim; ++mu) {
118 const int Lvol3 = Lsize[0] * Lsize[1] * Lsize[2];
119 const int Nvol3 = Nsize[0] * Nsize[1] * Nsize[2];
138 for (
int z = -Lsize[2] + 1; z < Lsize[2]; ++z) {
139 for (
int y = -Lsize[1] + 1; y < Lsize[1]; ++y) {
140 for (
int x = -Lsize[0] + 1; x < Lsize[0]; ++x) {
147 int xpe = x2 / Nsize[0];
148 int ype = y2 / Nsize[1];
149 int zpe = z2 / Nsize[2];
152 int xl = x2 % Nsize[0];
153 int yl = y2 % Nsize[1];
154 int zl = z2 % Nsize[2];
162 double r = sqrt((
double)(x * x + y * y + z * z));
164 double expf = exp(-
m_slope * ex);
166 int lsite = xl + Nsize[0] * (yl + Nsize[1] * zl);
176 for (
int i = 0; i < Nvol3; ++i) {
188 for (
int i = 0; i < Nvol3; i++) {
198 if (fabs(sqrt(Fnorm_global) - 1.0) > epsilon_criterion2) {
202 fabs(sqrt(Fnorm_global) - 1.0));
214 std::vector<int> Nsize(Ndim);
227 for (
int z = 0; z < Nsize[2]; ++z) {
228 for (
int y = 0; y < Nsize[1]; ++y) {
229 for (
int x = 0; x < Nsize[0]; ++x) {
230 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
247 const int idx = i_color + Nc * i_spin;
259 std::vector<int> Nsize(Ndim);
272 for (
int z = 0; z < Nsize[2]; ++z) {
273 for (
int y = 0; y < Nsize[1]; ++y) {
274 for (
int x = 0; x < Nsize[0]; ++x) {
275 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
279 for (
int i_color = 0; i_color < Nc; ++i_color) {
280 int idx = i_color + Nc * i_spin;
300 std::vector<int> Nsize(Ndim);
313 for (
int z = 0; z < Nsize[2]; ++z) {
314 for (
int y = 0; y < Nsize[1]; ++y) {
315 for (
int x = 0; x < Nsize[0]; ++x) {
316 int lsite = x + Nsize[0] * (y + Nsize[1] * z);
320 for (
int idx = 0;
idx < Nc * Nd; ++
idx) {