CHROMA
walfil_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Wall source construction
3  */
4 
5 #include "chromabase.h"
7 
8 namespace Chroma
9 {
10 
11  //! Fill a specific color and spin index with 1.0 on a wall
12  /*!
13  * \ingroup sources
14  *
15  * This routine is specific to Wilson fermions!
16  *
17  * \param a Source fermion
18  * \param slice time slice
19  * \param mu direction of slice
20  * \param color_index Color index
21  * \param spin_index Spin index
22  */
23 
24  void walfil(LatticeFermion& a, int slice, int mu, int color_index, int spin_index)
25  {
26  START_CODE();
27 
28  if (color_index >= Nc || color_index < 0)
29  QDP_error_exit("invalid color index", color_index);
30 
31  if (spin_index >= Ns || spin_index < 0)
32  QDP_error_exit("invalid spin index", spin_index);
33 
34  // Write ONE to all field
35  Real one = 1;
36  Complex sitecomp = cmplx(one,0);
37  ColorVector sitecolor = zero;
38  Fermion sitefield = zero;
39 
40  pokeSpin(sitefield,
41  pokeColor(sitecolor,sitecomp,color_index),
42  spin_index);
43 
44  // Narrow the context to the desired slice.
45  LatticeFermion tmp;
46  tmp = sitefield; // QDP (not installed version) now supports construct OLattice = OScalar
47 
48  a = where(Layout::latticeCoordinate(mu) == slice, tmp, LatticeFermion(zero));
49 
50  END_CODE();
51  }
52 
53 } // end namespace Chroma
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
void walfil(LatticeStaggeredFermion &a, int slice, int mu, int color_index, int src_index)
Fill a specific color and spin index with 1.0 on a wall.
Definition: walfil_s.cc:36
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
Double one
Definition: invbicg.cc:105
Complex a
Definition: invbicg.cc:95
START_CODE()
Double zero
Definition: invbicg.cc:106
Wall source construction.