From 5fc01882056d3681d0064fbd6360d81ad9c75e33 Mon Sep 17 00:00:00 2001 From: Felix Erben Date: Mon, 1 Jul 2019 14:51:59 +0100 Subject: [PATCH] started saving sinks --- Hadrons/Modules/MDistil/Perambulator.hpp | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Hadrons/Modules/MDistil/Perambulator.hpp b/Hadrons/Modules/MDistil/Perambulator.hpp index d297ca16..0da47c57 100644 --- a/Hadrons/Modules/MDistil/Perambulator.hpp +++ b/Hadrons/Modules/MDistil/Perambulator.hpp @@ -257,6 +257,43 @@ void TPerambulator::execute(void) //perambulator.WriteBinary(sPerambName); perambulator.write(sPerambName.c_str()); } + + const int X{grid4d->GlobalDimensions()[0]}; + const int Y{grid4d->GlobalDimensions()[1]}; + const int Z{grid4d->GlobalDimensions()[2]}; + const int T{grid4d->GlobalDimensions()[3]}; + + + if(grid4d->IsBoss()) { + Eigen::Tensor sink(nnoise,LI,Nt_inv,SI,X,Y,Z,T,3,4); + + for (int inoise = 0; inoise < nnoise; inoise++) { + for (int dk = 0; dk < LI; dk++) { + for (int dt = 0; dt < Nt_inv; dt++) { + for (int ds = 0; ds < SI; ds++) { + for (int ix=0; ix < X; ix++) { + for (int iy=0; iy < Y; iy++) { + for (int iz=0; iz < Z; iz++) { + for (int it=0; it < T; it++) { + std::vector site({ix,iy,iz,it}); + for (int ic=0; ic < 3; ic++) { + for (int is=0; is < 4; is++) { + //peekSite(sink[inoise,dk,dt,ds,ix,iy,iz,it,ic,is],unsmeared_sink[inoise+nnoise*(dk+LI*(dt+Nt_inv*ds))]()(is)(ic),site); // Build fails when uncommenting + + }} + }}}} + } + } + } + } + + std::string filename ="./" + par().PerambFileName + "_sink.h5"; + std::cout << "Writing to file " << filename << std::endl; + Grid::Hdf5Writer writer(filename); + write(writer,"unsmeared_sink",sink); + } + + } END_MODULE_NAMESPACE