CHROMA
syssolver_linop_qop_mg_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Make contact with the QDP clover multigrid solver, transfer
4  * the gauge field, generate the coarse grids, solve systems
5  */
6 
7 #ifndef __syssolver_linop_qdp_mg_h__
8 #define __syssolver_linop_qdp_mg_h__
9 #include "chroma_config.h"
10 #include "handle.h"
11 #include "syssolver.h"
12 #include "linearop.h"
15 
16 
17 namespace Chroma
18 {
19 
20  //! QDP multigrid system solver namespace
21  namespace LinOpSysSolverQOPMGEnv
22  {
23  //! Register the syssolver
24  bool registerAll();
25  }
26 
27 
28  //! Solve a M*psi=chi linear system using the external QDP multigrid inverter
29  /*! \ingroup invert
30  */
31  class LinOpSysSolverQOPMG : public LinOpSystemSolver<LatticeFermion>
32  {
33  public:
34  typedef LatticeFermion T;
35  typedef LatticeColorMatrix U;
36  typedef multi1d<LatticeColorMatrix> Q;
37 
38 
39  typedef void WilsonMGSubspace;
40 
41  //! Constructor
42  /*!
43  * \param A_ Linear operator ( Read )
44  * \param state_ The ferm State (Read)
45  * \param invParam inverter parameters ( Read )
46  */
48  Handle< FermState<T,Q,Q> > state_,
49  const SysSolverQOPMGParams& invParam_);
50 
51  //! Destructor finalizes the QDP environment
53 
54  //! Return the subset on which the operator acts
55  const Subset& subset() const {return A->subset();}
56 
57  //! Solver the linear system
58  /*!
59  * \param psi solution ( Modify )
60  * \param chi source ( Read )
61  * \return syssolver results
62  */
63  SystemSolverResults_t operator() (T& psi, const T& chi) const;
64 
65 
66  //! Erasee the subspace
67  void eraseSubspace();
68 
69  //! Get the subspace to use
70  /*! If the subspace is internal this creates it if needed and returns the pointer
71  * if it is external, this will look it up in the map and return the pointer. If
72  * the entry in the map does not exist, it will create and add the space to the map.
73  * so there is no need to separately save.. NB: External subspace creation allocates
74  * memory. Which may persist beyond the life of an object (that's the point actually).
75  * There is an ERASE_MG_SUBSPACE measurement that can erase this space later */
77 
78  private:
79  // Hide default constructor
85  };
86 
87 } // End namespace
88 
89 #endif
90 
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
Solve a M*psi=chi linear system using the external QDP multigrid inverter.
~LinOpSysSolverQOPMG()
Destructor finalizes the QDP environment.
Handle< FermState< T, Q, Q > > state
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
LinOpSysSolverQOPMG(Handle< LinearOperator< T > > A_, Handle< FermState< T, Q, Q > > state_, const SysSolverQOPMGParams &invParam_)
Constructor.
WilsonMGSubspace * getSubspace() const
Get the subspace to use.
multi1d< LatticeColorMatrix > Q
Handle< LinearOperator< T > > A
const Subset & subset() const
Return the subset on which the operator acts.
void eraseSubspace()
Erasee the subspace.
SystemSolver disambiguator.
Linear Operator.
Definition: linearop.h:27
Class for counted reference semantics.
Linear Operators.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Parameters for the external QDP multigrid inverter.
Holds return info from SystemSolver call.
Definition: syssolver.h:17
Linear system solvers.
Disambiguator for LinOp system solvers.
Parameters for the external QDP clover multigrid solver.