16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Source_Wall::register_factory();
33 std::vector<int> source_position;
64 std::vector<int> Lsize(Ndim);
72 std::vector<int> Nsize(Ndim);
78 const int t_dir = Ndim - 1;
82 vout.
general(
m_vl,
" source_position[t] = %d\n", source_position[t_dir]);
96 for (
int mu = 0; mu < Ndim; ++mu) {
99 m_source_position[t_dir] = (source_position[t_dir] + Lsize[t_dir]) % Lsize[t_dir];
125 const int Lvol3 = Lx * Ly * Lz;
128 std::vector<int> Nsize(Ndim);
141 for (
int z = 0; z < Nsize[2]; ++z) {
142 for (
int y = 0; y < Nsize[1]; ++y) {
143 for (
int x = 0; x < Nsize[0]; ++x) {
147 src.
set(2 *
idx, isite, 0, 1.0 / Lvol3);
159 const int idx = i_color + Nc * i_spin;
176 const int Lvol3 = Lx * Ly * Lz;
179 std::vector<int> Nsize(Ndim);
192 for (
int z = 0; z < Nsize[2]; ++z) {
193 for (
int y = 0; y < Nsize[1]; ++y) {
194 for (
int x = 0; x < Nsize[0]; ++x) {
197 for (
int i_color = 0; i_color < Nc; ++i_color) {
198 int idx = i_color + Nc * i_spin;
202 src.
set(idx_r, isite, 0, 1.0 / Lvol3);
223 const int Lvol3 = Lx * Ly * Lz;
226 std::vector<int> Nsize(Ndim);
239 for (
int z = 0; z < Nsize[2]; ++z) {
240 for (
int y = 0; y < Nsize[1]; ++y) {
241 for (
int x = 0; x < Nsize[0]; ++x) {
244 for (
int idx = 0;
idx < Nc * Nd; ++
idx) {
248 src.
set(idx_r, isite, 0, 1.0 / Lvol3);