CHROMA
schr_nonpert_gaugebc.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Schroedinger BC - use for non-pertubative tuning of clover action
3  */
4 
7 
8 namespace Chroma
9 {
10 
11  namespace SchrNonPertGaugeBCEnv
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 SchrNonPertGaugeBC(SchrGaugeBCParams(xml, path));
18  }
19 
20  const std::string name = "SCHROEDINGER_NONPERT_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  // Initialize the phases
44  initPhases();
45 
46  // Initialize the boundary fields
47  initBnd(fld, mask);
48  }
49 
50 
51  // Initialize the phases
53  {
54  phases.lower.resize(Nc);
55  phases.upper.resize(Nc);
56 
57  Real ftmp = Chroma::twopi * 0.5 * SchrPhiMult();
58 
59  switch (Nc)
60  {
61  case 2: /* SF nonperturbative improvement bc's */
62  ftmp /= Real(4);
63 
64  /* lower boundary */
65  phases.lower[0] = -ftmp;
66  phases.lower[1] = ftmp;
67 
68  /* upper boundary */
69  phases.upper[0] = -Real(3) * ftmp;
70  phases.upper[1] = Real(3) * ftmp;
71  break;
72 
73  case 3: /* SF nonperturbative improvement bc's */
74  ftmp /= Real(6);
75 
76  /* lower boundary */
77  phases.lower[0] = -ftmp;
78  phases.lower[1] = 0;
79  phases.lower[2] = ftmp;
80 
81  /* upper boundary */
82  phases.upper[0] = -Real(5) * ftmp;
83  phases.upper[1] = Real(2) * ftmp;
84  phases.upper[2] = Real(3) * ftmp;
85  break;
86 
87  default:
88  QDPIO::cerr << __func__ << ": unsupport number of colors" << std::endl;
89  QDP_abort(1);
90  }
91  }
92 
93 
94 }
Base class for all gauge action boundary conditions.
Definition: gaugebc.h:30
Concrete class for Schroedinger BC - use for nonpertubative tuning.
multi1d< LatticeColorMatrix > fld
void initPhases()
Initialize the phases.
multi1d< LatticeBoolean > mask
const Real & SchrPhiMult() const
Multiplier on phases.
virtual void initBnd(multi1d< LatticeColorMatrix > &SFBndFld, multi1d< LatticeBoolean > &lSFmask) const
Construct the mask and boundary fields.
static T & Instance()
Definition: singleton.h:432
Gauge boundary condition factories.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
GaugeBC< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createGaugeBC(XMLReader &xml, const std::string &path)
Callback function to register with the factory.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
const Real twopi
Definition: chromabase.h:55
::std::string string
Definition: gtest.h:1979
Schroedinger BC - use for non-pertubative tuning of clover action.