mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Hadrons: NPR and gauge fixing linking fix
This commit is contained in:
parent
24c07694bc
commit
9592115341
@ -33,61 +33,4 @@ using namespace Grid;
|
|||||||
using namespace Hadrons;
|
using namespace Hadrons;
|
||||||
using namespace MGauge;
|
using namespace MGauge;
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* TGaugeFix implementation *
|
|
||||||
******************************************************************************/
|
|
||||||
// constructor /////////////////////////////////////////////////////////////////
|
|
||||||
template <typename GImpl>
|
|
||||||
TGaugeFix<GImpl>::TGaugeFix(const std::string name)
|
|
||||||
: Module<GaugeFixPar>(name)
|
|
||||||
{}
|
|
||||||
|
|
||||||
// dependencies/products ///////////////////////////////////////////////////////
|
|
||||||
template <typename GImpl>
|
|
||||||
std::vector<std::string> TGaugeFix<GImpl>::getInput(void)
|
|
||||||
{
|
|
||||||
std::vector<std::string> in = {par().gauge};
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename GImpl>
|
|
||||||
std::vector<std::string> TGaugeFix<GImpl>::getOutput(void)
|
|
||||||
{
|
|
||||||
std::vector<std::string> out = {getName()};
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// setup ///////////////////////////////////////////////////////////////////////
|
|
||||||
template <typename GImpl>
|
|
||||||
void TGaugeFix<GImpl>::setup(void)
|
|
||||||
{
|
|
||||||
envCreateLat(GaugeField, getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// execution ///////////////////////////////////////////////////////////////////
|
|
||||||
template <typename GImpl>
|
|
||||||
void TGaugeFix<GImpl>::execute(void)
|
|
||||||
//Loads the gauge and fixes it
|
|
||||||
{
|
|
||||||
|
|
||||||
std::cout << "executing" << std::endl;
|
|
||||||
LOG(Message) << "Fixing the Gauge" << std::endl;
|
|
||||||
LOG(Message) << par().gauge << std::endl;
|
|
||||||
auto &U = envGet(GaugeField, par().gauge);
|
|
||||||
auto &Umu = envGet(GaugeField, getName());
|
|
||||||
LOG(Message) << "Gauge Field fetched" << std::endl;
|
|
||||||
//do we allow maxiter etc to be user set?
|
|
||||||
Real alpha = par().alpha;
|
|
||||||
int maxiter = par().maxiter;
|
|
||||||
Real Omega_tol = par().Omega_tol;
|
|
||||||
Real Phi_tol = par().Phi_tol;
|
|
||||||
bool Fourier = par().Fourier;
|
|
||||||
FourierAcceleratedGaugeFixer<PeriodicGimplR>::SteepestDescentGaugeFix(U,alpha,maxiter,Omega_tol,Phi_tol,Fourier);
|
|
||||||
Umu = U;
|
|
||||||
LOG(Message) << "Gauge Fixed" << std::endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template class Grid::Hadrons::MGauge::TGaugeFix<GIMPL>;
|
template class Grid::Hadrons::MGauge::TGaugeFix<GIMPL>;
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
// constructor
|
// constructor
|
||||||
TGaugeFix(const std::string name);
|
TGaugeFix(const std::string name);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~TGaugeFix(void) = default;
|
virtual ~TGaugeFix(void) {};
|
||||||
// dependencies/products
|
// dependencies/products
|
||||||
virtual std::vector<std::string> getInput(void);
|
virtual std::vector<std::string> getInput(void);
|
||||||
virtual std::vector<std::string> getOutput(void);
|
virtual std::vector<std::string> getOutput(void);
|
||||||
@ -74,6 +74,60 @@ public:
|
|||||||
|
|
||||||
MODULE_REGISTER_TMP(GaugeFix, TGaugeFix<GIMPL>, MGauge);
|
MODULE_REGISTER_TMP(GaugeFix, TGaugeFix<GIMPL>, MGauge);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* TGaugeFix implementation *
|
||||||
|
******************************************************************************/
|
||||||
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
|
template <typename GImpl>
|
||||||
|
TGaugeFix<GImpl>::TGaugeFix(const std::string name)
|
||||||
|
: Module<GaugeFixPar>(name)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
|
template <typename GImpl>
|
||||||
|
std::vector<std::string> TGaugeFix<GImpl>::getInput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> in = {par().gauge};
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename GImpl>
|
||||||
|
std::vector<std::string> TGaugeFix<GImpl>::getOutput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> out = {getName()};
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup ///////////////////////////////////////////////////////////////////////
|
||||||
|
template <typename GImpl>
|
||||||
|
void TGaugeFix<GImpl>::setup(void)
|
||||||
|
{
|
||||||
|
envCreateLat(GaugeField, getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
|
template <typename GImpl>
|
||||||
|
void TGaugeFix<GImpl>::execute(void)
|
||||||
|
//Loads the gauge and fixes it
|
||||||
|
{
|
||||||
|
std::cout << "executing" << std::endl;
|
||||||
|
LOG(Message) << "Fixing the Gauge" << std::endl;
|
||||||
|
LOG(Message) << par().gauge << std::endl;
|
||||||
|
auto &U = envGet(GaugeField, par().gauge);
|
||||||
|
auto &Umu = envGet(GaugeField, getName());
|
||||||
|
LOG(Message) << "Gauge Field fetched" << std::endl;
|
||||||
|
//do we allow maxiter etc to be user set?
|
||||||
|
Real alpha = par().alpha;
|
||||||
|
int maxiter = par().maxiter;
|
||||||
|
Real Omega_tol = par().Omega_tol;
|
||||||
|
Real Phi_tol = par().Phi_tol;
|
||||||
|
bool Fourier = par().Fourier;
|
||||||
|
FourierAcceleratedGaugeFixer<PeriodicGimplR>::SteepestDescentGaugeFix(U,alpha,maxiter,Omega_tol,Phi_tol,Fourier);
|
||||||
|
Umu = U;
|
||||||
|
LOG(Message) << "Gauge Fixed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
END_HADRONS_NAMESPACE
|
END_HADRONS_NAMESPACE
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
// constructor
|
// constructor
|
||||||
TAmputate(const std::string name);
|
TAmputate(const std::string name);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~TAmputate(void) = default;
|
virtual ~TAmputate(void) {};
|
||||||
// dependencies/products
|
// dependencies/products
|
||||||
virtual std::vector<std::string> getInput(void);
|
virtual std::vector<std::string> getInput(void);
|
||||||
virtual std::vector<std::string> getOutput(void);
|
virtual std::vector<std::string> getOutput(void);
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
// constructor
|
// constructor
|
||||||
TBilinear(const std::string name);
|
TBilinear(const std::string name);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~TBilinear(void) = default;
|
virtual ~TBilinear(void) {};
|
||||||
// dependencies/products
|
// dependencies/products
|
||||||
virtual std::vector<std::string> getInput(void);
|
virtual std::vector<std::string> getInput(void);
|
||||||
virtual std::vector<std::string> getOutput(void);
|
virtual std::vector<std::string> getOutput(void);
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
// constructor
|
// constructor
|
||||||
TFourQuark(const std::string name);
|
TFourQuark(const std::string name);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~TFourQuark(void) = default;
|
virtual ~TFourQuark(void) {};
|
||||||
// dependencies/products
|
// dependencies/products
|
||||||
virtual std::vector<std::string> getInput(void);
|
virtual std::vector<std::string> getInput(void);
|
||||||
virtual std::vector<std::string> getOutput(void);
|
virtual std::vector<std::string> getOutput(void);
|
||||||
|
@ -4,5 +4,5 @@ using namespace Grid;
|
|||||||
using namespace Hadrons;
|
using namespace Hadrons;
|
||||||
using namespace MSource;
|
using namespace MSource;
|
||||||
|
|
||||||
template class Grid::Hadrons::MSource::TMomSource<FIMPL>;
|
template class Grid::Hadrons::MSource::TMomentum<FIMPL>;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef Hadrons_MomSource_hpp_
|
#ifndef Hadrons_Momentum_hpp_
|
||||||
#define Hadrons_MomSource_hpp_
|
#define Hadrons_Momentum_hpp_
|
||||||
|
|
||||||
#include <Hadrons/Global.hpp>
|
#include <Hadrons/Global.hpp>
|
||||||
#include <Hadrons/Module.hpp>
|
#include <Hadrons/Module.hpp>
|
||||||
@ -14,29 +14,29 @@ src_x = e^i2pi/L * p *position
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* TPlane *
|
* Plane Wave source *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
BEGIN_MODULE_NAMESPACE(MSource)
|
BEGIN_MODULE_NAMESPACE(MSource)
|
||||||
|
|
||||||
class MomSourcePar: Serializable
|
class MomentumPar: Serializable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//What is meant by serializable in this context
|
//What is meant by serializable in this context
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(MomSourcePar,
|
GRID_SERIALIZABLE_CLASS_MEMBERS(MomentumPar,
|
||||||
std::string, mom);
|
std::string, mom);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
class TMomSource: public Module<MomSourcePar>
|
class TMomentum: public Module<MomentumPar>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FERM_TYPE_ALIASES(FImpl,);
|
FERM_TYPE_ALIASES(FImpl,);
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
TMomSource(const std::string name);
|
TMomentum(const std::string name);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~TMomSource(void) = default;
|
virtual ~TMomentum(void) {};
|
||||||
// dependency relation
|
// dependency relation
|
||||||
virtual std::vector<std::string> getInput(void);
|
virtual std::vector<std::string> getInput(void);
|
||||||
virtual std::vector<std::string> getOutput(void);
|
virtual std::vector<std::string> getOutput(void);
|
||||||
@ -46,28 +46,28 @@ virtual void setup(void);
|
|||||||
virtual void execute(void);
|
virtual void execute(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_REGISTER_TMP(MomSource, TMomSource<FIMPL>, MSource);
|
MODULE_REGISTER_TMP(Momentum, TMomentum<FIMPL>, MSource);
|
||||||
//MODULE_REGISTER_NS(MomSource, TMomSource, MSource);
|
//MODULE_REGISTER_NS(Momentum, TMomentum, MSource);
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* TMomSource template implementation *
|
* TMomentum template implementation *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
// constructor /////////////////////////////////////////////////////////////////
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
TMomSource<FImpl>::TMomSource(const std::string name)
|
TMomentum<FImpl>::TMomentum(const std::string name)
|
||||||
: Module<MomSourcePar>(name)
|
: Module<MomentumPar>(name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// dependencies/products ///////////////////////////////////////////////////////
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
std::vector<std::string> TMomSource<FImpl>::getInput(void)
|
std::vector<std::string> TMomentum<FImpl>::getInput(void)
|
||||||
{
|
{
|
||||||
std::vector<std::string> in;
|
std::vector<std::string> in;
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
std::vector<std::string> TMomSource<FImpl>::getOutput(void)
|
std::vector<std::string> TMomentum<FImpl>::getOutput(void)
|
||||||
{
|
{
|
||||||
std::vector<std::string> out = {getName()};
|
std::vector<std::string> out = {getName()};
|
||||||
return out;
|
return out;
|
||||||
@ -76,7 +76,7 @@ std::vector<std::string> TMomSource<FImpl>::getOutput(void)
|
|||||||
|
|
||||||
// setup ///////////////////////////////////////////////////////////////////////
|
// setup ///////////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void TMomSource<FImpl>::setup(void)
|
void TMomentum<FImpl>::setup(void)
|
||||||
{
|
{
|
||||||
envCreateLat(PropagatorField, getName());
|
envCreateLat(PropagatorField, getName());
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ void TMomSource<FImpl>::setup(void)
|
|||||||
|
|
||||||
//execution//////////////////////////////////////////////////////////////////
|
//execution//////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void TMomSource<FImpl>::execute(void)
|
void TMomentum<FImpl>::execute(void)
|
||||||
{
|
{
|
||||||
LOG(Message) << "Generating planewave momentum source with momentum " << par().mom << std::endl;
|
LOG(Message) << "Generating planewave momentum source with momentum " << par().mom << std::endl;
|
||||||
//what does this env do?
|
//what does this env do?
|
||||||
@ -118,4 +118,4 @@ END_MODULE_NAMESPACE
|
|||||||
|
|
||||||
END_HADRONS_NAMESPACE
|
END_HADRONS_NAMESPACE
|
||||||
|
|
||||||
#endif // Hadrons_MomSource_hpp_
|
#endif // Hadrons_Momentum_hpp_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user