CHROMA
schr_chromomag_gaugebc.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Schroedinger BC - chromo-magnetic gauge BC
3  */
4 
7 
8 namespace Chroma
9 {
10 
11  namespace SchrChromoMagGaugeBCEnv
12  {
13  //! Callback function to register with the factory
14  GaugeBC< multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >* createGaugeBC(XMLReader& xml,
15  const std::string& path)
16  {
17  return new SchrChromoMagGaugeBC(SchrGaugeBCParams(xml, path));
18  }
19 
20  const std::string name = "SCHROEDINGER_CHROMOMAG_GAUGEBC";
21 
22  //! Local registration flag
23  static bool registered = false;
24 
25  //! Register all the factories
26  bool registerAll()
27  {
28  bool success = true;
29  if (! registered)
30  {
31  success &= TheGaugeBCFactory::Instance().registerObject(name, createGaugeBC);
32  registered = true;
33  }
34  return success;
35  }
36  }
37 
38 
39  // Only full constructor
41  param(p)
42  {
43  START_CODE();
44 
45  fld.resize(Nd);
46  mask.resize(Nd);
47 
48  int j_decay = p.decay_dir;
49  int igluetmp = p.loop_extent;
50 
51  /* First construct the masks indicating the boundaries */
52  LatticeInteger litmp = Layout::latticeCoordinate(j_decay);
53 
54  LatticeBoolean lbtest;
55  switch (igluetmp)
56  {
57  case 2:
58  /* if (coord(j_decay) == 0 || coord(j_decay) == latt_cb_size(j_decay)-2) then */
59  lbtest = (litmp == 0);
60  lbtest |= (litmp == (QDP::Layout::lattSize()[j_decay]-2));
61  /* endif */
62  break;
63 
64  case 1:
65  lbtest = false;
66  break;
67 
68  default:
69  QDPIO::cerr << "SchrSFGaugeBC: unsupported igluetmp = " << igluetmp << std::endl;
70  QDP_abort(1);
71  }
72 
73  /* if (coord(j_decay) == latt_cb_size(j_decay)-1) then */
74  lbtest |= (litmp == (QDP::Layout::lattSize()[j_decay]-1));
75  /* endif */
76 
77  mask[j_decay] = lbtest;
78 
79  /* The remaining spatial directions */
80  switch(igluetmp)
81  {
82  case 2:
83  /* if (coord(j_decay) == 1) then */
84  lbtest |= (litmp ==1);
85  /* endif */
86  break;
87 
88  case 1:
89  break;
90  }
91 
92  /* if (coord(j_decay) == 0) then */
93  lbtest |= (litmp == 0);
94  /* endif */
95 
96  for(int mu = 0; mu < Nd; ++mu)
97  {
98  if (mu == j_decay) continue;
99 
100  mask[mu] = lbtest;
101  }
102 // maskF = lbtest;
103 
104 
105  /*
106  * Construct the boundary fields
107  */
108 
109  /* This is a constant chromomagnetic backround field */
110  if (Nd < 3)
111  QDP_error_exit("Not enough dimensions for chromomagnetic backround field");
112 
113  if (Nc < 2)
114  QDP_error_exit("Unsupported number of colors");
115 
116  int var_dir;
117  if (j_decay == (Nd-1))
118  var_dir = Nd - 2;
119  else
120  var_dir = Nd - 1;
121 
122  for(int mu = 1; mu < Nd; ++mu)
123  fld[mu] = 1;
124 
125  Real ftmp = Chroma::twopi * p.SchrPhiMult / Real(QDP::Layout::lattSize()[var_dir]);
126  LatticeReal lftmp = ftmp * Layout::latticeCoordinate(var_dir);
127 
128  fld[0] = 1.0;
129  pokeColor(fld[0], cmplx(cos(lftmp), sin(lftmp)), 0, 0);
130  pokeColor(fld[0], cmplx(cos(lftmp),-sin(lftmp)), 0, 0);
131 
132  END_CODE();
133  }
134 
135 
136 }
Base class for all gauge action boundary conditions.
Definition: gaugebc.h:30
Concrete class for Schroedinger BC - use for nonpertubative tuning.
multi1d< LatticeColorMatrix > fld
multi1d< LatticeBoolean > mask
static T & Instance()
Definition: singleton.h:432
int mu
Definition: cool.cc:24
Gauge boundary condition factories.
const int igluetmp
Definition: mciter32.cc:19
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
GaugeBC< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createGaugeBC(XMLReader &xml, const std::string &path)
Callback function to register with the factory.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
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)
const Real twopi
Definition: chromabase.h:55
START_CODE()
::std::string string
Definition: gtest.h:1979
Schroedinger BC - chromo-magnetic gauge BC.