CHROMA
aniso_io.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Anisotropy parameters
3  */
4 
5 #include "io/aniso_io.h"
6 
7 namespace Chroma
8 {
9 
10  //! Initialize a anisotropy param struct
12  {
13  anisoP = false;
14  t_dir = Nd-1; // doesn't matter - should not be used when anisoP is false
15  xi_0 = 1;
16  nu = 1;
17  }
18 
19 
20  //! Read a anisotropy param struct
21  void read(XMLReader& xml, const std::string& path, AnisoParam_t& param)
22  {
23 
24  XMLReader paramtop(xml, path);
25 
26  read(paramtop, "anisoP", param.anisoP);
27 
28  // To avoid confusion later, if the anisoP is false, then set the
29  // struct to its default state.
30  if (param.anisoP)
31  {
32  read(paramtop, "t_dir", param.t_dir);
33  read(paramtop, "xi_0", param.xi_0);
34 
35  if (paramtop.count("nu") != 0)
36  read(paramtop, "nu", param.nu);
37  else
38  param.nu = 1.0;
39  }
40  else
41  {
42  AnisoParam_t foo;
43  param = foo;
44  }
45  }
46 
47 
48  //! Write a anisotropy param struct
49  void write(XMLWriter& xml, const std::string& path, const AnisoParam_t& param)
50  {
51  push(xml, path);
52 
53  write(xml, "anisoP", param.anisoP);
54  write(xml, "t_dir", param.t_dir);
55  write(xml, "xi_0", param.xi_0);
56  write(xml, "nu", param.nu);
57 
58  pop(xml);
59  }
60 
61 
62  // Make fermion coefficients
63  multi1d<Real> makeFermCoeffs(const AnisoParam_t& aniso)
64  {
65  multi1d<Real> cf(Nd);
66  cf = 1.0;
67 
68  if (aniso.anisoP)
69  {
70  for(int mu=0; mu < cf.size(); ++mu)
71  {
72  if (mu != aniso.t_dir)
73  {
74  cf[mu] = aniso.nu / aniso.xi_0;
75  }
76  }
77  }
78 
79  return cf;
80  }
81 
82 
83 } // end namespace Chroma
Anisotropy parameters.
int mu
Definition: cool.cc:24
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.
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
push(xml_out,"Condensates")
pop(xml_out)
multi1d< Real > makeFermCoeffs(const AnisoParam_t &aniso)
Make fermion coefficients.
Definition: aniso_io.cc:63
::std::string string
Definition: gtest.h:1979
Parameters for anisotropy.
Definition: aniso_io.h:24
AnisoParam_t()
Initialize a anisotropy param struct.
Definition: aniso_io.cc:11