QUDA  v0.5.0
A library for QCD on GPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gauge_field.cpp
Go to the documentation of this file.
1 #include <gauge_field.h>
2 
3 namespace quda {
4 
6  LatticeField(param), bytes(0), nColor(param.nColor), nFace(param.nFace),
7  geometry(param.geometry), reconstruct(param.reconstruct), order(param.order),
8  fixed(param.fixed), link_type(param.link_type), t_boundary(param.t_boundary),
9  anisotropy(param.anisotropy), tadpole(param.tadpole), create(param.create)
10  {
11  if (nColor != 3) errorQuda("nColor must be 3, not %d\n", nColor);
12  if (nDim != 4) errorQuda("Number of dimensions must be 4 not %d", nDim);
13  if (link_type != QUDA_WILSON_LINKS && anisotropy != 1.0) errorQuda("Anisotropy only supported for Wilson links");
15  errorQuda("Temporal gauge fixing only supported for Wilson links");
16 
19  length = 2*stride*reconstruct; // two comes from being full lattice
20  } else if (geometry == QUDA_VECTOR_GEOMETRY) {
22  length = 2*nDim*stride*reconstruct; // two comes from being full lattice
23  } else if(geometry == QUDA_TENSOR_GEOMETRY){
25  length = 2*(nDim*(nDim-1)/2)*stride*reconstruct; // two comes from being full lattice
26  }
27 
31  }
32 
34 
35  }
36 
39  if (a.link_type != link_type) errorQuda("link_type does not match %d %d", link_type, a.link_type);
40  if (a.nColor != nColor) errorQuda("nColor does not match %d %d", nColor, a.nColor);
41  if (a.nFace != nFace) errorQuda("nFace does not match %d %d", nFace, a.nFace);
42  if (a.fixed != fixed) errorQuda("fixed does not match %d %d", fixed, a.fixed);
43  if (a.t_boundary != t_boundary) errorQuda("t_boundary does not match %d %d", t_boundary, a.t_boundary);
44  if (a.anisotropy != anisotropy) errorQuda("anisotropy does not match %e %e", anisotropy, a.anisotropy);
45  if (a.tadpole != tadpole) errorQuda("tadpole does not match %e %e", tadpole, a.tadpole);
46  }
47 
48  std::ostream& operator<<(std::ostream& output, const GaugeFieldParam& param) {
49  output << static_cast<const LatticeFieldParam &>(param);
50  output << "nColor = " << param.nColor << std::endl;
51  output << "nFace = " << param.nFace << std::endl;
52  output << "reconstruct = " << param.reconstruct << std::endl;
53  output << "order = " << param.order << std::endl;
54  output << "fixed = " << param.fixed << std::endl;
55  output << "link_type = " << param.link_type << std::endl;
56  output << "t_boundary = " << param.t_boundary << std::endl;
57  output << "anisotropy = " << param.anisotropy << std::endl;
58  output << "tadpole = " << param.tadpole << std::endl;
59  output << "create = " << param.create << std::endl;
60 
61  return output; // for multiple << operators.
62  }
63 
64 } // namespace quda