CHROMA
avp_ssef_solver.cc
Go to the documentation of this file.
1 #include "avp_ssef_solver.h"
2 
3 using namespace QDP;
4 namespace Chroma
5 {
6  namespace AVPSolver
7  {
8 
9 #include <dwf-ssef.h>
10 
11  MIT_ssef_DWF_Fermion* SSEDWFSolverF::loadFermionRHS(const void* OuterFermion) const {
12  return MIT_ssef_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderRHS);
13  }
14 
15  MIT_ssef_DWF_Fermion* SSEDWFSolverF::loadFermionGuess(const void *OuterFermion) const {
16  return MIT_ssef_DWF_load_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionReaderGuess);
17  }
18 
19  MIT_ssef_DWF_Fermion* SSEDWFSolverF::allocateFermion(void) const {
20  return MIT_ssef_DWF_allocate_fermion();
21  }
22 
23  void SSEDWFSolverF::saveFermionSolver(void *OuterFermion,
24  MIT_ssef_DWF_Fermion* CGFermion) const {
25  MIT_ssef_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterSolver, CGFermion);
26  }
27 
28  void SSEDWFSolverF::saveFermionOperator(void *OuterFermion,
29  MIT_ssef_DWF_Fermion* CGFermion) const {
30  MIT_ssef_DWF_save_fermion(OuterFermion, NULL, &AVPSolverFunctions::fermionWriterOperator, CGFermion);
31  }
32 
33  void SSEDWFSolverF::deleteFermion(MIT_ssef_DWF_Fermion* ptr) const {
34  MIT_ssef_DWF_delete_fermion(ptr);
35  }
36 
37 
38  int SSEDWFSolverF::cgInternal(MIT_ssef_DWF_Fermion *psi,
39  double *out_eps,
40  int *out_iter,
41  double M,
42  double m_f,
43  const MIT_ssef_DWF_Fermion *x0,
44  const MIT_ssef_DWF_Fermion *eta,
45  double eps,
46  int min_iter,
47  int max_iter) const
48  {
49  QDPIO::cout << "Entering MIT_ssef_DWF_cg_solver" << std::endl;
50  return MIT_ssef_DWF_cg_solver(psi, out_eps, out_iter, g, M, m_f,
51  x0, eta, eps, min_iter, max_iter);
52  }
53 
54  void SSEDWFSolverF::loadGauge(const void *u,
55  const void *v) {
56  g=MIT_ssef_DWF_load_gauge(u, v, NULL, &AVPSolverFunctions::gaugeReader);
57  }
58 
59  void SSEDWFSolverF::deleteGauge(void) {
60  MIT_ssef_DWF_delete_gauge(g);
61  }
62 
63 
64  // Init the system -- Constructor call?
65  int SSEDWFSolverF::init(const int lattice[5],
66  void *(*allocator)(size_t size),
67  void (*deallocator)(void *)) {
68  return MIT_ssef_DWF_init(lattice, allocator, deallocator);
69  }
70 
71  // Finalize - destructor call
72  void SSEDWFSolverF::fini(void) {
73  MIT_ssef_DWF_fini();
74  }
75  }
76 }
77 
78 
Base class for AVP's SSEF-DWF solver interface.
void fermionWriterOperator(void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim, double val)
double fermionReaderGuess(const void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim)
double gaugeReader(const void *OuterGauge, void *env, const int latt_coord[4], int mu, int row, int col, int reim)
double fermionReaderRHS(const void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim)
void fermionWriterSolver(void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim, double val)
void init(MesonSpecData_t &data, XMLWriter &xml, const std::string &path, const std::string &id_tag, const Params &params)
Do some initialization.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LatticeFermion eta
Definition: mespbg5p_w.cc:37
psi
Definition: pade_trln_w.cc:191