mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-26 05:35:55 +01:00
Added the momentum filter to resources
This commit is contained in:
parent
84fe791519
commit
0bade717bf
@ -72,6 +72,8 @@ class HMCResourceManager {
|
|||||||
typedef HMCModuleBase< BaseHmcCheckpointer<ImplementationPolicy> > CheckpointerBaseModule;
|
typedef HMCModuleBase< BaseHmcCheckpointer<ImplementationPolicy> > CheckpointerBaseModule;
|
||||||
typedef HMCModuleBase< HmcObservable<typename ImplementationPolicy::Field> > ObservableBaseModule;
|
typedef HMCModuleBase< HmcObservable<typename ImplementationPolicy::Field> > ObservableBaseModule;
|
||||||
typedef ActionModuleBase< Action<typename ImplementationPolicy::Field>, GridModule > ActionBaseModule;
|
typedef ActionModuleBase< Action<typename ImplementationPolicy::Field>, GridModule > ActionBaseModule;
|
||||||
|
typedef typename ImplementationPolicy::Field MomentaField;
|
||||||
|
typedef typename ImplementationPolicy::Field Field;
|
||||||
|
|
||||||
// Named storage for grid pairs (std + red-black)
|
// Named storage for grid pairs (std + red-black)
|
||||||
std::unordered_map<std::string, GridModule> Grids;
|
std::unordered_map<std::string, GridModule> Grids;
|
||||||
@ -80,6 +82,9 @@ class HMCResourceManager {
|
|||||||
// SmearingModule<ImplementationPolicy> Smearing;
|
// SmearingModule<ImplementationPolicy> Smearing;
|
||||||
std::unique_ptr<CheckpointerBaseModule> CP;
|
std::unique_ptr<CheckpointerBaseModule> CP;
|
||||||
|
|
||||||
|
// Momentum filter
|
||||||
|
std::unique_ptr<MomentumFilterBase<typename ImplementationPolicy::Field> > Filter;
|
||||||
|
|
||||||
// A vector of HmcObservable modules
|
// A vector of HmcObservable modules
|
||||||
std::vector<std::unique_ptr<ObservableBaseModule> > ObservablesList;
|
std::vector<std::unique_ptr<ObservableBaseModule> > ObservablesList;
|
||||||
|
|
||||||
@ -90,6 +95,7 @@ class HMCResourceManager {
|
|||||||
|
|
||||||
bool have_RNG;
|
bool have_RNG;
|
||||||
bool have_CheckPointer;
|
bool have_CheckPointer;
|
||||||
|
bool have_Filter;
|
||||||
|
|
||||||
// NOTE: operator << is not overloaded for std::vector<string>
|
// NOTE: operator << is not overloaded for std::vector<string>
|
||||||
// so this function is necessary
|
// so this function is necessary
|
||||||
@ -101,7 +107,7 @@ class HMCResourceManager {
|
|||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HMCResourceManager() : have_RNG(false), have_CheckPointer(false) {}
|
HMCResourceManager() : have_RNG(false), have_CheckPointer(false), have_Filter(false) {}
|
||||||
|
|
||||||
template <class ReaderClass, class vector_type = vComplex >
|
template <class ReaderClass, class vector_type = vComplex >
|
||||||
void initialize(ReaderClass &Read){
|
void initialize(ReaderClass &Read){
|
||||||
@ -129,6 +135,7 @@ public:
|
|||||||
RNGModuleParameters RNGpar(Read);
|
RNGModuleParameters RNGpar(Read);
|
||||||
SetRNGSeeds(RNGpar);
|
SetRNGSeeds(RNGpar);
|
||||||
|
|
||||||
|
|
||||||
// Observables
|
// Observables
|
||||||
auto &ObsFactory = HMC_ObservablesModuleFactory<observable_string, typename ImplementationPolicy::Field, ReaderClass>::getInstance();
|
auto &ObsFactory = HMC_ObservablesModuleFactory<observable_string, typename ImplementationPolicy::Field, ReaderClass>::getInstance();
|
||||||
Read.push(observable_string);// here must check if existing...
|
Read.push(observable_string);// here must check if existing...
|
||||||
@ -208,6 +215,16 @@ public:
|
|||||||
AddGrid(s, Mod);
|
AddGrid(s, Mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetMomentumFilter( MomentumFilterBase<typename ImplementationPolicy::Field> * MomFilter) {
|
||||||
|
assert(have_Filter==false);
|
||||||
|
Filter = std::unique_ptr<MomentumFilterBase<typename ImplementationPolicy::Field> >(MomFilter);
|
||||||
|
have_Filter = true;
|
||||||
|
}
|
||||||
|
MomentumFilterBase<typename ImplementationPolicy::Field> *GetMomentumFilter(void) {
|
||||||
|
if ( !have_Filter)
|
||||||
|
SetMomentumFilter(new MomentumFilterNone<typename ImplementationPolicy::Field>());
|
||||||
|
return Filter.get();
|
||||||
|
}
|
||||||
|
|
||||||
GridCartesian* GetCartesian(std::string s = "") {
|
GridCartesian* GetCartesian(std::string s = "") {
|
||||||
if (s.empty()) s = Grids.begin()->first;
|
if (s.empty()) s = Grids.begin()->first;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user