mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 12:47:05 +01:00
Namespace, indent
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
/*************************************************************************************
|
/*************************************************************************************
|
||||||
|
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
@ -24,22 +24,21 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
See the full license in the file "LICENSE" in the top level distribution directory
|
See the full license in the file "LICENSE" in the top level distribution directory
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
#include <Grid/qcd/action/fermion/FermionCore.h>
|
#include <Grid/qcd/action/fermion/FermionCore.h>
|
||||||
#include <Grid/qcd/action/fermion/ContinuedFractionFermion5D.h>
|
#include <Grid/qcd/action/fermion/ContinuedFractionFermion5D.h>
|
||||||
|
|
||||||
namespace Grid {
|
NAMESPACE_BEGIN(Grid);
|
||||||
namespace QCD {
|
|
||||||
|
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD scale)
|
void ContinuedFractionFermion5D<Impl>::SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD scale)
|
||||||
{
|
{
|
||||||
SetCoefficientsZolotarev(1.0/scale,zdata);
|
SetCoefficientsZolotarev(1.0/scale,zdata);
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::SetCoefficientsZolotarev(RealD zolo_hi,Approx::zolotarev_data *zdata)
|
void ContinuedFractionFermion5D<Impl>::SetCoefficientsZolotarev(RealD zolo_hi,Approx::zolotarev_data *zdata)
|
||||||
{
|
{
|
||||||
// How to check Ls matches??
|
// How to check Ls matches??
|
||||||
// std::cout<<GridLogMessage << Ls << " Ls"<<std::endl;
|
// std::cout<<GridLogMessage << Ls << " Ls"<<std::endl;
|
||||||
// std::cout<<GridLogMessage << zdata->n << " - n"<<std::endl;
|
// std::cout<<GridLogMessage << zdata->n << " - n"<<std::endl;
|
||||||
@ -88,13 +87,13 @@ namespace Grid {
|
|||||||
for(int s=0;s<Ls;s++){
|
for(int s=0;s<Ls;s++){
|
||||||
std::cout<<GridLogMessage <<"s = "<<s<<" Beta "<<Beta[s]<<" Aee "<<Aee[s] <<" See "<<See[s] <<std::endl;
|
std::cout<<GridLogMessage <<"s = "<<s<<" Beta "<<Beta[s]<<" Aee "<<Aee[s] <<" See "<<See[s] <<std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
RealD ContinuedFractionFermion5D<Impl>::M (const FermionField &psi, FermionField &chi)
|
RealD ContinuedFractionFermion5D<Impl>::M (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
FermionField D(psi._grid);
|
FermionField D(psi._grid);
|
||||||
@ -116,17 +115,17 @@ namespace Grid {
|
|||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
return norm2(chi);
|
return norm2(chi);
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
RealD ContinuedFractionFermion5D<Impl>::Mdag (const FermionField &psi, FermionField &chi)
|
RealD ContinuedFractionFermion5D<Impl>::Mdag (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
// This matrix is already hermitian. (g5 Dw) = Dw dag g5 = (g5 Dw)dag
|
// This matrix is already hermitian. (g5 Dw) = Dw dag g5 = (g5 Dw)dag
|
||||||
// The rest of matrix is symmetric.
|
// The rest of matrix is symmetric.
|
||||||
// Can ignore "dag"
|
// Can ignore "dag"
|
||||||
return M(psi,chi);
|
return M(psi,chi);
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::Mdir (const FermionField &psi, FermionField &chi,int dir,int disp){
|
void ContinuedFractionFermion5D<Impl>::Mdir (const FermionField &psi, FermionField &chi,int dir,int disp){
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
this->DhopDir(psi,chi,dir,disp); // Dslash on diagonal. g5 Dslash is hermitian
|
this->DhopDir(psi,chi,dir,disp); // Dslash on diagonal. g5 Dslash is hermitian
|
||||||
@ -140,10 +139,10 @@ namespace Grid {
|
|||||||
}
|
}
|
||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::Meooe (const FermionField &psi, FermionField &chi)
|
void ContinuedFractionFermion5D<Impl>::Meooe (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
// Apply 4d dslash
|
// Apply 4d dslash
|
||||||
@ -162,15 +161,15 @@ namespace Grid {
|
|||||||
}
|
}
|
||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MeooeDag (const FermionField &psi, FermionField &chi)
|
void ContinuedFractionFermion5D<Impl>::MeooeDag (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
this->Meooe(psi,chi);
|
this->Meooe(psi,chi);
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::Mooee (const FermionField &psi, FermionField &chi)
|
void ContinuedFractionFermion5D<Impl>::Mooee (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
int sign=1;
|
int sign=1;
|
||||||
@ -188,16 +187,16 @@ namespace Grid {
|
|||||||
}
|
}
|
||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MooeeDag (const FermionField &psi, FermionField &chi)
|
void ContinuedFractionFermion5D<Impl>::MooeeDag (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
this->Mooee(psi,chi);
|
this->Mooee(psi,chi);
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MooeeInv (const FermionField &psi, FermionField &chi)
|
void ContinuedFractionFermion5D<Impl>::MooeeInv (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
// Apply Linv
|
// Apply Linv
|
||||||
@ -214,17 +213,17 @@ namespace Grid {
|
|||||||
for(int s=Ls-2;s>=0;s--){
|
for(int s=Ls-2;s>=0;s--){
|
||||||
axpbg5y_ssp(chi,1.0/cc_d[s],chi,-1.0*cc_d[s+1]/See[s]/cc_d[s],chi,s,s+1);
|
axpbg5y_ssp(chi,1.0/cc_d[s],chi,-1.0*cc_d[s+1]/See[s]/cc_d[s],chi,s,s+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MooeeInvDag (const FermionField &psi, FermionField &chi)
|
void ContinuedFractionFermion5D<Impl>::MooeeInvDag (const FermionField &psi, FermionField &chi)
|
||||||
{
|
{
|
||||||
this->MooeeInv(psi,chi);
|
this->MooeeInv(psi,chi);
|
||||||
}
|
}
|
||||||
|
|
||||||
// force terms; five routines; default to Dhop on diagonal
|
// force terms; five routines; default to Dhop on diagonal
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
void ContinuedFractionFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
FermionField D(V._grid);
|
FermionField D(V._grid);
|
||||||
@ -239,10 +238,10 @@ namespace Grid {
|
|||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
this->DhopDeriv(mat,D,V,DaggerNo);
|
this->DhopDeriv(mat,D,V,DaggerNo);
|
||||||
};
|
};
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
void ContinuedFractionFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
FermionField D(V._grid);
|
FermionField D(V._grid);
|
||||||
@ -257,10 +256,10 @@ namespace Grid {
|
|||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
this->DhopDerivOE(mat,D,V,DaggerNo);
|
this->DhopDerivOE(mat,D,V,DaggerNo);
|
||||||
};
|
};
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void ContinuedFractionFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
void ContinuedFractionFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
|
|
||||||
FermionField D(V._grid);
|
FermionField D(V._grid);
|
||||||
@ -275,11 +274,11 @@ namespace Grid {
|
|||||||
sign=-sign;
|
sign=-sign;
|
||||||
}
|
}
|
||||||
this->DhopDerivEO(mat,D,V,DaggerNo);
|
this->DhopDerivEO(mat,D,V,DaggerNo);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
ContinuedFractionFermion5D<Impl>::ContinuedFractionFermion5D(
|
ContinuedFractionFermion5D<Impl>::ContinuedFractionFermion5D(
|
||||||
GaugeField &_Umu,
|
GaugeField &_Umu,
|
||||||
GridCartesian &FiveDimGrid,
|
GridCartesian &FiveDimGrid,
|
||||||
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
||||||
@ -290,13 +289,11 @@ namespace Grid {
|
|||||||
FiveDimGrid, FiveDimRedBlackGrid,
|
FiveDimGrid, FiveDimRedBlackGrid,
|
||||||
FourDimGrid, FourDimRedBlackGrid,M5,p),
|
FourDimGrid, FourDimRedBlackGrid,M5,p),
|
||||||
mass(_mass)
|
mass(_mass)
|
||||||
{
|
{
|
||||||
int Ls = this->Ls;
|
int Ls = this->Ls;
|
||||||
assert((Ls&0x1)==1); // Odd Ls required
|
assert((Ls&0x1)==1); // Odd Ls required
|
||||||
}
|
|
||||||
|
|
||||||
FermOpTemplateInstantiate(ContinuedFractionFermion5D);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FermOpTemplateInstantiate(ContinuedFractionFermion5D);
|
||||||
|
|
||||||
|
NAMESPACE_END(Grid);
|
||||||
|
Reference in New Issue
Block a user