CHROMA
schr_sf_zero_gaugebc.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Schroedinger BC - happens to zero out gauge fields in bc_dir
3  */
4 
7 
8 namespace Chroma
9 {
10 
11  namespace SchrSFZeroGaugeBCEnv
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 SchrSFZeroGaugeBC(SchrGaugeBCParams(xml, path));
18  }
19 
20  const std::string name = "SCHROEDINGER_ZERO_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 
59  }
60 
61 
62  // Modify U fields in place
63  void SchrSFZeroGaugeBC::modify(multi1d<LatticeColorMatrix>& u) const
64  {
65  START_CODE();
66 
67  LatticeColorMatrix z = QDP::zero;
68 
69  for(int mu=0; mu < u.size(); ++mu)
70  copymask(u[mu], lSFmask()[mu], z);
71 
72  END_CODE();
73  }
74 
75  // Zero some gauge-like field in place on the masked links
76  void SchrSFZeroGaugeBC::zero(multi1d<LatticeColorMatrix>& ds_u) const
77  {
78  START_CODE();
79 
80  LatticeColorMatrix z = QDP::zero;
81 
82  for(int mu=0; mu < ds_u.size(); ++mu)
83  copymask(ds_u[mu], lSFmask()[mu], z);
84 
85  END_CODE();
86  }
87 }
Base class for all gauge action boundary conditions.
Definition: gaugebc.h:30
virtual void initBnd(multi1d< LatticeColorMatrix > &SFBndFld, multi1d< LatticeBoolean > &lSFmask) const
Construct the mask and boundary fields.
Concrete class for Schroedinger BC - zero out gauge boundaries.
multi1d< LatticeBoolean > mask
const multi1d< LatticeBoolean > & lSFmask() const
Mask which lattice sites have fixed gauge links.
void modify(multi1d< LatticeColorMatrix > &u) const
Modify U fields in place.
void zero(multi1d< LatticeColorMatrix > &ds_u) const
Zero the some gauge-like field in place on the masked links.
multi1d< LatticeColorMatrix > fld
void initPhases()
Initialize the phases.
static T & Instance()
Definition: singleton.h:432
int mu
Definition: cool.cc:24
Gauge boundary condition factories.
int z
Definition: meslate.cc:36
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
static multi1d< LatticeColorMatrix > u
START_CODE()
Double zero
Definition: invbicg.cc:106
::std::string string
Definition: gtest.h:1979
copymask(lcoord, lbit, ltmp_1, REPLACE)
Schroedinger BC - happens to zero out gauge fields in bc_dir.