From 78774fbdc08c93ceec42aebcc1beb3e3ba1ef222 Mon Sep 17 00:00:00 2001 From: Lanny91 Date: Tue, 17 Jan 2017 15:29:45 +0000 Subject: [PATCH] Construct loop propagator --- extras/Hadrons/Modules.hpp | 1 + extras/Hadrons/Modules/MLoop/NoiseLoop.hpp | 91 ++++++++++++++++++++++ extras/Hadrons/modules.inc | 1 + 3 files changed, 93 insertions(+) create mode 100644 extras/Hadrons/Modules/MLoop/NoiseLoop.hpp diff --git a/extras/Hadrons/Modules.hpp b/extras/Hadrons/Modules.hpp index c017766e..bb5fba39 100644 --- a/extras/Hadrons/Modules.hpp +++ b/extras/Hadrons/Modules.hpp @@ -33,6 +33,7 @@ See the full license in the file "LICENSE" in the top level distribution directo #include #include #include +#include #include #include #include diff --git a/extras/Hadrons/Modules/MLoop/NoiseLoop.hpp b/extras/Hadrons/Modules/MLoop/NoiseLoop.hpp new file mode 100644 index 00000000..2354ff1d --- /dev/null +++ b/extras/Hadrons/Modules/MLoop/NoiseLoop.hpp @@ -0,0 +1,91 @@ +#ifndef Hadrons_NoiseLoop_hpp_ +#define Hadrons_NoiseLoop_hpp_ + +#include +#include +#include + +BEGIN_HADRONS_NAMESPACE + +/****************************************************************************** + * NoiseLoop * + ******************************************************************************/ +BEGIN_MODULE_NAMESPACE(MLoop) + +class NoiseLoopPar: Serializable +{ +public: + GRID_SERIALIZABLE_CLASS_MEMBERS(NoiseLoopPar, + std::string, q, + std::string, eta); +}; + +template +class TNoiseLoop: public Module +{ +public: + TYPE_ALIASES(FImpl,); +public: + // constructor + TNoiseLoop(const std::string name); + // destructor + virtual ~TNoiseLoop(void) = default; + // dependency relation + virtual std::vector getInput(void); + virtual std::vector getOutput(void); + // setup + virtual void setup(void); + // execution + virtual void execute(void); +}; + +MODULE_REGISTER_NS(NoiseLoop, TNoiseLoop, MLoop); + +/****************************************************************************** + * TNoiseLoop implementation * + ******************************************************************************/ +// constructor ///////////////////////////////////////////////////////////////// +template +TNoiseLoop::TNoiseLoop(const std::string name) +: Module(name) +{} + +// dependencies/products /////////////////////////////////////////////////////// +template +std::vector TNoiseLoop::getInput(void) +{ + std::vector in; + + return in; +} + +template +std::vector TNoiseLoop::getOutput(void) +{ + std::vector out = {getName()}; + + return out; +} + +// setup /////////////////////////////////////////////////////////////////////// +template +void TNoiseLoop::setup(void) +{ + env().template registerLattice(getName()); +} + +// execution /////////////////////////////////////////////////////////////////// +template +void TNoiseLoop::execute(void) +{ + PropagatorField &loop = *env().template createLattice(getName()); + PropagatorField &q = *env().template getObject(par().q); + PropagatorField &eta = *env().template getObject(par().eta); + loop = q*adj(eta); +} + +END_MODULE_NAMESPACE + +END_HADRONS_NAMESPACE + +#endif // Hadrons_NoiseLoop_hpp_ diff --git a/extras/Hadrons/modules.inc b/extras/Hadrons/modules.inc index 6270a88e..ab46cbef 100644 --- a/extras/Hadrons/modules.inc +++ b/extras/Hadrons/modules.inc @@ -11,6 +11,7 @@ modules_hpp =\ Modules/MGauge/Load.hpp \ Modules/MGauge/Random.hpp \ Modules/MGauge/Unit.hpp \ + Modules/MLoop/NoiseLoop.hpp \ Modules/MSolver/RBPrecCG.hpp \ Modules/MSource/Point.hpp \ Modules/MSource/SeqGamma.hpp \