CHROMA
extfield_aggregate_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief External field functions
4  */
5 
6 #ifndef __extfield_functions_w_h__
7 #define __extfield_functions_w_h__
8 
9 #include "handle.h"
11 
12 
13 namespace Chroma
14 {
15 
16  //! Name and registration
17  /*! @ingroup fermstates */
18  namespace ExternalFieldEnv
19  {
20  bool registerAll();
21 
22  //! Construct zero field
23  /*!
24  * \ingroup fermstates
25  */
27  {
28  public:
29  //! Full constructor
31 
32  //! Return the field
33  LatticeComplex operator()(int dir) const;
34  };
35 
37  int t_dir ; // the time direction
38  int y_dir ; // the direction which the A_mu is turn on
39  int b_dir ; // the direction of the B field
40  Real Bfield ; // The value of the B field
41  bool patch ; // do the patch ?
42  } ;
43 
44  //! Construct constant Magnetic field
45  /*!
46  * \ingroup fermstates
47  */
49  {
50  int t_dir ;
51  int y_dir ;
52  int b_dir ;
53  Real Bfield ;
54  bool patch ;
55  int x_dir ;
56  public:
57  //! Full constructor
59  y_dir(p.y_dir),
60  b_dir(p.b_dir),
61  Bfield(p.Bfield),
62  patch(p.patch)
63  {
64  for( int d(0);d<Nd;d++)
65  if((d!=t_dir)&&(d!=y_dir)&&(d!=b_dir))
66  x_dir = d ;
67  }
68  //! set time default to be Nd-1 and zero external field
70  {
71  }
72 
73  //! Return the field
74  LatticeComplex operator()(int dummy) const;
75  };
76 
77 
79  int t_dir ; // the time direction
80  int x_dir ; // the direction which Phi is turned on, also the dir of E
81  int x_src ; // source point fo e field
82  Real Efield ; // The E field is E = (Efield)*x, so
83  //this is the e field divided by the distance.
84  bool patch ;
85  } ;
86  //! Construct Linear Electric field (E = epsilon*x)
87  /*!
88  * \ingroup fermstates
89  */
91  {
92  int t_dir ;
93  int x_dir ;
94  int x_src ; // source point fo e field
95  Real Efield ;
96  bool patch ;
97  public:
98  //! Full constructor
100  x_dir(p.x_dir),
101  x_src(p.x_src),
102  Efield(p.Efield)
103  {}
104  //! set time default to be Nd-1 and zero external field
106  {}
107 
108  //! Return the field
109  LatticeComplex operator()(int dummy) const;
110  };
111 
112 
113  Handle< ExternalField > reader(XMLReader& xml, const std::string& path) ;
114 
115  } // end namespace
116 
117 
118  //! Reader
119  /*! @ingroup sources */
120  void read(XMLReader& xml, const std::string& path, ExternalFieldEnv::ConstantMagneticParams& param);
121 
122  //! Writer
123  /*! @ingroup sources */
124  void write(XMLWriter& xml, const std::string& path, const ExternalFieldEnv::ConstantMagneticParams& param);
125 
126 
127  void read(XMLReader& xml, const std::string& path, ExternalFieldEnv::LinearElectricParams& param);
128 
129  //! Writer
130  /*! @ingroup sources */
131  void write(XMLWriter& xml, const std::string& path, const ExternalFieldEnv::LinearElectricParams& param);
132 
133 
134 } // end namespace Chroma
135 
136 #endif
ConstantMagneticExternalField()
set time default to be Nd-1 and zero external field
ConstantMagneticExternalField(ConstantMagneticParams p)
Full constructor.
LatticeComplex operator()(int dummy) const
Return the field.
Construct Linear Electric field (E = epsilon*x)
LatticeComplex operator()(int dummy) const
Return the field.
LinearElectricExternalField(LinearElectricParams p)
Full constructor.
LinearElectricExternalField()
set time default to be Nd-1 and zero external field
LatticeComplex operator()(int dir) const
Return the field.
Base class for external fields.
Definition: extfield.h:20
Class for counted reference semantics.
Definition: handle.h:33
External field.
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.
Class for counted reference semantics.
Nd
Definition: meslate.cc:74
Handle< ExternalField > reader(XMLReader &xml, const std::string &path)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
DComplex d
Definition: invbicg.cc:99
::std::string string
Definition: gtest.h:1979
Real dummy
Definition: qtopcor.cc:36