CHROMA
integrator_shared.cc
Go to the documentation of this file.
1 #include "chromabase.h"
3 
4 using namespace QDP;
5 namespace Chroma {
6  namespace IntegratorShared {
7 
9  multi1d<LatticeColorMatrix> >*
10  createSubIntegrator(const std::string& subintegrator_xml)
11  {
12 
13  std::istringstream is( subintegrator_xml );
14  XMLReader top(is);
15 
16  std::string subint_name;
17  try {
18  read(top, "/SubIntegrator/Name", subint_name);
19  }
20  catch( const std::string& e ) {
21  QDPIO::cerr << "Failed to extract name of subintegrator in LatColMatSTSLeapfrogRecursiveIntegrator: " << e << std::endl;
22  QDP_abort(1);
23  }
24  std::string root="/SubIntegrator";
25 
27  multi1d<LatticeColorMatrix> >* ret_val=
28  TheMDComponentIntegratorFactory::Instance().createObject(subint_name, top, root);
29  return ret_val;
30  }
31 
32  void bindMonomials(const multi1d<std::string>& monomial_ids,
33  multi1d< MonomialPair >& monomials ) {
34  QDPIO::cout << "Binding Monomials" << std::endl;
35  QDPIO::cout << "There are " << monomial_ids.size() << " IDs to bind " << std::endl;
36 
37  monomials.resize(monomial_ids.size());
38  for(int i=0; i < monomial_ids.size(); i++) {
39  try {
40 
41  monomials[i].mon=
42  TheNamedObjMap::Instance().getData< Handle< Monomial< multi1d<LatticeColorMatrix> , multi1d<LatticeColorMatrix> > > >(monomial_ids[i]);
43 
44  monomials[i].id = monomial_ids[i];
45 
46  QDPIO::cout << "Monomial with ID = " << monomial_ids[i] << " bound" << std::endl;
47  }
48  catch(const std::string& e) {
49  QDPIO::cout << "Caught exception with message : " << e << std::endl;
50  QDP_abort(1);
51  }
52  catch(std::bad_cast) {
53  QDPIO::cout << "Failed to cast to return type in bind_monomials" << std::endl;
54  QDP_abort(1);
55  }
56 
57  } // For loop
58  QDPIO::cout << "All monomials successfully bound" << std::endl;
59  }
60 
61 
62  }
63 
64 }
Primary include file for CHROMA library code.
MD integrator that can be used as a component for other integrators.
Class for counted reference semantics.
Definition: handle.h:33
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
unsigned i
Definition: ldumul_w.cc:34
AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createSubIntegrator(const std::string &subintegrator_xml)
A routine to create a sub integrator from a generic piece of subintegrator XML.
void bindMonomials(const multi1d< std::string > &monomial_ids, multi1d< MonomialPair > &monomials)
A routine to bind Monomial IDs to an array of Monomial Handles.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979