mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-11 11:56:56 +01:00
GLobal edit for QCD namespace removal & NAMESPACE macros
This commit is contained in:
@ -168,6 +168,6 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
NAMESPACE_END(Grid):
|
||||
NAMESPACE_END(Grid);
|
||||
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@ directory
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
||||
template <class Impl>
|
||||
class ScalarAction : public QCD::Action<typename Impl::Field> {
|
||||
class ScalarAction : public Action<typename Impl::Field> {
|
||||
public:
|
||||
INHERIT_FIELD_TYPES(Impl);
|
||||
|
||||
@ -58,7 +58,7 @@ public:
|
||||
virtual void refresh(const Field &U, GridParallelRNG &pRNG) {} // noop as no pseudoferms
|
||||
|
||||
virtual RealD S(const Field &p) {
|
||||
return (mass_square * 0.5 + QCD::Nd) * ScalarObs<Impl>::sumphisquared(p) +
|
||||
return (mass_square * 0.5 + Nd) * ScalarObs<Impl>::sumphisquared(p) +
|
||||
(lambda / 24.) * ScalarObs<Impl>::sumphifourth(p) +
|
||||
ScalarObs<Impl>::sumphider(p);
|
||||
};
|
||||
@ -69,9 +69,9 @@ public:
|
||||
Field p2(p._grid);
|
||||
ScalarObs<Impl>::phisquared(p2, p);
|
||||
tmp = -(Cshift(p, 0, -1) + Cshift(p, 0, 1));
|
||||
for (int mu = 1; mu < QCD::Nd; mu++) tmp -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
for (int mu = 1; mu < Nd; mu++) tmp -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
|
||||
force =+(mass_square + 2. * QCD::Nd) * p + (lambda / 6.) * p2 * p + tmp;
|
||||
force =+(mass_square + 2. * Nd) * p + (lambda / 6.) * p2 * p + tmp;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -91,7 +91,7 @@ template <class S, unsigned int N>
|
||||
class ScalarAdjMatrixImplTypes {
|
||||
public:
|
||||
typedef S Simd;
|
||||
typedef QCD::SU<N> Group;
|
||||
typedef SU<N> Group;
|
||||
|
||||
template <typename vtype>
|
||||
using iImplField = iScalar<iScalar<iMatrix<vtype, N>>>;
|
||||
@ -146,9 +146,9 @@ typedef ScalarImplTypes<vComplexF> ScalarImplCF;
|
||||
typedef ScalarImplTypes<vComplexD> ScalarImplCD;
|
||||
|
||||
// Hardcoding here the size of the matrices
|
||||
typedef ScalarAdjMatrixImplTypes<vComplex, QCD::Nc> ScalarAdjImplR;
|
||||
typedef ScalarAdjMatrixImplTypes<vComplexF, QCD::Nc> ScalarAdjImplF;
|
||||
typedef ScalarAdjMatrixImplTypes<vComplexD, QCD::Nc> ScalarAdjImplD;
|
||||
typedef ScalarAdjMatrixImplTypes<vComplex, Nc> ScalarAdjImplR;
|
||||
typedef ScalarAdjMatrixImplTypes<vComplexF, Nc> ScalarAdjImplF;
|
||||
typedef ScalarAdjMatrixImplTypes<vComplexD, Nc> ScalarAdjImplD;
|
||||
|
||||
template <int Colours > using ScalarNxNAdjImplR = ScalarAdjMatrixImplTypes<vComplex, Colours >;
|
||||
template <int Colours > using ScalarNxNAdjImplF = ScalarAdjMatrixImplTypes<vComplexF, Colours >;
|
||||
|
@ -36,7 +36,7 @@ directory
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
||||
template <class Impl, int Ndim >
|
||||
class ScalarInteractionAction : public QCD::Action<typename Impl::Field> {
|
||||
class ScalarInteractionAction : public Action<typename Impl::Field> {
|
||||
public:
|
||||
INHERIT_FIELD_TYPES(Impl);
|
||||
private:
|
||||
@ -116,7 +116,7 @@ public:
|
||||
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
||||
phiStencil.HaloExchange(p, compressor);
|
||||
|
||||
//for (int mu = 0; mu < QCD::Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
//for (int mu = 0; mu < Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
for (int point = 0; point < npoint; point++) {
|
||||
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
||||
const vobj *temp;
|
||||
|
@ -53,9 +53,9 @@ NAMESPACE_BEGIN(Grid);
|
||||
// HMC Resource manager
|
||||
template <class ImplementationPolicy>
|
||||
class HMCResourceManager {
|
||||
typedef HMCModuleBase< QCD::BaseHmcCheckpointer<ImplementationPolicy> > CheckpointerBaseModule;
|
||||
typedef HMCModuleBase< QCD::HmcObservable<typename ImplementationPolicy::Field> > ObservableBaseModule;
|
||||
typedef ActionModuleBase< QCD::Action<typename ImplementationPolicy::Field>, GridModule > ActionBaseModule;
|
||||
typedef HMCModuleBase< BaseHmcCheckpointer<ImplementationPolicy> > CheckpointerBaseModule;
|
||||
typedef HMCModuleBase< HmcObservable<typename ImplementationPolicy::Field> > ObservableBaseModule;
|
||||
typedef ActionModuleBase< Action<typename ImplementationPolicy::Field>, GridModule > ActionBaseModule;
|
||||
|
||||
// Named storage for grid pairs (std + red-black)
|
||||
std::unordered_map<std::string, GridModule> Grids;
|
||||
|
@ -36,18 +36,18 @@ NAMESPACE_BEGIN(Grid);
|
||||
// if we had a virtual reader would have been unecessary
|
||||
template <class HMCType, class ReaderClass >
|
||||
class HMCModule
|
||||
: public Parametrized< QCD::HMCparameters >,
|
||||
public HMCModuleBase< QCD::HMCRunnerBase<ReaderClass> > {
|
||||
: public Parametrized< HMCparameters >,
|
||||
public HMCModuleBase< HMCRunnerBase<ReaderClass> > {
|
||||
public:
|
||||
typedef HMCModuleBase< QCD::HMCRunnerBase<ReaderClass> > Base;
|
||||
typedef HMCModuleBase< HMCRunnerBase<ReaderClass> > Base;
|
||||
typedef typename Base::Product Product;
|
||||
|
||||
std::unique_ptr<HMCType> HMCPtr;
|
||||
|
||||
HMCModule(QCD::HMCparameters Par) : Parametrized<QCD::HMCparameters>(Par) {}
|
||||
HMCModule(HMCparameters Par) : Parametrized<HMCparameters>(Par) {}
|
||||
|
||||
template <class ReaderCl>
|
||||
HMCModule(Reader<ReaderCl>& R) : Parametrized<QCD::HMCparameters>(R, "HMC"){};
|
||||
HMCModule(Reader<ReaderCl>& R) : Parametrized<HMCparameters>(R, "HMC"){};
|
||||
|
||||
Product* getPtr() {
|
||||
if (!HMCPtr) initialize();
|
||||
@ -62,7 +62,7 @@ private:
|
||||
// Factory
|
||||
template <char const *str, class ReaderClass >
|
||||
class HMCRunnerModuleFactory
|
||||
: public Factory < HMCModuleBase< QCD::HMCRunnerBase<ReaderClass> > , Reader<ReaderClass> > {
|
||||
: public Factory < HMCModuleBase< HMCRunnerBase<ReaderClass> > , Reader<ReaderClass> > {
|
||||
public:
|
||||
typedef Reader<ReaderClass> TheReader;
|
||||
// use SINGLETON FUNCTOR MACRO HERE
|
||||
@ -88,36 +88,36 @@ private:
|
||||
// macro for these
|
||||
|
||||
template < class ImplementationPolicy, class RepresentationPolicy, class ReaderClass >
|
||||
class HMCLeapFrog: public HMCModule< QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::LeapFrog>, ReaderClass >{
|
||||
typedef HMCModule< QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::LeapFrog>, ReaderClass > HMCBaseMod;
|
||||
class HMCLeapFrog: public HMCModule< GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, LeapFrog>, ReaderClass >{
|
||||
typedef HMCModule< GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, LeapFrog>, ReaderClass > HMCBaseMod;
|
||||
using HMCBaseMod::HMCBaseMod;
|
||||
|
||||
// aquire resource
|
||||
virtual void initialize(){
|
||||
this->HMCPtr.reset(new QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::LeapFrog>(this->Par_) );
|
||||
this->HMCPtr.reset(new GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, LeapFrog>(this->Par_) );
|
||||
}
|
||||
};
|
||||
|
||||
template < class ImplementationPolicy, class RepresentationPolicy, class ReaderClass >
|
||||
class HMCMinimumNorm2: public HMCModule< QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::MinimumNorm2>, ReaderClass >{
|
||||
typedef HMCModule< QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::MinimumNorm2>, ReaderClass > HMCBaseMod;
|
||||
class HMCMinimumNorm2: public HMCModule< GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, MinimumNorm2>, ReaderClass >{
|
||||
typedef HMCModule< GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, MinimumNorm2>, ReaderClass > HMCBaseMod;
|
||||
using HMCBaseMod::HMCBaseMod;
|
||||
|
||||
// aquire resource
|
||||
virtual void initialize(){
|
||||
this->HMCPtr.reset(new QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::MinimumNorm2>(this->Par_));
|
||||
this->HMCPtr.reset(new GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, MinimumNorm2>(this->Par_));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template < class ImplementationPolicy, class RepresentationPolicy, class ReaderClass >
|
||||
class HMCForceGradient: public HMCModule< QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::ForceGradient>, ReaderClass >{
|
||||
typedef HMCModule< QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::ForceGradient>, ReaderClass > HMCBaseMod;
|
||||
class HMCForceGradient: public HMCModule< GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, ForceGradient>, ReaderClass >{
|
||||
typedef HMCModule< GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, ForceGradient>, ReaderClass > HMCBaseMod;
|
||||
using HMCBaseMod::HMCBaseMod;
|
||||
|
||||
// aquire resource
|
||||
virtual void initialize(){
|
||||
this->HMCPtr.reset(new QCD::GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, QCD::ForceGradient>(this->Par_) );
|
||||
this->HMCPtr.reset(new GenericHMCRunnerTemplate<ImplementationPolicy, RepresentationPolicy, ForceGradient>(this->Par_) );
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -104,7 +104,6 @@ class GridFourDimModule : public GridModule
|
||||
public:
|
||||
GridFourDimModule()
|
||||
{
|
||||
using namespace QCD;
|
||||
set_full(SpaceTimeGrid::makeFourDimGrid(
|
||||
GridDefaultLatt(),
|
||||
GridDefaultSimd(4, vector_type::Nsimd()),
|
||||
@ -114,7 +113,6 @@ public:
|
||||
|
||||
GridFourDimModule(const std::vector<int> tweak_simd)
|
||||
{
|
||||
using namespace QCD;
|
||||
if (tweak_simd.size() != 4)
|
||||
{
|
||||
std::cout << GridLogError
|
||||
@ -148,7 +146,6 @@ public:
|
||||
|
||||
GridFourDimModule(const GridModuleParameters Params)
|
||||
{
|
||||
using namespace QCD;
|
||||
std::vector<int> lattice_v = Params.getLattice();
|
||||
std::vector<int> mpi_v = Params.getMpi();
|
||||
if (lattice_v.size() == 4)
|
||||
|
@ -52,9 +52,9 @@ public:
|
||||
template <class ActionType, class APar>
|
||||
class ActionModule
|
||||
: public Parametrized<APar>,
|
||||
public ActionModuleBase< QCD::Action<typename ActionType::GaugeField> , QCD::GridModule > {
|
||||
public ActionModuleBase< Action<typename ActionType::GaugeField> , GridModule > {
|
||||
public:
|
||||
typedef ActionModuleBase< QCD::Action<typename ActionType::GaugeField>, QCD::GridModule > Base;
|
||||
typedef ActionModuleBase< Action<typename ActionType::GaugeField>, GridModule > Base;
|
||||
typedef typename Base::Product Product;
|
||||
typedef APar Parameters;
|
||||
|
||||
@ -467,31 +467,19 @@ public:
|
||||
|
||||
};
|
||||
|
||||
}// QCD temporarily here
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
// Factories specialisations
|
||||
////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
// use the same classed defined by Antonin, does not make sense to rewrite
|
||||
// Factory is perfectly fine
|
||||
// Registar must be changed because I do not want to use the ModuleFactory
|
||||
|
||||
// explicit ref to LatticeGaugeField must be changed or put in the factory
|
||||
//typedef ActionModuleBase< QCD::Action< QCD::LatticeGaugeField >, QCD::GridModule > HMC_LGTActionModBase;
|
||||
//typedef ActionModuleBase< QCD::Action< QCD::LatticeReal >, QCD::GridModule > HMC_ScalarActionModBase;
|
||||
//typedef ActionModuleBase< Action< LatticeGaugeField >, GridModule > HMC_LGTActionModBase;
|
||||
//typedef ActionModuleBase< Action< LatticeReal >, GridModule > HMC_ScalarActionModBase;
|
||||
|
||||
template <char const *str, class Field, class ReaderClass >
|
||||
class HMC_ActionModuleFactory
|
||||
: public Factory < ActionModuleBase< QCD::Action< Field >, QCD::GridModule > , Reader<ReaderClass> > {
|
||||
: public Factory < ActionModuleBase< Action< Field >, GridModule > , Reader<ReaderClass> > {
|
||||
public:
|
||||
typedef Reader<ReaderClass> TheReader;
|
||||
// use SINGLETON FUNCTOR MACRO HERE
|
||||
|
@ -37,19 +37,19 @@ NAMESPACE_BEGIN(Grid);
|
||||
template < class Product>
|
||||
class FermionOperatorModuleBase : public HMCModuleBase<Product>{
|
||||
public:
|
||||
virtual void AddGridPair(QCD::GridModule&) = 0;
|
||||
virtual void AddGridPair(GridModule&) = 0;
|
||||
};
|
||||
|
||||
template <template <typename> class FOType, class FermionImpl, class FOPar>
|
||||
class FermionOperatorModule
|
||||
: public Parametrized<FOPar>,
|
||||
public FermionOperatorModuleBase<QCD::FermionOperator<FermionImpl> > {
|
||||
public FermionOperatorModuleBase<FermionOperator<FermionImpl> > {
|
||||
|
||||
protected:
|
||||
std::unique_ptr< FOType<FermionImpl> > FOPtr;
|
||||
std::vector< QCD::GridModule* > GridRefs;
|
||||
std::vector< GridModule* > GridRefs;
|
||||
public:
|
||||
typedef HMCModuleBase< QCD::FermionOperator<FermionImpl> > Base;
|
||||
typedef HMCModuleBase< FermionOperator<FermionImpl> > Base;
|
||||
typedef typename Base::Product Product;
|
||||
|
||||
FermionOperatorModule(FOPar Par) : Parametrized<FOPar>(Par) {}
|
||||
@ -57,7 +57,7 @@ public:
|
||||
template <class ReaderClass>
|
||||
FermionOperatorModule(Reader<ReaderClass>& Reader) : Parametrized<FOPar>(Reader){};
|
||||
|
||||
void AddGridPair(QCD::GridModule &Mod){
|
||||
void AddGridPair(GridModule &Mod){
|
||||
if (GridRefs.size()>1){
|
||||
std::cout << GridLogError << "Adding too many Grids to the FermionOperatorModule" << std::endl;
|
||||
exit(1);
|
||||
@ -65,9 +65,9 @@ public:
|
||||
GridRefs.push_back(&Mod);
|
||||
|
||||
if (Ls()){
|
||||
GridRefs.push_back(new QCD::GridModule());
|
||||
GridRefs[1]->set_full(QCD::SpaceTimeGrid::makeFiveDimGrid(Ls(),GridRefs[0]->get_full()));
|
||||
GridRefs[1]->set_rb(QCD::SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls(),GridRefs[0]->get_full()));
|
||||
GridRefs.push_back(new GridModule());
|
||||
GridRefs[1]->set_full(SpaceTimeGrid::makeFiveDimGrid(Ls(),GridRefs[0]->get_full()));
|
||||
GridRefs[1]->set_rb(SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls(),GridRefs[0]->get_full()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ private:
|
||||
// Factory
|
||||
template <char const *str, class FermionImpl, class ReaderClass >
|
||||
class HMC_FermionOperatorModuleFactory
|
||||
: public Factory < FermionOperatorModuleBase<QCD::FermionOperator<FermionImpl> > , Reader<ReaderClass> > {
|
||||
: public Factory < FermionOperatorModuleBase<FermionOperator<FermionImpl> > , Reader<ReaderClass> > {
|
||||
public:
|
||||
// use SINGLETON FUNCTOR MACRO HERE
|
||||
typedef Reader<ReaderClass> TheReader;
|
||||
|
@ -37,9 +37,9 @@ NAMESPACE_BEGIN(Grid);
|
||||
template <class ObservableType, class OPar>
|
||||
class ObservableModule
|
||||
: public Parametrized<OPar>,
|
||||
public HMCModuleBase< QCD::HmcObservable<typename ObservableType::Field> > {
|
||||
public HMCModuleBase< HmcObservable<typename ObservableType::Field> > {
|
||||
public:
|
||||
typedef HMCModuleBase< QCD::HmcObservable< typename ObservableType::Field> > Base;
|
||||
typedef HMCModuleBase< HmcObservable< typename ObservableType::Field> > Base;
|
||||
typedef typename Base::Product Product;
|
||||
typedef OPar Parameters;
|
||||
|
||||
@ -105,19 +105,15 @@ public:
|
||||
TopologicalChargeMod(): ObsBase(){}
|
||||
};
|
||||
|
||||
|
||||
}// QCD temporarily here
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
// Factories specialisations
|
||||
////////////////////////////////////////
|
||||
// explicit ref to LatticeGaugeField must be changed or put in the factory
|
||||
//typedef HMCModuleBase< QCD::HmcObservable<QCD::LatticeGaugeField> > HMC_ObsModBase;
|
||||
//typedef HMCModuleBase< HmcObservable<LatticeGaugeField> > HMC_ObsModBase;
|
||||
|
||||
template <char const *str, class Field, class ReaderClass >
|
||||
class HMC_ObservablesModuleFactory
|
||||
: public Factory < HMCModuleBase< QCD::HmcObservable<Field> >, Reader<ReaderClass> > {
|
||||
: public Factory < HMCModuleBase< HmcObservable<Field> >, Reader<ReaderClass> > {
|
||||
public:
|
||||
typedef Reader<ReaderClass> TheReader;
|
||||
// use SINGLETON FUNCTOR MACRO HERE
|
||||
|
@ -39,10 +39,10 @@ See the full license in the file "LICENSE" in the top level distribution directo
|
||||
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
||||
// Dirac algebra adjoint operator (not in QCD:: to overload other adj)
|
||||
inline QCD::Gamma adj(const QCD::Gamma &g)
|
||||
// Dirac algebra adjoint operator (not in to overload other adj)
|
||||
inline Gamma adj(const Gamma &g)
|
||||
{
|
||||
return QCD::Gamma (QCD::Gamma::adj[g.g]);
|
||||
return Gamma (Gamma::adj[g.g]);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user