diff --git a/extras/Hadrons/Modules.hpp b/extras/Hadrons/Modules.hpp index 502c14af..af4592ea 100644 --- a/extras/Hadrons/Modules.hpp +++ b/extras/Hadrons/Modules.hpp @@ -18,20 +18,21 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include #include -#include -#include -#include #include +#include +#include +#include #include +#include #include #include #include diff --git a/extras/Hadrons/Modules/MAction/MobiusDWF.cc b/extras/Hadrons/Modules/MAction/MobiusDWF.cc new file mode 100644 index 00000000..8c138bca --- /dev/null +++ b/extras/Hadrons/Modules/MAction/MobiusDWF.cc @@ -0,0 +1,7 @@ +#include + +using namespace Grid; +using namespace Hadrons; +using namespace MAction; + +template class Grid::Hadrons::MAction::TMobiusDWF; diff --git a/extras/Hadrons/Modules/MAction/MobiusDWF.hpp b/extras/Hadrons/Modules/MAction/MobiusDWF.hpp new file mode 100644 index 00000000..a026a864 --- /dev/null +++ b/extras/Hadrons/Modules/MAction/MobiusDWF.hpp @@ -0,0 +1,109 @@ +#ifndef Hadrons_MAction_MobiusDWF_hpp_ +#define Hadrons_MAction_MobiusDWF_hpp_ + +#include +#include +#include + +BEGIN_HADRONS_NAMESPACE + +/****************************************************************************** + * Mobius domain-wall fermion action * + ******************************************************************************/ +BEGIN_MODULE_NAMESPACE(MAction) + +class MobiusDWFPar: Serializable +{ +public: + GRID_SERIALIZABLE_CLASS_MEMBERS(MobiusDWFPar, + std::string , gauge, + unsigned int, Ls, + double , mass, + double , M5, + double , b, + double , c, + std::string , boundary); +}; + +template +class TMobiusDWF: public Module +{ +public: + FG_TYPE_ALIASES(FImpl,); +public: + // constructor + TMobiusDWF(const std::string name); + // destructor + virtual ~TMobiusDWF(void) {}; + // dependency relation + virtual std::vector getInput(void); + virtual std::vector getOutput(void); + // setup + virtual void setup(void); + // execution + virtual void execute(void); +}; + +MODULE_REGISTER_TMP(MobiusDWF, TMobiusDWF, MAction); + +/****************************************************************************** + * TMobiusDWF implementation * + ******************************************************************************/ +// constructor ///////////////////////////////////////////////////////////////// +template +TMobiusDWF::TMobiusDWF(const std::string name) +: Module(name) +{} + +// dependencies/products /////////////////////////////////////////////////////// +template +std::vector TMobiusDWF::getInput(void) +{ + std::vector in = {par().gauge}; + + return in; +} + +template +std::vector TMobiusDWF::getOutput(void) +{ + std::vector out = {getName()}; + + return out; +} + +// setup /////////////////////////////////////////////////////////////////////// +template +void TMobiusDWF::setup(void) +{ + LOG(Message) << "Setting up Mobius domain wall fermion matrix with m= " + << par().mass << ", M5= " << par().M5 << ", Ls= " << par().Ls + << ", b= " << par().b << ", c= " << par().c + << " using gauge field '" << par().gauge << "'" + << std::endl; + LOG(Message) << "Fermion boundary conditions: " << par().boundary + << std::endl; + + env().createGrid(par().Ls); + auto &U = envGet(LatticeGaugeField, par().gauge); + auto &g4 = *env().getGrid(); + auto &grb4 = *env().getRbGrid(); + auto &g5 = *env().getGrid(par().Ls); + auto &grb5 = *env().getRbGrid(par().Ls); + std::vector boundary = strToVec(par().boundary); + typename MobiusFermion::ImplParams implParams(boundary); + envCreateDerived(FMat, MobiusFermion, getName(), par().Ls, U, g5, + grb5, g4, grb4, par().mass, par().M5, par().b, par().c, + implParams); +} + +// execution /////////////////////////////////////////////////////////////////// +template +void TMobiusDWF::execute(void) +{} + +END_MODULE_NAMESPACE + +END_HADRONS_NAMESPACE + +#endif // Hadrons_MAction_MobiusDWF_hpp_ diff --git a/extras/Hadrons/Modules/MAction/ZMobiusDWF.hpp b/extras/Hadrons/Modules/MAction/ZMobiusDWF.hpp index 88e4e85c..4a275dd0 100644 --- a/extras/Hadrons/Modules/MAction/ZMobiusDWF.hpp +++ b/extras/Hadrons/Modules/MAction/ZMobiusDWF.hpp @@ -35,7 +35,7 @@ See the full license in the file "LICENSE" in the top level distribution directo BEGIN_HADRONS_NAMESPACE /****************************************************************************** - * ZMobiusDWF * + * z-Mobius domain-wall fermion action * ******************************************************************************/ BEGIN_MODULE_NAMESPACE(MAction) @@ -75,7 +75,7 @@ public: MODULE_REGISTER_TMP(ZMobiusDWF, TZMobiusDWF, MAction); /****************************************************************************** - * TZMobiusDWF implementation * + * TZMobiusDWF implementation * ******************************************************************************/ // constructor ///////////////////////////////////////////////////////////////// template diff --git a/extras/Hadrons/modules.inc b/extras/Hadrons/modules.inc index 0e44176b..ebf5c9cb 100644 --- a/extras/Hadrons/modules.inc +++ b/extras/Hadrons/modules.inc @@ -27,10 +27,11 @@ modules_cc =\ Modules/MUtilities/TestSeqConserved.cc \ Modules/MLoop/NoiseLoop.cc \ Modules/MScalar/FreeProp.cc \ + Modules/MScalar/VPCounterTerms.cc \ Modules/MScalar/ChargedProp.cc \ Modules/MScalar/ScalarVP.cc \ - Modules/MScalar/VPCounterTerms.cc \ Modules/MAction/Wilson.cc \ + Modules/MAction/MobiusDWF.cc \ Modules/MAction/ZMobiusDWF.cc \ Modules/MAction/WilsonClover.cc \ Modules/MAction/DWF.cc \ @@ -72,20 +73,21 @@ modules_hpp =\ Modules/MSink/Point.hpp \ Modules/MSolver/LocalCoherenceLanczos.hpp \ Modules/MSolver/RBPrecCG.hpp \ + Modules/MGauge/UnitEm.hpp \ + Modules/MGauge/Unit.hpp \ Modules/MGauge/Random.hpp \ Modules/MGauge/FundtoHirep.hpp \ Modules/MGauge/StochEm.hpp \ - Modules/MGauge/Unit.hpp \ - Modules/MGauge/UnitEm.hpp \ Modules/MUtilities/TestSeqGamma.hpp \ Modules/MUtilities/TestSeqConserved.hpp \ Modules/MLoop/NoiseLoop.hpp \ - Modules/MScalar/ChargedProp.hpp \ Modules/MScalar/FreeProp.hpp \ - Modules/MScalar/Scalar.hpp \ - Modules/MScalar/ScalarVP.hpp \ Modules/MScalar/VPCounterTerms.hpp \ + Modules/MScalar/ScalarVP.hpp \ + Modules/MScalar/Scalar.hpp \ + Modules/MScalar/ChargedProp.hpp \ Modules/MAction/DWF.hpp \ + Modules/MAction/MobiusDWF.hpp \ Modules/MAction/Wilson.hpp \ Modules/MAction/WilsonClover.hpp \ Modules/MAction/ZMobiusDWF.hpp \