From fabcd4179d49aff6f047b46445fba099dcc38094 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Mon, 28 Nov 2016 14:02:10 +0900 Subject: [PATCH] Hadrons: propagator type coming from the fermion implementation --- lib/qcd/action/fermion/FermionOperatorImpl.h | 17 +++++++++++++++-- programs/Hadrons/Global.hpp | 7 +++++++ programs/Hadrons/Modules/ADWF.hpp | 2 -- programs/Hadrons/Modules/AWilson.hpp | 2 -- programs/Hadrons/Modules/CMeson.cc | 4 ++-- programs/Hadrons/Modules/MQuark.hpp | 3 --- programs/Hadrons/Modules/SolRBPrecCG.hpp | 4 ---- programs/Hadrons/Modules/SrcPoint.cc | 4 ++-- programs/Hadrons/Modules/SrcZ2.cc | 4 ++-- 9 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lib/qcd/action/fermion/FermionOperatorImpl.h b/lib/qcd/action/fermion/FermionOperatorImpl.h index 0800dea6..07eee6be 100644 --- a/lib/qcd/action/fermion/FermionOperatorImpl.h +++ b/lib/qcd/action/fermion/FermionOperatorImpl.h @@ -48,8 +48,10 @@ namespace QCD { // typedef typename XXX GaugeField; // typedef typename XXX GaugeActField; // typedef typename XXX FermionField; + // typedef typename XXX PropagatorField; // typedef typename XXX DoubledGaugeField; // typedef typename XXX SiteSpinor; + // typedef typename XXX SitePropagator; // typedef typename XXX SiteHalfSpinor; // typedef typename XXX Compressor; // @@ -95,13 +97,15 @@ namespace QCD { #define INHERIT_FIMPL_TYPES(Impl)\ typedef typename Impl::FermionField FermionField; \ + typedef typename Impl::PropagatorField PropagatorField; \ typedef typename Impl::DoubledGaugeField DoubledGaugeField; \ typedef typename Impl::SiteSpinor SiteSpinor; \ + typedef typename Impl::SitePropagator SitePropagator; \ typedef typename Impl::SiteHalfSpinor SiteHalfSpinor; \ typedef typename Impl::Compressor Compressor; \ typedef typename Impl::StencilImpl StencilImpl; \ - typedef typename Impl::ImplParams ImplParams; \ - typedef typename Impl::Coeff_t Coeff_t; + typedef typename Impl::ImplParams ImplParams; \ + typedef typename Impl::Coeff_t Coeff_t; \ #define INHERIT_IMPL_TYPES(Base) \ INHERIT_GIMPL_TYPES(Base) \ @@ -127,14 +131,17 @@ namespace QCD { INHERIT_GIMPL_TYPES(Gimpl); template using iImplSpinor = iScalar, Ns> >; + template using iImplPropagator = iScalar, Ns> >; template using iImplHalfSpinor = iScalar, Nhs> >; template using iImplDoubledGaugeField = iVector >, Nds>; typedef iImplSpinor SiteSpinor; + typedef iImplPropagator SitePropagator; typedef iImplHalfSpinor SiteHalfSpinor; typedef iImplDoubledGaugeField SiteDoubledGaugeField; typedef Lattice FermionField; + typedef Lattice PropagatorField; typedef Lattice DoubledGaugeField; typedef WilsonCompressor Compressor; @@ -216,14 +223,17 @@ class DomainWallVec5dImpl : public PeriodicGaugeImpl< GaugeImplTypes< S,Nrepres INHERIT_GIMPL_TYPES(Gimpl); template using iImplSpinor = iScalar, Ns> >; + template using iImplPropagator = iScalar, Ns> >; template using iImplHalfSpinor = iScalar, Nhs> >; template using iImplDoubledGaugeField = iVector >, Nds>; template using iImplGaugeField = iVector >, Nd>; template using iImplGaugeLink = iScalar > >; typedef iImplSpinor SiteSpinor; + typedef iImplPropagator SitePropagator; typedef iImplHalfSpinor SiteHalfSpinor; typedef Lattice FermionField; + typedef Lattice PropagatorField; // Make the doubled gauge field a *scalar* typedef iImplDoubledGaugeField SiteDoubledGaugeField; // This is a scalar @@ -315,14 +325,17 @@ class GparityWilsonImpl : public ConjugateGaugeImpl using iImplSpinor = iVector, Ns>, Ngp>; + template using iImplPropagator = iVector, Ns>, Ngp >; template using iImplHalfSpinor = iVector, Nhs>, Ngp>; template using iImplDoubledGaugeField = iVector >, Nds>, Ngp>; typedef iImplSpinor SiteSpinor; + typedef iImplPropagator SitePropagator; typedef iImplHalfSpinor SiteHalfSpinor; typedef iImplDoubledGaugeField SiteDoubledGaugeField; typedef Lattice FermionField; + typedef Lattice PropagatorField; typedef Lattice DoubledGaugeField; typedef WilsonCompressor Compressor; diff --git a/programs/Hadrons/Global.hpp b/programs/Hadrons/Global.hpp index 3f60122c..0936f3ba 100644 --- a/programs/Hadrons/Global.hpp +++ b/programs/Hadrons/Global.hpp @@ -50,6 +50,13 @@ using Grid::operator<<; BEGIN_HADRONS_NAMESPACE +// type aliases +typedef FermionOperator FMat; +typedef FIMPL::FermionField FermionField; +typedef FIMPL::PropagatorField PropagatorField; +typedef std::function Solver; + +// logger class HadronsLogger: public Logger { public: diff --git a/programs/Hadrons/Modules/ADWF.hpp b/programs/Hadrons/Modules/ADWF.hpp index 6e2da691..0f4f5402 100644 --- a/programs/Hadrons/Modules/ADWF.hpp +++ b/programs/Hadrons/Modules/ADWF.hpp @@ -49,8 +49,6 @@ public: class ADWF: public Module { -public: - typedef FermionOperator FMat; public: // constructor ADWF(const std::string name); diff --git a/programs/Hadrons/Modules/AWilson.hpp b/programs/Hadrons/Modules/AWilson.hpp index dd5708ea..cb35525e 100644 --- a/programs/Hadrons/Modules/AWilson.hpp +++ b/programs/Hadrons/Modules/AWilson.hpp @@ -47,8 +47,6 @@ public: class AWilson: public Module { -public: - typedef FermionOperator FMat; public: // constructor AWilson(const std::string name); diff --git a/programs/Hadrons/Modules/CMeson.cc b/programs/Hadrons/Modules/CMeson.cc index 5e8d6d0c..c1cf153e 100644 --- a/programs/Hadrons/Modules/CMeson.cc +++ b/programs/Hadrons/Modules/CMeson.cc @@ -62,8 +62,8 @@ void CMeson::execute(void) << std::endl; XmlWriter writer(par().output); - LatticePropagator &q1 = *env().getObject(par().q1); - LatticePropagator &q2 = *env().getObject(par().q2); + PropagatorField &q1 = *env().getObject(par().q1); + PropagatorField &q2 = *env().getObject(par().q2); LatticeComplex c(env().getGrid()); SpinMatrix g[Ns*Ns], g5; std::vector buf; diff --git a/programs/Hadrons/Modules/MQuark.hpp b/programs/Hadrons/Modules/MQuark.hpp index f28a49a8..526815ef 100644 --- a/programs/Hadrons/Modules/MQuark.hpp +++ b/programs/Hadrons/Modules/MQuark.hpp @@ -47,9 +47,6 @@ public: class MQuark: public Module { -public: - typedef FIMPL::FermionField FermionField; - typedef std::function Solver; public: // constructor MQuark(const std::string name); diff --git a/programs/Hadrons/Modules/SolRBPrecCG.hpp b/programs/Hadrons/Modules/SolRBPrecCG.hpp index 39f241dc..b987eb95 100644 --- a/programs/Hadrons/Modules/SolRBPrecCG.hpp +++ b/programs/Hadrons/Modules/SolRBPrecCG.hpp @@ -47,10 +47,6 @@ public: class SolRBPrecCG: public Module { -public: - typedef FermionOperator FMat; - typedef FIMPL::FermionField FermionField; - typedef std::function Solver; public: // constructor SolRBPrecCG(const std::string name); diff --git a/programs/Hadrons/Modules/SrcPoint.cc b/programs/Hadrons/Modules/SrcPoint.cc index 34f1825e..ca9c1345 100644 --- a/programs/Hadrons/Modules/SrcPoint.cc +++ b/programs/Hadrons/Modules/SrcPoint.cc @@ -56,7 +56,7 @@ std::vector SrcPoint::getOutput(void) // setup /////////////////////////////////////////////////////////////////////// void SrcPoint::setup(void) { - env().registerLattice(getName()); + env().registerLattice(getName()); } // execution /////////////////////////////////////////////////////////////////// @@ -67,7 +67,7 @@ void SrcPoint::execute(void) LOG(Message) << "Creating point source at position [" << par().position << "]" << std::endl; - LatticePropagator &src = *env().createLattice(getName()); + PropagatorField &src = *env().createLattice(getName()); id = 1.; src = zero; pokeSite(id, src, position); diff --git a/programs/Hadrons/Modules/SrcZ2.cc b/programs/Hadrons/Modules/SrcZ2.cc index a614526d..74e3add0 100644 --- a/programs/Hadrons/Modules/SrcZ2.cc +++ b/programs/Hadrons/Modules/SrcZ2.cc @@ -56,7 +56,7 @@ std::vector SrcZ2::getOutput(void) // setup /////////////////////////////////////////////////////////////////////// void SrcZ2::setup(void) { - env().registerLattice(getName()); + env().registerLattice(getName()); } // execution /////////////////////////////////////////////////////////////////// @@ -77,7 +77,7 @@ void SrcZ2::execute(void) LOG(Message) << "Generating Z_2 band for " << par().tA << " <= t <= " << par().tB << std::endl; } - LatticePropagator &src = *env().createLattice(getName()); + PropagatorField &src = *env().createLattice(getName()); LatticeCoordinate(t, Tp); bernoulli(*env().get4dRng(), eta); eta = (2.*eta - shift)*(1./::sqrt(2.));