1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Hadrons: Fixed test to use new implementation of meson module.

This commit is contained in:
Lanny91 2017-06-22 16:03:59 +02:00
parent 863bb2ad10
commit 18211eb5b1
2 changed files with 30 additions and 37 deletions

View File

@ -71,6 +71,9 @@ using namespace Hadrons;
#define NAME_WALL_SOURCE(t) NAME_3MOM_WALL_SOURCE(t, ZERO_MOM)
#define NAME_POINT_SOURCE(pos) ("point_" + pos)
// Meson module "gammas" special values
#define ALL_GAMMAS "all"
#define MAKE_3MOM_WALL_PROP(tW, mom, propName, solver)\
{\
std::string srcName = NAME_3MOM_WALL_SOURCE(tW, mom);\
@ -364,28 +367,27 @@ inline void makeLoop(Application &application, std::string &propName,
* Name: mesonContraction
* Purpose: Create meson contraction module and add to application module.
* Parameters: application - main application that stores modules.
* npt - specify n-point correlator (for labelling).
* modName - unique module name.
* output - name of output files.
* q1 - quark propagator 1.
* q2 - quark propagator 2.
* label - unique label to construct module name.
* mom - momentum to project (default is zero)
* sink - sink smearing module.
* gammas - gamma insertions at source and sink.
* Returns: None.
******************************************************************************/
inline void mesonContraction(Application &application, unsigned int npt,
inline void mesonContraction(Application &application,
std::string &modName, std::string &output,
std::string &q1, std::string &q2,
std::string &label,
std::string mom = ZERO_MOM,
std::string &sink,
std::string gammas = "<Gamma5 Gamma5>")
{
std::string modName = std::to_string(npt) + "pt_" + label;
if (!(Environment::getInstance().hasModule(modName)))
{
MContraction::Meson::Par mesPar;
mesPar.output = std::to_string(npt) + "pt/" + label;
mesPar.output = output;
mesPar.q1 = q1;
mesPar.q2 = q2;
mesPar.mom = mom;
mesPar.sink = sink;
mesPar.gammas = gammas;
application.createModule<MContraction::Meson>(modName, mesPar);
}

View File

@ -25,7 +25,7 @@
directory.
*******************************************************************************/
#include <Grid/Hadrons/Application.hpp>
#include "Test_hadrons.hpp"
using namespace Grid;
using namespace Hadrons;
@ -127,43 +127,34 @@ int main(int argc, char *argv[])
}
}
// Point sink.
std::string sink = "sink";
MSink::Point::Par sinkPar;
sinkPar.mom = ZERO_MOM;
application.createModule<MSink::ScalarPoint>(sink, sinkPar);
// contractions
MContraction::Meson::Par mesPar;
for (unsigned int i = 0; i < flavour.size(); ++i)
for (unsigned int j = i; j < flavour.size(); ++j)
{
mesPar.output = "mesons/Z2_" + flavour[i] + flavour[j];
mesPar.q1 = qName[i];
mesPar.q2 = qName[j];
mesPar.gammas = "all";
mesPar.mom = "0. 0. 0. 0.";
application.createModule<MContraction::Meson>("meson_Z2_"
+ std::to_string(t)
+ "_"
+ flavour[i]
+ flavour[j],
mesPar);
std::string modName = "meson_Z2_" + std::to_string(t) + "_" + \
flavour[i] + flavour[j];
std::string output = "mesons/Z2_" + flavour[i] + flavour[j];
mesonContraction(application, modName, output, qName[i], qName[j],
sink, ALL_GAMMAS);
}
for (unsigned int i = 0; i < flavour.size(); ++i)
for (unsigned int j = 0; j < flavour.size(); ++j)
for (unsigned int mu = 0; mu < Nd; ++mu)
{
MContraction::Meson::Par mesPar;
mesPar.output = "3pt/Z2_" + flavour[i] + flavour[j] + "_"
+ std::to_string(mu);
mesPar.q1 = qName[i];
mesPar.q2 = seqName[j][mu];
mesPar.gammas = "all";
mesPar.mom = "0. 0. 0. 0.";
application.createModule<MContraction::Meson>("3pt_Z2_"
+ std::to_string(t)
+ "_"
+ flavour[i]
+ flavour[j]
+ "_"
+ std::to_string(mu),
mesPar);
std::string modName = "3pt_Z2_" + std::to_string(t) + "_" + \
flavour[i] + flavour[j] + "_" + \
std::to_string(mu);
std::string output = "3pt/Z2_" + flavour[i] + \
flavour[j] + "_" + std::to_string(mu);
mesonContraction(application, modName, output,
qName[i], seqName[j][mu], sink, ALL_GAMMAS);
}
}