CHROMA
background_fermbc_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Simple fermionic BC
3  */
4 
7 
8 namespace Chroma
9 {
10 
11  // Readers and writerss for the params
12  //! Read parameters
14  {
15  XMLReader paramtop(xml, path);
16 
17  // The BASE Simple BC boundary
18  read(paramtop, "boundary", boundary);
19  read(paramtop, "gamma", gamma);
20  read(paramtop, "lambda", lambda);
21 
22  if( boundary.size() != Nd ) {
23  QDPIO::cerr << "BackgroundFermBCParams: Invalid size for boundary. Should be " << Nd << " but is " << boundary.size() << std::endl;
24  QDP_abort(1);
25  }
26 
27  if(( gamma < 0 )||(gamma>15)) {
28  QDPIO::cerr << "BackgroundFermBCParams: gamma should be [0,15]" ;
29  QDPIO::cerr<< " but is " << gamma << std::endl;
30  QDP_abort(1);
31  }
32  }
33 
34  //! Read parameters
35  void read(XMLReader& xml, const std::string& path, BackgroundFermBCParams& param)
36  {
37  BackgroundFermBCParams tmp(xml, path);
38  param = tmp;
39  }
40 
41  //! Write parameters
42  void write(XMLWriter& xml_out, const std::string& path, const BackgroundFermBCParams& param)
43  {
44  if ( path != "." )
45  push(xml_out, path);
46 
47  write(xml_out, "FermBC", WilsonTypeBackgroundFermBCEnv::name);
48  write(xml_out, "boundary", param.boundary);
49  write(xml_out, "gamma", param.gamma);
50  write(xml_out, "lambda", param.lambda);
51 
52  if( path != "." )
53  pop(xml_out);
54  }
55 
56 
57  //! Name and registration
58  namespace WilsonTypeBackgroundFermBCEnv
59  {
60  //! Callback function
61  FermBC<LatticeFermion,
62  multi1d<LatticeColorMatrix>,
63  multi1d<LatticeColorMatrix> >* createFermBC(XMLReader& xml_in, const std::string& path)
64  {
65  BackgroundFermBCParams bc(xml_in, path);
66  return new BackgroundFermBC<LatticeFermion>(bc.gamma,
67  bc.lambda,
68  bc.boundary);
69  }
70 
71  //! Name to be used
72  const std::string name = "BACKGROUND_FERMBC";
73 
74  static bool registered = false;
75 
76  //! Register all the factories
77  // Register all objects
78  bool registerAll()
79  {
80  bool success = true;
81  if (! registered)
82  {
84  registered = true;
85  }
86  return success;
87  }
88  }
89 }
quark bilinear background field fermionic BC
Concrete class for all fermionic actions with twisted boundary conditions.
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
static T & Instance()
Definition: singleton.h:432
Fermion Boundary Condition factories.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
multi1d< int > bc
Nd
Definition: meslate.cc:74
const std::string name
Name to be used.
bool registerAll()
Register all the factories.
FermBC< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermBC(XMLReader &xml_in, const std::string &path)
Callback function.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
push(xml_out,"Condensates")
pop(xml_out)
::std::string string
Definition: gtest.h:1979
Params struct for twisted params.