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

added output for source meson fields on all tsrc

This commit is contained in:
ferben 2019-03-05 12:01:55 +00:00
parent 802675f062
commit d7c7bff065
3 changed files with 67 additions and 11 deletions

View File

@ -85,7 +85,7 @@ std::vector<std::string> TDistilVectors<FImpl>::getInput(void)
template <typename FImpl>
std::vector<std::string> TDistilVectors<FImpl>::getOutput(void)
{
std::vector<std::string> out = {getName() + "_rho", getName() + "_phi"};
std::vector<std::string> out = {getName() + "_rho", getName() + "_phi", getName() + "_rho_all_tsrc"};
return out;
}
@ -106,6 +106,8 @@ void TDistilVectors<FImpl>::setup(void)
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
envCreate(std::vector<FermionField>, getName() + "_phi", 1,
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
envCreate(std::vector<FermionField>, getName() + "_rho_all_tsrc", 1,
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
GridCartesian * grid4d = env().getGrid();
@ -138,6 +140,7 @@ void TDistilVectors<FImpl>::execute(void)
auto &epack = envGet(Grid::Hadrons::EigenPack<LatticeColourVector>, par().eigenPack);
auto &rho = envGet(std::vector<FermionField>, getName() + "_rho");
auto &phi = envGet(std::vector<FermionField>, getName() + "_phi");
auto &rho_all = envGet(std::vector<FermionField>, getName() + "_rho_all_tsrc");
envGetTmp(LatticeSpinColourVector, tmp2);
@ -189,16 +192,38 @@ void TDistilVectors<FImpl>::execute(void)
}
}
}
SpinColourVector scv0;
std::vector<int> siteFirst(grid4d->Nd(),0);
peekSite(scv0, rho[vecindex], siteFirst);
auto & cplx0 = scv0()(0)(0);
std::cout << "site0[rho(vecindex = " << vecindex << ")] = " << cplx0 << std::endl;
}
}
}
}
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 < Ns; ds++) {
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * Ns*dt;
rho_all[vecindex] = zero;
tmp3d_nospin = zero;
for (int it = 0; it < Nt; it++){
t_inv = it;
if( t_inv >= Ntfirst && t_inv < Ntfirst + Ntlocal ) {
for (int ik = dk; ik < nvec; ik += LI){
for (int is = ds; is < Ns; is += Ns){ //at the moment, full spin dilution is enforced
ExtractSliceLocal(evec3d,epack.evec[ik],0,t_inv,3);
tmp3d_nospin = evec3d * noise[inoise + nnoise*(t_inv + Nt*(ik+nvec*is))];
tmp3d=zero;
pokeSpin(tmp3d,tmp3d_nospin,is);
tmp2=zero;
InsertSliceLocal(tmp3d,tmp2,0,t_inv-Ntfirst,Grid::QCD::Tdir);
rho_all[vecindex] += tmp2;
}
}
}
}
}
}
}
}
for (int inoise = 0; inoise < nnoise; inoise++) {
for (int dk = 0; dk < LI; dk++) {
@ -214,11 +239,6 @@ void TDistilVectors<FImpl>::execute(void)
}
InsertSliceLocal(sink_tslice,phi[vecindex],0,t-Ntfirst,Grid::QCD::Tdir);
}
SpinColourVector scv0;
std::vector<int> siteFirst(grid4d->Nd(),0);
peekSite(scv0, phi[vecindex], siteFirst);
auto & cplx0 = scv0()(0)(0);
std::cout << "site0[phi(vecindex = " << vecindex << ")] = " << cplx0 << std::endl;
}
}
}

View File

@ -269,6 +269,23 @@ void test_MesonFieldRho(Application &application)
application.createModule<MContraction::A2AMesonField>("DistilMesonFieldRho",A2AMesonFieldPar);
}
/////////////////////////////////////////////////////////////
// MesonFields - rhorhoall
/////////////////////////////////////////////////////////////
void test_MesonFieldRhoAll(Application &application)
{
// DistilVectors parameters
MContraction::A2AMesonField::Par A2AMesonFieldPar;
A2AMesonFieldPar.left="DistilVecs_rho_all_tsrc";
A2AMesonFieldPar.right="DistilVecs_rho_all_tsrc";
A2AMesonFieldPar.output="MesonSinksRhoAll";
A2AMesonFieldPar.gammas="all";
A2AMesonFieldPar.mom={"0 0 0"};
A2AMesonFieldPar.cacheBlock=2;
A2AMesonFieldPar.block=4;
application.createModule<MContraction::A2AMesonField>("DistilMesonFieldRhoAll",A2AMesonFieldPar);
}
/////////////////////////////////////////////////////////////
// BaryonFields - phiphiphi
/////////////////////////////////////////////////////////////
@ -774,6 +791,7 @@ int main(int argc, char *argv[])
test_Perambulators( application );
test_DistilVectors( application );
test_MesonField( application );
test_MesonFieldRhoAll( application );
break;
case 5: // 3
test_Global( application );

View File

@ -268,6 +268,23 @@ void test_MesonFieldRho(Application &application)
application.createModule<MContraction::A2AMesonField>("DistilMesonFieldRho",A2AMesonFieldPar);
}
/////////////////////////////////////////////////////////////
// MesonFields - rhorhoAll
/////////////////////////////////////////////////////////////
void test_MesonFieldRhoAll(Application &application)
{
// DistilVectors parameters
MContraction::A2AMesonField::Par A2AMesonFieldPar;
A2AMesonFieldPar.left="DistilVecs_rho_all_tsrc";
A2AMesonFieldPar.right="DistilVecs_rho_all_tsrc";
A2AMesonFieldPar.output="MesonSinksRhoAll";
A2AMesonFieldPar.gammas="all";
A2AMesonFieldPar.mom={"0 0 0"};
A2AMesonFieldPar.cacheBlock=2;
A2AMesonFieldPar.block=4;
application.createModule<MContraction::A2AMesonField>("DistilMesonFieldRhoAll",A2AMesonFieldPar);
}
/////////////////////////////////////////////////////////////
// BaryonFields - phiphiphi
/////////////////////////////////////////////////////////////
@ -757,6 +774,7 @@ int main(int argc, char *argv[])
test_DistilVectors( application );
test_MesonField( application );
test_MesonFieldRho( application );
test_MesonFieldRhoAll( application );
break;
}
LOG(Message) << "====== XML creation for test " << iTestNum << " complete ======" << std::endl;