16 #ifdef USE_PARAMETERS_FACTORY
30 bool init = Source::Factory::Register(
"Exponential", create_object);
46 #ifdef USE_PARAMETERS_FACTORY
59 const string str_vlevel = params.
get_string(
"verbose_level");
64 valarray<int> source_position;
73 vout.
crucial(
m_vl,
"Source_Exponential: fetch error, input parameter not found.\n");
83 const double slope,
const double power)
89 valarray<int> Lsize(Ndim);
96 valarray<int> Nsize(Ndim);
103 vout.
general(
m_vl,
"Source for spinor field - exponential smeared:\n");
104 for (
int mu = 0; mu < Ndim; ++mu) {
106 mu, source_position[mu]);
113 for (
int mu = 0; mu < Ndim; ++mu) {
120 vout.
crucial(
m_vl,
"Source_Exponential: parameter range check failed.\n");
124 assert(source_position.size() == Ndim);
128 for (
int mu = 0; mu < Ndim; ++mu) {
137 const int Lvol3 = Lsize[0] * Lsize[1] * Lsize[2];
138 const int Nvol3 = Nsize[0] * Nsize[1] * Nsize[2];
156 for (
int z = -Lsize[2] + 1; z < Lsize[2]; ++z) {
157 for (
int y = -Lsize[1] + 1; y < Lsize[1]; ++y) {
158 for (
int x = -Lsize[0] + 1; x < Lsize[0]; ++x) {
165 int xpe = x2 / Nsize[0];
166 int ype = y2 / Nsize[1];
167 int zpe = z2 / Nsize[2];
170 int xl = x2 % Nsize[0];
171 int yl = y2 % Nsize[1];
172 int zl = z2 % Nsize[2];
180 double r = sqrt((
double)(x * x + y * y + z * z));
182 double expf = exp(-
m_slope * ex);
184 int lsite = xl + Nsize[0] * (yl + Nsize[1] * zl);
194 for (
int i = 0; i < Nvol3; ++i) {
205 for (
int i = 0; i < Nvol3; i++) {
210 assert(abs(sqrt(Fnorm_global) - 1.0) < epsilon_criterion);
219 valarray<int> Nsize(Ndim);
231 for (
int z = 0; z < Nsize[2]; ++z) {
232 for (
int y = 0; y < Nsize[1]; ++y) {
233 for (
int x = 0; x < Nsize[0]; ++x) {
234 int lsite = x + Nsize[0] * (y + Nsize[1] * z);