mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	Hadrons: big update for getGrid, grids are now created automatically
This commit is contained in:
		@@ -32,4 +32,4 @@ using namespace Hadrons;
 | 
			
		||||
using namespace MAction;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TDWF<FIMPL>;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TDWF<FIMPLF>;
 | 
			
		||||
 
 | 
			
		||||
@@ -73,6 +73,7 @@ protected:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(DWF, TDWF<FIMPL>, MAction);
 | 
			
		||||
MODULE_REGISTER_TMP(DWFF, TDWF<FIMPLF>, MAction);
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *                        DWF template implementation                         *
 | 
			
		||||
@@ -111,12 +112,11 @@ void TDWF<FImpl>::setup(void)
 | 
			
		||||
    LOG(Message) << "Fermion boundary conditions: " << par().boundary
 | 
			
		||||
                 << std::endl;
 | 
			
		||||
                 
 | 
			
		||||
    env().createGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(LatticeGaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *env().getGrid();
 | 
			
		||||
    auto &grb4 = *env().getRbGrid();
 | 
			
		||||
    auto &g5   = *env().getGrid(par().Ls);
 | 
			
		||||
    auto &grb5 = *env().getRbGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(GaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *envGetGrid(FermionField);
 | 
			
		||||
    auto &grb4 = *envGetRbGrid(FermionField);
 | 
			
		||||
    auto &g5   = *envGetGrid(FermionField, par().Ls);
 | 
			
		||||
    auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
 | 
			
		||||
    std::vector<Complex> boundary = strToVec<Complex>(par().boundary);
 | 
			
		||||
    typename DomainWallFermion<FImpl>::ImplParams implParams(boundary);
 | 
			
		||||
    envCreateDerived(FMat, DomainWallFermion<FImpl>, getName(), par().Ls, U, g5,
 | 
			
		||||
 
 | 
			
		||||
@@ -32,3 +32,4 @@ using namespace Hadrons;
 | 
			
		||||
using namespace MAction;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TMobiusDWF<FIMPL>;
 | 
			
		||||
template class Grid::Hadrons::MAction::TMobiusDWF<FIMPLF>;
 | 
			
		||||
 
 | 
			
		||||
@@ -72,6 +72,7 @@ public:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(MobiusDWF, TMobiusDWF<FIMPL>, MAction);
 | 
			
		||||
MODULE_REGISTER_TMP(MobiusDWFF, TMobiusDWF<FIMPLF>, MAction);
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *                      TMobiusDWF implementation                             *
 | 
			
		||||
@@ -111,12 +112,11 @@ void TMobiusDWF<FImpl>::setup(void)
 | 
			
		||||
    LOG(Message) << "Fermion boundary conditions: " << par().boundary
 | 
			
		||||
                 << std::endl;
 | 
			
		||||
 | 
			
		||||
    env().createGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(LatticeGaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *env().getGrid();
 | 
			
		||||
    auto &grb4 = *env().getRbGrid();
 | 
			
		||||
    auto &g5   = *env().getGrid(par().Ls);
 | 
			
		||||
    auto &grb5 = *env().getRbGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(GaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *envGetGrid(FermionField);
 | 
			
		||||
    auto &grb4 = *envGetRbGrid(FermionField);
 | 
			
		||||
    auto &g5   = *envGetGrid(FermionField, par().Ls);
 | 
			
		||||
    auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
 | 
			
		||||
    std::vector<Complex> boundary = strToVec<Complex>(par().boundary);
 | 
			
		||||
    typename MobiusFermion<FImpl>::ImplParams implParams(boundary);
 | 
			
		||||
    envCreateDerived(FMat, MobiusFermion<FImpl>, getName(), par().Ls, U, g5,
 | 
			
		||||
 
 | 
			
		||||
@@ -32,3 +32,4 @@ using namespace Hadrons;
 | 
			
		||||
using namespace MAction;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TScaledDWF<FIMPL>;
 | 
			
		||||
template class Grid::Hadrons::MAction::TScaledDWF<FIMPLF>;
 | 
			
		||||
 
 | 
			
		||||
@@ -71,6 +71,7 @@ public:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(ScaledDWF, TScaledDWF<FIMPL>, MAction);
 | 
			
		||||
MODULE_REGISTER_TMP(ScaledDWFF, TScaledDWF<FIMPLF>, MAction);
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *                      TScaledDWF implementation                             *
 | 
			
		||||
@@ -110,12 +111,11 @@ void TScaledDWF<FImpl>::setup(void)
 | 
			
		||||
    LOG(Message) << "Fermion boundary conditions: " << par().boundary
 | 
			
		||||
                 << std::endl;
 | 
			
		||||
 | 
			
		||||
    env().createGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(LatticeGaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *env().getGrid();
 | 
			
		||||
    auto &grb4 = *env().getRbGrid();
 | 
			
		||||
    auto &g5   = *env().getGrid(par().Ls);
 | 
			
		||||
    auto &grb5 = *env().getRbGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(GaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *envGetGrid(FermionField);
 | 
			
		||||
    auto &grb4 = *envGetRbGrid(FermionField);
 | 
			
		||||
    auto &g5   = *envGetGrid(FermionField, par().Ls);
 | 
			
		||||
    auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
 | 
			
		||||
    std::vector<Complex> boundary = strToVec<Complex>(par().boundary);
 | 
			
		||||
    typename MobiusFermion<FImpl>::ImplParams implParams(boundary);
 | 
			
		||||
    envCreateDerived(FMat, ScaledShamirFermion<FImpl>, getName(), par().Ls, U, g5,
 | 
			
		||||
 
 | 
			
		||||
@@ -32,4 +32,4 @@ using namespace Hadrons;
 | 
			
		||||
using namespace MAction;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TWilson<FIMPL>;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TWilson<FIMPLF>;
 | 
			
		||||
 
 | 
			
		||||
@@ -71,6 +71,7 @@ protected:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(Wilson, TWilson<FIMPL>, MAction);
 | 
			
		||||
MODULE_REGISTER_TMP(WilsonF, TWilson<FIMPLF>, MAction);
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *                     TWilson template implementation                        *
 | 
			
		||||
@@ -107,9 +108,9 @@ void TWilson<FImpl>::setup(void)
 | 
			
		||||
    LOG(Message) << "Fermion boundary conditions: " << par().boundary
 | 
			
		||||
                 << std::endl;
 | 
			
		||||
                 
 | 
			
		||||
    auto &U      = envGet(LatticeGaugeField, par().gauge);
 | 
			
		||||
    auto &grid   = *env().getGrid();
 | 
			
		||||
    auto &gridRb = *env().getRbGrid();
 | 
			
		||||
    auto &U      = envGet(GaugeField, par().gauge);
 | 
			
		||||
    auto &grid   = *envGetGrid(FermionField);
 | 
			
		||||
    auto &gridRb = *envGetRbGrid(FermionField);
 | 
			
		||||
    std::vector<Complex> boundary = strToVec<Complex>(par().boundary);
 | 
			
		||||
    typename WilsonFermion<FImpl>::ImplParams implParams(boundary);
 | 
			
		||||
    envCreateDerived(FMat, WilsonFermion<FImpl>, getName(), 1, U, grid, gridRb,
 | 
			
		||||
 
 | 
			
		||||
@@ -32,4 +32,4 @@ using namespace Hadrons;
 | 
			
		||||
using namespace MAction;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TWilsonClover<FIMPL>;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TWilsonClover<FIMPLF>;
 | 
			
		||||
 
 | 
			
		||||
@@ -75,9 +75,10 @@ public:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(WilsonClover, TWilsonClover<FIMPL>, MAction);
 | 
			
		||||
MODULE_REGISTER_TMP(WilsonCloverF, TWilsonClover<FIMPLF>, MAction);
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *                     TWilsonClover template implementation                        *
 | 
			
		||||
 *                    TWilsonClover template implementation                   *
 | 
			
		||||
 ******************************************************************************/
 | 
			
		||||
// constructor /////////////////////////////////////////////////////////////////
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -113,16 +114,14 @@ void TWilsonClover<FImpl>::setup(void)
 | 
			
		||||
    LOG(Message) << "Clover term csw_r: " << par().csw_r
 | 
			
		||||
                 << " csw_t: " << par().csw_t
 | 
			
		||||
                 << std::endl;
 | 
			
		||||
    auto &U      = envGet(LatticeGaugeField, par().gauge);
 | 
			
		||||
    auto &grid   = *env().getGrid();
 | 
			
		||||
    auto &gridRb = *env().getRbGrid();
 | 
			
		||||
    auto &U      = envGet(GaugeField, par().gauge);
 | 
			
		||||
    auto &grid   = *envGetGrid(FermionField);
 | 
			
		||||
    auto &gridRb = *envGetRbGrid(FermionField);
 | 
			
		||||
    std::vector<Complex> boundary = strToVec<Complex>(par().boundary);
 | 
			
		||||
    typename WilsonCloverFermion<FImpl>::ImplParams implParams(boundary);
 | 
			
		||||
    envCreateDerived(FMat, WilsonCloverFermion<FImpl>, getName(), 1, U, grid, gridRb, par().mass,
 | 
			
		||||
						  par().csw_r,
 | 
			
		||||
						  par().csw_t,
 | 
			
		||||
					      par().clover_anisotropy,
 | 
			
		||||
						  implParams); 
 | 
			
		||||
    envCreateDerived(FMat, WilsonCloverFermion<FImpl>, getName(), 1, U, grid,
 | 
			
		||||
                     gridRb, par().mass, par().csw_r, par().csw_t, 
 | 
			
		||||
                     par().clover_anisotropy, implParams); 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// execution ///////////////////////////////////////////////////////////////////
 | 
			
		||||
 
 | 
			
		||||
@@ -32,4 +32,4 @@ using namespace Hadrons;
 | 
			
		||||
using namespace MAction;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TZMobiusDWF<ZFIMPL>;
 | 
			
		||||
 | 
			
		||||
template class Grid::Hadrons::MAction::TZMobiusDWF<ZFIMPLF>;
 | 
			
		||||
 
 | 
			
		||||
@@ -73,6 +73,7 @@ public:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(ZMobiusDWF, TZMobiusDWF<ZFIMPL>, MAction);
 | 
			
		||||
MODULE_REGISTER_TMP(ZMobiusDWFF, TZMobiusDWF<ZFIMPLF>, MAction);
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *                     TZMobiusDWF implementation                             *
 | 
			
		||||
@@ -118,11 +119,11 @@ void TZMobiusDWF<FImpl>::setup(void)
 | 
			
		||||
                 << std::endl;
 | 
			
		||||
 | 
			
		||||
    env().createGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(LatticeGaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *env().getGrid();
 | 
			
		||||
    auto &grb4 = *env().getRbGrid();
 | 
			
		||||
    auto &g5   = *env().getGrid(par().Ls);
 | 
			
		||||
    auto &grb5 = *env().getRbGrid(par().Ls);
 | 
			
		||||
    auto &U    = envGet(GaugeField, par().gauge);
 | 
			
		||||
    auto &g4   = *envGetGrid(FermionField);
 | 
			
		||||
    auto &grb4 = *envGetRbGrid(FermionField);
 | 
			
		||||
    auto &g5   = *envGetGrid(FermionField, par().Ls);
 | 
			
		||||
    auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
 | 
			
		||||
    auto omega = par().omega;
 | 
			
		||||
    std::vector<Complex> boundary = strToVec<Complex>(par().boundary);
 | 
			
		||||
    typename ZMobiusFermion<FImpl>::ImplParams implParams(boundary);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user