1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00
Grid/tests/smearing/Test_fatLinks.cc

77 lines
1.9 KiB
C++
Raw Normal View History

/*
* Test_fatLinks.cc
*
* D. Clarke
*
* Test the various constructs used to make fat links.
*
*/
#include <Grid/Grid.h>
2023-05-21 11:33:20 +01:00
#include <Grid/lattice/PaddedCell.h>
#include <Grid/stencil/GeneralLocalStencil.h>
2023-06-09 00:37:25 +01:00
#include <Grid/qcd/smearing/HISQSmearing.h>
using namespace Grid;
2023-05-21 11:33:20 +01:00
// Make the logger work like Python print()
template<typename ... Args>
inline std::string sjoin(Args&&... args) noexcept {
std::ostringstream msg;
(msg << ... << args);
return msg.str();
}
template <typename ... Args>
inline void Grid_log(Args&&... args) {
std::string msg = sjoin(std::forward<Args>(args)...);
std::cout << GridLogMessage << msg << std::endl;
}
2023-05-21 11:33:20 +01:00
struct fatParams: Serializable {
GRID_SERIALIZABLE_CLASS_MEMBERS(
fatParams,
std::string, conf_in,
std::string, conf_out);
2023-05-21 11:33:20 +01:00
template <class ReaderClass>
fatParams(Reader<ReaderClass>& Reader){
read(Reader, "parameters", *this);
}
2023-05-21 11:33:20 +01:00
};
2023-06-09 00:37:25 +01:00
//
// one method: input --> fat
// another : input --> long (naik)
// another : input --> unitarize
//
int main (int argc, char **argv)
{
2023-05-21 11:33:20 +01:00
Grid_init(&argc,&argv);
Coordinate latt_size = GridDefaultLatt();
2023-05-21 11:33:20 +01:00
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);
LatticeGaugeField Umu(&GRID);
2023-06-09 00:37:25 +01:00
LatticeGaugeField U_smr(&GRID);
2023-05-21 11:33:20 +01:00
FieldMetaData header;
NerscIO::readConfiguration(Umu, header, param.conf_in);
2023-06-09 00:37:25 +01:00
Smear_HISQ_3link hisq_3link(&GRID);
2023-06-09 00:37:25 +01:00
hisq_3link.smear(U_smr,Umu);
2023-06-09 00:37:25 +01:00
NerscIO::writeConfiguration(U_smr,param.conf_out,"HISQ");
Grid_finalize();
}