1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

added smearParams struct

This commit is contained in:
david clarke 2023-06-12 16:55:44 -06:00
parent 1cf9ec1cce
commit 14d352ea4f
2 changed files with 44 additions and 10 deletions

View File

@ -51,17 +51,44 @@ template<class vobj> void gpermute(vobj & inout,int perm) {
}
/*! @brief structure holding the link treatment */
struct SmearingParameters{
SmearingParameters(){}
Real c_1; // 1 link
Real c_naik; // Naik term
Real c_3; // 3 link
Real c_5; // 5 link
Real c_7; // 7 link
Real c_lp; // 5 link Lepage
SmearingParameters(Real c1, Real cnaik, Real c3, Real c5, Real c7, Real clp) :
c_1(c1),
c_naik(cnaik),
c_3(c3),
c_5(c5),
c_7(c7),
c_lp(clp){}
};
/*! @brief create fat links from link variables. */
/*! @brief create fat links from link variables */
class Smear_HISQ_fat {
private:
GridCartesian* const _grid;
SmearingParameters _LVL1;
public:
// Eventually this will take, e.g., coefficients as argument
Smear_HISQ_fat(GridCartesian* grid) : _grid(grid) {
Smear_HISQ_fat(GridCartesian* grid, Real c1=1/8., Real cnaik=0., Real c3=1/16., Real c5=1/64., Real c7=1/384., Real clp=0.)
: _grid(grid),
_LVL1(c1,cnaik,c3,c5,c7,clp) {
assert(Nc == 3 && "HISQ smearing currently implemented only for Nc==3");
}
// Allow to pass a pointer to a C-style, double array for MILC convenience
Smear_HISQ_fat(GridCartesian* grid, double* coeff)
: _grid(grid),
_LVL1(coeff[0],coeff[1],coeff[2],coeff[3],coeff[4],coeff[5]) {
assert(Nc == 3 && "HISQ smearing currently implemented only for Nc==3");
}

View File

@ -47,31 +47,38 @@ struct fatParams: Serializable {
int main (int argc, char **argv)
{
// Initialize the Grid
Grid_init(&argc,&argv);
Coordinate latt_size = GridDefaultLatt();
Coordinate simd_layout = GridDefaultSimd(Nd,vComplexD::Nsimd());
Coordinate mpi_layout = GridDefaultMpi();
Grid_log("mpi = ",mpi_layout);
Grid_log("simd = ",simd_layout);
Grid_log("latt = ",latt_size);
GridCartesian GRID(latt_size,simd_layout,mpi_layout);
XmlReader Reader("fatParams.xml",false, "grid");
fatParams param(Reader);
// Instantiate the LatticeGaugeField objects holding thin (Umu) and fat (U_smr) links
LatticeGaugeField Umu(&GRID);
LatticeGaugeField U_smr(&GRID);
// Read in the parameter file
XmlReader Reader("fatParams.xml",false, "grid");
fatParams param(Reader);
FieldMetaData header;
// Read the configuration into Umu
NerscIO::readConfiguration(Umu, header, param.conf_in);
// Smear Umu and store result in U_smr
Smear_HISQ_fat hisq_fat(&GRID);
hisq_fat.smear(U_smr,Umu);
NerscIO::writeConfiguration(U_smr,param.conf_out,"HISQ");
// In the following, we test instantiation of Smear_HISQ_fat in different ways:
Smear_HISQ_fat hisq_fat_typical(&GRID,1,2,3,4,5,6);
double path_coeff[6] = {1, 2, 3, 4, 5, 6};
Smear_HISQ_fat hisq_fat_Cstyle(&GRID,path_coeff);
Grid_finalize();
}