1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 14:57:05 +01:00

Added ImportUnphysicalFermion and included appropriate logic for 5d w vectors in A2A code

This commit is contained in:
fionnoh
2018-07-21 00:08:11 +01:00
parent 94c7198001
commit c995788259
5 changed files with 31 additions and 7 deletions

View File

@ -79,6 +79,21 @@ void CayleyFermion5D<Impl>::ExportPhysicalFermionSource(const FermionField &solu
axpby_ssp_pminus(tmp, 1., tmp , 1., solution5d, 0, Ls-1);
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>
void CayleyFermion5D<Impl>::ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d)
{

View File

@ -91,6 +91,7 @@ namespace Grid {
virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d);
virtual void ExportPhysicalFermionSource(const FermionField &solution5d, FermionField &exported4d);
virtual void ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d);
virtual void ImportUnphysicalFermion(const FermionField &solution5d, FermionField &exported4d);
/////////////////////////////////////////////////////
// Instantiate different versions depending on Impl

View File

@ -162,13 +162,17 @@ namespace Grid {
{
imported = input;
};
virtual void ImportUnphysicalFermion(const FermionField &input,FermionField &imported)
{
imported=input;
};
virtual void ExportPhysicalFermionSolution(const FermionField &solution,FermionField &exported)
{
exported=solution;
};
virtual void ExportPhysicalFermionSource(const FermionField &solution, FermionField &exported)
virtual void ExportPhysicalFermionSource(const FermionField &solution,FermionField &exported)
{
exported = solution;
exported=solution;
};
};