mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-12 07:00:45 +01:00
QedFVol: New structure for ChargedProp output files
This commit is contained in:
parent
4e0cf0cc28
commit
ac3b0ebc58
@ -114,7 +114,7 @@ void TChargedProp::execute(void)
|
|||||||
auto &G = envGet(ScalarField, freeMomPropName_);
|
auto &G = envGet(ScalarField, freeMomPropName_);
|
||||||
auto &fft = envGet(FFT, fftName_);
|
auto &fft = envGet(FFT, fftName_);
|
||||||
double q = par().charge;
|
double q = par().charge;
|
||||||
envGetTmp(ScalarField, buf);
|
envGetTmp(ScalarField, buf);
|
||||||
|
|
||||||
// -G*momD1*G*F*Src (momD1 = F*D1*Finv)
|
// -G*momD1*G*F*Src (momD1 = F*D1*Finv)
|
||||||
propQ = GFSrc;
|
propQ = GFSrc;
|
||||||
@ -141,62 +141,52 @@ void TChargedProp::execute(void)
|
|||||||
// OUTPUT IF NECESSARY
|
// OUTPUT IF NECESSARY
|
||||||
if (!par().output.empty())
|
if (!par().output.empty())
|
||||||
{
|
{
|
||||||
|
Result result;
|
||||||
|
TComplex site;
|
||||||
|
std::vector<int> siteCoor;
|
||||||
|
|
||||||
|
LOG(Message) << "Saving momentum-projected propagator to '"
|
||||||
|
<< RESULT_FILE_NAME(par().output) << "'..."
|
||||||
|
<< std::endl;
|
||||||
|
result.projection.resize(par().outputMom.size());
|
||||||
|
result.lattice_size = env().getGrid()->_fdimensions;
|
||||||
|
result.mass = par().mass;
|
||||||
|
result.charge = q;
|
||||||
|
siteCoor.resize(env().getNd());
|
||||||
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
||||||
{
|
{
|
||||||
std::vector<int> mom = strToVec<int>(par().outputMom[i_p]);
|
result.projection[i_p].momentum = strToVec<int>(par().outputMom[i_p]);
|
||||||
std::string filename = par().output + "_"
|
|
||||||
+ std::to_string(mom[0])
|
|
||||||
+ std::to_string(mom[1])
|
|
||||||
+ std::to_string(mom[2]);
|
|
||||||
|
|
||||||
LOG(Message) << "Saving (" << par().outputMom[i_p]
|
LOG(Message) << "Calculating (" << par().outputMom[i_p]
|
||||||
<< ") momentum projection to '" << filename << "'..."
|
<< ") momentum projection" << std::endl;
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
std::vector<Complex> result, result0, resultQ, resultSun, resultTad;
|
result.projection[i_p].corr_0.resize(env().getGrid()->_fdimensions[env().getNd()-1]);
|
||||||
result.resize(env().getGrid()->_fdimensions[env().getNd()-1]);
|
result.projection[i_p].corr.resize(env().getGrid()->_fdimensions[env().getNd()-1]);
|
||||||
result0.resize(result.size());
|
result.projection[i_p].corr_Q.resize(env().getGrid()->_fdimensions[env().getNd()-1]);
|
||||||
resultQ.resize(result.size());
|
result.projection[i_p].corr_Sun.resize(env().getGrid()->_fdimensions[env().getNd()-1]);
|
||||||
resultSun.resize(result.size());
|
result.projection[i_p].corr_Tad.resize(env().getGrid()->_fdimensions[env().getNd()-1]);
|
||||||
resultTad.resize(result.size());
|
|
||||||
|
|
||||||
TComplex site;
|
|
||||||
std::vector<int> whichmom;
|
|
||||||
whichmom.resize(env().getNd());
|
|
||||||
|
|
||||||
for (unsigned int j = 0; j < env().getNd()-1; ++j)
|
for (unsigned int j = 0; j < env().getNd()-1; ++j)
|
||||||
{
|
{
|
||||||
whichmom[j] = mom[j];
|
siteCoor[j] = result.projection[i_p].momentum[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int t = 0; t < result.size(); ++t)
|
for (unsigned int t = 0; t < result.projection[i_p].corr.size(); ++t)
|
||||||
{
|
{
|
||||||
whichmom[env().getNd()-1] = t;
|
siteCoor[env().getNd()-1] = t;
|
||||||
// Write full propagator
|
peekSite(site, prop, siteCoor);
|
||||||
peekSite(site, prop, whichmom);
|
result.projection[i_p].corr[t]=TensorRemove(site);
|
||||||
result[t]=TensorRemove(site);
|
peekSite(site, buf, siteCoor);
|
||||||
// Write free propagator
|
result.projection[i_p].corr_0[t]=TensorRemove(site);
|
||||||
peekSite(site, buf, whichmom);
|
peekSite(site, propQ, siteCoor);
|
||||||
result0[t]=TensorRemove(site);
|
result.projection[i_p].corr_Q[t]=TensorRemove(site);
|
||||||
// Write propagator O(q) term
|
peekSite(site, propSun, siteCoor);
|
||||||
peekSite(site, propQ, whichmom);
|
result.projection[i_p].corr_Sun[t]=TensorRemove(site);
|
||||||
resultQ[t]=TensorRemove(site);
|
peekSite(site, propTad, siteCoor);
|
||||||
// Write propagator sunset term
|
result.projection[i_p].corr_Tad[t]=TensorRemove(site);
|
||||||
peekSite(site, propSun, whichmom);
|
|
||||||
resultSun[t]=TensorRemove(site);
|
|
||||||
// Write propagator tadpole term
|
|
||||||
peekSite(site, propTad, whichmom);
|
|
||||||
resultTad[t]=TensorRemove(site);
|
|
||||||
}
|
}
|
||||||
ResultWriter writer(RESULT_FILE_NAME(filename));
|
|
||||||
write(writer, "charge", q);
|
|
||||||
write(writer, "mass", par().mass);
|
|
||||||
write(writer, "prop", result);
|
|
||||||
write(writer, "prop_0", result0);
|
|
||||||
write(writer, "prop_Q", resultQ);
|
|
||||||
write(writer, "prop_Sun", resultSun);
|
|
||||||
write(writer, "prop_Tad", resultTad);
|
|
||||||
}
|
}
|
||||||
|
saveResult(par().output, "prop", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int> mask(env().getNd(),1);
|
std::vector<int> mask(env().getNd(),1);
|
||||||
@ -222,9 +212,8 @@ void TChargedProp::makeCaches(void)
|
|||||||
}
|
}
|
||||||
if (!GFSrcDone_)
|
if (!GFSrcDone_)
|
||||||
{
|
{
|
||||||
FFT fft(env().getGrid());
|
|
||||||
auto &source = envGet(ScalarField, par().source);
|
auto &source = envGet(ScalarField, par().source);
|
||||||
|
|
||||||
LOG(Message) << "Caching G*F*src..." << std::endl;
|
LOG(Message) << "Caching G*F*src..." << std::endl;
|
||||||
fft.FFT_all_dim(GFSrc, source, FFT::forward);
|
fft.FFT_all_dim(GFSrc, source, FFT::forward);
|
||||||
GFSrc = freeMomProp*GFSrc;
|
GFSrc = freeMomProp*GFSrc;
|
||||||
|
@ -57,6 +57,26 @@ public:
|
|||||||
SCALAR_TYPE_ALIASES(SIMPL,);
|
SCALAR_TYPE_ALIASES(SIMPL,);
|
||||||
typedef PhotonR::GaugeField EmField;
|
typedef PhotonR::GaugeField EmField;
|
||||||
typedef PhotonR::GaugeLinkField EmComp;
|
typedef PhotonR::GaugeLinkField EmComp;
|
||||||
|
class Projection: Serializable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GRID_SERIALIZABLE_CLASS_MEMBERS(Projection,
|
||||||
|
std::vector<int>, momentum,
|
||||||
|
std::vector<Complex>, corr,
|
||||||
|
std::vector<Complex>, corr_0,
|
||||||
|
std::vector<Complex>, corr_Q,
|
||||||
|
std::vector<Complex>, corr_Sun,
|
||||||
|
std::vector<Complex>, corr_Tad);
|
||||||
|
};
|
||||||
|
class Result: Serializable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||||
|
std::vector<int>, lattice_size,
|
||||||
|
double, mass,
|
||||||
|
double, charge,
|
||||||
|
std::vector<Projection>, projection);
|
||||||
|
};
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
TChargedProp(const std::string name);
|
TChargedProp(const std::string name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user