29 #include "lattice/fine_qdpxx/wilson_clover_linear_operator.h"
45 typedef LatticeFermion
T;
46 typedef multi1d<LatticeColorMatrix>
Q;
47 typedef multi1d<LatticeColorMatrix>
P;
49 typedef LatticeFermionF
TF;
50 typedef multi1d<LatticeColorMatrixF>
QF;
51 typedef multi1d<LatticeColorMatrixF>
PF;
53 std::istringstream is(
p.fermact.xml);
66 XMLBufferWriter xml_buf;
67 write(xml_buf,
"MGProtoParams",
p.mgproto_params);
68 QDPIO::cout << xml_buf.str() << std::endl;
72 QDPIO::cout <<
"Testing MGProto Fine Linear Operator: " << std::endl;
74 LatticeFermion
psi; LatticeFermion chi1; LatticeFermion chi2;
80 QDPIO::cout <<
"Applying Chroma UnprecCloverLinop" <<std::endl;
85 connect_state->getLinks());
87 QDPIO::cout <<
"Applying MG QDPWilsonCloverLinearOperator " << std::endl;
88 (*D_op_mg)(chi2,
psi,MG::LINOP_OP);
90 LatticeFermion diff=chi2-chi1;
91 Double n2_diff = sqrt(norm2(diff));
92 QDPIO::cout <<
"Diff Norm = " << n2_diff << std::endl;
93 QDPIO::cout <<
"Diff Norm/norm2psi = " << n2_diff /sqrt(norm2(
psi)) << std::endl;
94 QDPIO::cout <<
"Diff Norm / d.o.f = " << n2_diff / toDouble(Layout::vol()*Nc*Ns) << std::endl;
112 Double n2diff = norm2(diff);
114 QDPIO::cout <<
" || b - A x || = " << sqrt(n2diff) << std::endl;
115 QDPIO::cout <<
" || b - A x || / || b || = " << sqrt(reln2diff) << std::endl;
132 Double n2diff = norm2(diff);
134 QDPIO::cout <<
" || b - A x || = " << sqrt(n2diff) << std::endl;
135 QDPIO::cout <<
" || b - A x || / || b || = " << sqrt(reln2diff) << std::endl;
149 read(
r,
"Cfg",
p.inputCfg);
151 read(
r,
"MGProtoParams",
p.mgproto_params);
165 int main(
int argc,
char **argv)
169 QDPIO::cout <<
"Linkage = " <<
linkageHack() << std::endl;
182 QDPIO::cerr <<
"Caught Exception reading XML: " << e << std::endl;
185 Layout::setLattSize(
params.nrow);
188 multi1d<LatticeColorMatrix>
u(
Nd);
189 XMLReader gauge_file_xml, gauge_xml;
196 push(xml_out,
"t_invert");
197 push(xml_out,
"params");
202 MesPlq(xml_out,
"Observables",
u);
Primary include file for CHROMA in application codes.
Class for counted reference semantics.
Parameters for Clover fermion action.
Even-odd preconditioned Clover fermion linear operator.
All ferm create-state method.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void unitarityCheck(const multi1d< LatticeColorMatrixF3 > &u)
Check the unitarity of color matrix in SU(N)
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Multishift Conjugate-Gradient algorithm for a Linear Operator.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > P
shared_ptr< const MG::QDPWilsonCloverLinearOperator > createFineLinOp(const MGProtoSolverParams ¶ms, const multi1d< LatticeColorMatrix > &u)
void deleteMGPreconditioner(const std::string &subspaceId)
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
multi1d< LatticeFermion > chi(Ncb)
std::string getXMLInputFileName()
Get input file name.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
FloatingPoint< double > Double
MGProtoSolverParams mgproto_params
Gauge configuration structure.
Hold group xml and type id.
Factory for solving M*psi=chi where M is not hermitian or pos. def.
void checkInverter(const AppParams &p, multi1d< LatticeColorMatrix > &u)
int main(int argc, char **argv)
multi1d< LatticeColorMatrixF > QF
multi1d< LatticeColorMatrixF > PF
Read an XML group as a std::string.