mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Added ImportUnphysicalFermion and included appropriate logic for 5d w vectors in A2A code
This commit is contained in:
parent
94c7198001
commit
c995788259
@ -51,14 +51,14 @@ class A2AModesSchurDiagTwo
|
|||||||
v_high_4d.resize(size_4d, grid_4d);
|
v_high_4d.resize(size_4d, grid_4d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void high_modes(Field &source_5d, Field &source_4d, int i)
|
void high_modes(Field &source_5d, Field &w_source_5d, Field &source_4d, int i)
|
||||||
{
|
{
|
||||||
int i5d;
|
int i5d;
|
||||||
LOG(Message) << "A2A high modes for i = " << i << std::endl;
|
LOG(Message) << "A2A high modes for i = " << i << std::endl;
|
||||||
i5d = 0;
|
i5d = 0;
|
||||||
if (return_5d) i5d = i;
|
if (return_5d) i5d = i;
|
||||||
this->high_mode_v(action, solver, source_5d, v_high_5d[i5d], v_high_4d[i]);
|
this->high_mode_v(action, solver, source_5d, v_high_5d[i5d], v_high_4d[i]);
|
||||||
this->high_mode_w(source_5d, source_4d, w_high_5d[i5d], w_high_4d[i]);
|
this->high_mode_w(w_source_5d, source_4d, w_high_5d[i5d], w_high_4d[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void return_v(int i, Field &vout_5d, Field &vout_4d)
|
void return_v(int i, Field &vout_5d, Field &vout_4d)
|
||||||
@ -181,9 +181,9 @@ class A2AModesSchurDiagTwo
|
|||||||
action.ExportPhysicalFermionSolution(vout_5d, vout_4d);
|
action.ExportPhysicalFermionSolution(vout_5d, vout_4d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void high_mode_w(const Field &source_5d, const Field &source_4d, Field &wout_5d, Field &wout_4d)
|
void high_mode_w(const Field &w_source_5d, const Field &source_4d, Field &wout_5d, Field &wout_4d)
|
||||||
{
|
{
|
||||||
wout_5d = source_5d;
|
wout_5d = w_source_5d;
|
||||||
wout_4d = source_4d;
|
wout_4d = source_4d;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -130,6 +130,7 @@ void TA2AVectors<FImpl, nBasis>::setup(void)
|
|||||||
auto &action = envGet(FMat, par().action);
|
auto &action = envGet(FMat, par().action);
|
||||||
|
|
||||||
envTmpLat(FermionField, "ferm_src", Ls_);
|
envTmpLat(FermionField, "ferm_src", Ls_);
|
||||||
|
envTmpLat(FermionField, "unphys_ferm", Ls_);
|
||||||
envTmpLat(FermionField, "tmp");
|
envTmpLat(FermionField, "tmp");
|
||||||
envTmpLat(FermionField, "tmp2");
|
envTmpLat(FermionField, "tmp2");
|
||||||
|
|
||||||
@ -183,6 +184,7 @@ void TA2AVectors<FImpl, nBasis>::execute(void)
|
|||||||
int Nsrc = par().sources.size();
|
int Nsrc = par().sources.size();
|
||||||
|
|
||||||
envGetTmp(FermionField, ferm_src);
|
envGetTmp(FermionField, ferm_src);
|
||||||
|
envGetTmp(FermionField, unphys_ferm);
|
||||||
envGetTmp(FermionField, tmp);
|
envGetTmp(FermionField, tmp);
|
||||||
envGetTmp(FermionField, tmp2);
|
envGetTmp(FermionField, tmp2);
|
||||||
|
|
||||||
@ -205,6 +207,7 @@ void TA2AVectors<FImpl, nBasis>::execute(void)
|
|||||||
{
|
{
|
||||||
PropToFerm<FImpl>(tmp, prop_src, s, c);
|
PropToFerm<FImpl>(tmp, prop_src, s, c);
|
||||||
action.ImportPhysicalFermionSource(tmp, ferm_src);
|
action.ImportPhysicalFermionSource(tmp, ferm_src);
|
||||||
|
action.ImportUnphysicalFermion(tmp, unphys_ferm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// source conversion for 5D sources
|
// source conversion for 5D sources
|
||||||
@ -218,10 +221,11 @@ void TA2AVectors<FImpl, nBasis>::execute(void)
|
|||||||
{
|
{
|
||||||
PropToFerm<FImpl>(ferm_src, prop_src, s, c);
|
PropToFerm<FImpl>(ferm_src, prop_src, s, c);
|
||||||
action.ExportPhysicalFermionSolution(ferm_src, tmp);
|
action.ExportPhysicalFermionSolution(ferm_src, tmp);
|
||||||
|
unphys_ferm = ferm_src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG(Message) << "a2areturn.high_modes Ncount = " << N_count << std::endl;
|
LOG(Message) << "a2areturn.high_modes Ncount = " << N_count << std::endl;
|
||||||
a2areturn.high_modes(ferm_src, tmp, N_count);
|
a2areturn.high_modes(ferm_src, unphys_ferm, tmp, N_count);
|
||||||
N_count++;
|
N_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,21 @@ void CayleyFermion5D<Impl>::ExportPhysicalFermionSource(const FermionField &solu
|
|||||||
axpby_ssp_pminus(tmp, 1., tmp , 1., solution5d, 0, Ls-1);
|
axpby_ssp_pminus(tmp, 1., tmp , 1., solution5d, 0, Ls-1);
|
||||||
ExtractSlice(exported4d, tmp, 0, 0);
|
ExtractSlice(exported4d, tmp, 0, 0);
|
||||||
}
|
}
|
||||||
|
template<class Impl>
|
||||||
|
void CayleyFermion5D<Impl>::ImportUnphysicalFermion(const FermionField &input4d,FermionField &imported5d)
|
||||||
|
{
|
||||||
|
int Ls = this->Ls;
|
||||||
|
FermionField tmp(this->FermionGrid());
|
||||||
|
conformable(imported5d._grid,this->FermionGrid());
|
||||||
|
conformable(input4d._grid ,this->GaugeGrid());
|
||||||
|
tmp = zero;
|
||||||
|
InsertSlice(input4d, tmp, 0 , 0);
|
||||||
|
InsertSlice(input4d, tmp, Ls-1, 0);
|
||||||
|
axpby_ssp_pplus (tmp, 0., tmp, 1., tmp, 0, 0);
|
||||||
|
axpby_ssp_pminus(tmp, 0., tmp, 1., tmp, Ls-1, Ls-1);
|
||||||
|
imported5d=tmp;
|
||||||
|
}
|
||||||
|
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
void CayleyFermion5D<Impl>::ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d)
|
void CayleyFermion5D<Impl>::ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d)
|
||||||
{
|
{
|
||||||
|
@ -91,6 +91,7 @@ namespace Grid {
|
|||||||
virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d);
|
virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d);
|
||||||
virtual void ExportPhysicalFermionSource(const FermionField &solution5d, FermionField &exported4d);
|
virtual void ExportPhysicalFermionSource(const FermionField &solution5d, FermionField &exported4d);
|
||||||
virtual void ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d);
|
virtual void ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d);
|
||||||
|
virtual void ImportUnphysicalFermion(const FermionField &solution5d, FermionField &exported4d);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
// Instantiate different versions depending on Impl
|
// Instantiate different versions depending on Impl
|
||||||
|
@ -162,13 +162,17 @@ namespace Grid {
|
|||||||
{
|
{
|
||||||
imported = input;
|
imported = input;
|
||||||
};
|
};
|
||||||
|
virtual void ImportUnphysicalFermion(const FermionField &input,FermionField &imported)
|
||||||
|
{
|
||||||
|
imported=input;
|
||||||
|
};
|
||||||
virtual void ExportPhysicalFermionSolution(const FermionField &solution,FermionField &exported)
|
virtual void ExportPhysicalFermionSolution(const FermionField &solution,FermionField &exported)
|
||||||
{
|
{
|
||||||
exported=solution;
|
exported=solution;
|
||||||
};
|
};
|
||||||
virtual void ExportPhysicalFermionSource(const FermionField &solution, FermionField &exported)
|
virtual void ExportPhysicalFermionSource(const FermionField &solution,FermionField &exported)
|
||||||
{
|
{
|
||||||
exported = solution;
|
exported=solution;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user