diff --git a/lib/json/json.hpp b/lib/json/json.hpp index 97214f0b..bfb38c3e 100644 --- a/lib/json/json.hpp +++ b/lib/json/json.hpp @@ -64,7 +64,7 @@ SOFTWARE. #endif #elif defined(__GNUC__) #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) - #if GCC_VERSION < 40900 + #if GCC_VERSION < 40800 #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" #endif #endif diff --git a/lib/qcd/hmc/HMCResourceManager.h b/lib/qcd/hmc/HMCResourceManager.h index b98e083a..9f4c99a9 100644 --- a/lib/qcd/hmc/HMCResourceManager.h +++ b/lib/qcd/hmc/HMCResourceManager.h @@ -68,6 +68,7 @@ class HMCResourceManager { // A vector of HmcObservable modules std::vector > ObservablesList; + // A vector of HmcObservable modules std::multimap > ActionsList; std::vector multipliers; @@ -249,9 +250,9 @@ class HMCResourceManager { // Observables //////////////////////////////////////////////////////// - void AddObservable(ObservableBaseModule *O){ - // acquire resource - ObservablesList.push_back(std::unique_ptr(std::move(O))); + template + void AddObservable(Types&&... Args){ + ObservablesList.push_back(std::unique_ptr(new T(std::forward(Args)...))); } std::vector* > GetObservables(){ diff --git a/lib/qcd/modules/ObservableModules.h b/lib/qcd/modules/ObservableModules.h index 9d11c7a0..27efecc7 100644 --- a/lib/qcd/modules/ObservableModules.h +++ b/lib/qcd/modules/ObservableModules.h @@ -41,13 +41,14 @@ class ObservableModule public: typedef HMCModuleBase< QCD::HmcObservable< typename ObservableType::Field> > Base; typedef typename Base::Product Product; + typedef OPar Parameters; std::unique_ptr ObservablePtr; ObservableModule(OPar Par) : Parametrized(Par) {} virtual void print_parameters(){ - std::cout << this->Par_ << std::endl; + Parametrized::print_parameters(); } template @@ -79,14 +80,18 @@ class PlaquetteObsParameters : Serializable { }; template < class Impl > -class PlaquetteMod: public ObservableModule, PlaquetteObsParameters>{ - typedef ObservableModule, PlaquetteObsParameters> ObsBase; +class PlaquetteMod: public ObservableModule, NoParameters>{ + typedef ObservableModule, NoParameters> ObsBase; using ObsBase::ObsBase; // for constructors + + // acquire resource virtual void initialize(){ - this->ObservablePtr.reset(new PlaquetteLogger(this->Par_.output_prefix)); + this->ObservablePtr.reset(new PlaquetteLogger()); } + public: + PlaquetteMod(): ObsBase(NoParameters()){} }; diff --git a/lib/qcd/observables/plaquette.h b/lib/qcd/observables/plaquette.h index 657e9555..84e7be04 100644 --- a/lib/qcd/observables/plaquette.h +++ b/lib/qcd/observables/plaquette.h @@ -2,7 +2,7 @@ Grid physics library, www.github.com/paboyle/Grid -Source file: ./lib/qcd/modules/Registration.h +Source file: ./lib/qcd/modules/plaquette.h Copyright (C) 2017 @@ -43,41 +43,25 @@ class PlaquetteLogger : public HmcObservable { // here forces the Impl to be of gauge fields // if not the compiler will complain INHERIT_GIMPL_TYPES(Impl); - typedef typename Impl::Field Field; // necessary for HmcObservable compatibility - explicit PlaquetteLogger(std::string cf) { Stem = cf; } + + // necessary for HmcObservable compatibility + typedef typename Impl::Field Field; void TrajectoryComplete(int traj, Field &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG) { - std::string file; - { - std::ostringstream os; - os << Stem << "." << traj; - file = os.str(); - } - std::ofstream of(file); - RealD peri_plaq = WilsonLoops::avgPlaquette(U); - RealD peri_rect = WilsonLoops::avgRectangle(U); + RealD plaq = WilsonLoops::avgPlaquette(U); - RealD impl_plaq = WilsonLoops::avgPlaquette(U); - RealD impl_rect = WilsonLoops::avgRectangle(U); + int def_prec = std::cout.precision(); + + std::cout << GridLogMessage + << std::setprecision(std::numeric_limits::digits10 + 1) + << "Plaquette: [ " << traj << " ] "<< plaq << std::endl; + + std::cout.precision(def_prec); - // Fixme reorganise this output - of << traj << " " << impl_plaq << " " << impl_rect << " " << peri_plaq - << " " << peri_rect << std::endl; - std::cout << GridLogMessage << "traj" - << " " - << "plaq " - << " " - << " rect " - << " " - << "peri_plaq" - << " " - << "peri_rect" << std::endl; - std::cout << GridLogMessage << traj << " " << impl_plaq << " " << impl_rect - << " " << peri_plaq << " " << peri_rect << std::endl; } }; diff --git a/lib/qcd/observables/topological_charge.h b/lib/qcd/observables/topological_charge.h new file mode 100644 index 00000000..aa76be1b --- /dev/null +++ b/lib/qcd/observables/topological_charge.h @@ -0,0 +1,49 @@ +/************************************************************************************* + +Grid physics library, www.github.com/paboyle/Grid + +Source file: ./lib/qcd/modules/topological_charge.h + +Copyright (C) 2017 + +Author: Guido Cossu + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +See the full license in the file "LICENSE" in the top level distribution +directory +*************************************************************************************/ +/* END LEGAL */ + +#ifndef HMC_TOP_CHARGE_H +#define HMC_TOP_CHARGE_H + +namespace Grid { +namespace QCD ( + +// this is only defined for a gauge theory +template +class TopologicalCharge : public HmcObservable { + private: + std::string Stem; + + public: + +}; + +) +} + +#endif // HMC_TOP_CHARGE_H diff --git a/tests/hmc/Test_hmc_EODWFRatio.cc b/tests/hmc/Test_hmc_EODWFRatio.cc index 34affbd9..6e3976e9 100644 --- a/tests/hmc/Test_hmc_EODWFRatio.cc +++ b/tests/hmc/Test_hmc_EODWFRatio.cc @@ -72,10 +72,8 @@ int main(int argc, char **argv) { // Construct observables // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc b/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc index c70fca4e..842e1bc7 100644 --- a/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc +++ b/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc @@ -74,10 +74,8 @@ int main(int argc, char **argv) { // Construct observables // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc b/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc index 5fab523f..89a4b655 100644 --- a/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc +++ b/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc @@ -71,10 +71,8 @@ int main(int argc, char **argv) { // Construct observables // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_EOWilsonFermionGauge.cc b/tests/hmc/Test_hmc_EOWilsonFermionGauge.cc index 44b2ea77..84d17b74 100644 --- a/tests/hmc/Test_hmc_EOWilsonFermionGauge.cc +++ b/tests/hmc/Test_hmc_EOWilsonFermionGauge.cc @@ -69,10 +69,8 @@ int main(int argc, char **argv) { // Construct observables // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_EOWilsonRatio.cc b/tests/hmc/Test_hmc_EOWilsonRatio.cc index e4075e30..fc105f52 100644 --- a/tests/hmc/Test_hmc_EOWilsonRatio.cc +++ b/tests/hmc/Test_hmc_EOWilsonRatio.cc @@ -1,4 +1,4 @@ - /************************************************************************************* +/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid @@ -6,8 +6,8 @@ Copyright (C) 2015 -Author: Peter Boyle -Author: paboyle + Author: Peter Boyle + Author: paboyle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,8 +24,8 @@ Author: paboyle 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory - *************************************************************************************/ - /* END LEGAL */ +*************************************************************************************/ +/* END LEGAL */ #include @@ -70,11 +70,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_GparityIwasakiGauge.cc b/tests/hmc/Test_hmc_GparityIwasakiGauge.cc index f028c83f..ee768881 100644 --- a/tests/hmc/Test_hmc_GparityIwasakiGauge.cc +++ b/tests/hmc/Test_hmc_GparityIwasakiGauge.cc @@ -69,11 +69,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_GparityWilsonGauge.cc b/tests/hmc/Test_hmc_GparityWilsonGauge.cc index ac0fd753..bd824775 100644 --- a/tests/hmc/Test_hmc_GparityWilsonGauge.cc +++ b/tests/hmc/Test_hmc_GparityWilsonGauge.cc @@ -70,11 +70,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_IwasakiGauge.cc b/tests/hmc/Test_hmc_IwasakiGauge.cc index 7aa226d9..88d232df 100644 --- a/tests/hmc/Test_hmc_IwasakiGauge.cc +++ b/tests/hmc/Test_hmc_IwasakiGauge.cc @@ -62,11 +62,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_RectGauge.cc b/tests/hmc/Test_hmc_RectGauge.cc index 6f6aa8f6..ae294e70 100644 --- a/tests/hmc/Test_hmc_RectGauge.cc +++ b/tests/hmc/Test_hmc_RectGauge.cc @@ -63,11 +63,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_WilsonAdjointFermionGauge.cc b/tests/hmc/Test_hmc_WilsonAdjointFermionGauge.cc index a6dda59d..d6a9b19f 100644 --- a/tests/hmc/Test_hmc_WilsonAdjointFermionGauge.cc +++ b/tests/hmc/Test_hmc_WilsonAdjointFermionGauge.cc @@ -73,11 +73,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_WilsonFermionGauge.cc b/tests/hmc/Test_hmc_WilsonFermionGauge.cc index da6481bb..86091556 100644 --- a/tests/hmc/Test_hmc_WilsonFermionGauge.cc +++ b/tests/hmc/Test_hmc_WilsonFermionGauge.cc @@ -70,11 +70,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_WilsonGauge.cc b/tests/hmc/Test_hmc_WilsonGauge.cc index 84240ff1..337bbcaf 100644 --- a/tests/hmc/Test_hmc_WilsonGauge.cc +++ b/tests/hmc/Test_hmc_WilsonGauge.cc @@ -65,10 +65,8 @@ int main(int argc, char **argv) { // Construct observables // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_WilsonGauge_Implicit.cc b/tests/hmc/Test_hmc_WilsonGauge_Implicit.cc deleted file mode 100644 index 05bc207f..00000000 --- a/tests/hmc/Test_hmc_WilsonGauge_Implicit.cc +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************************* - -Grid physics library, www.github.com/paboyle/Grid - -Source file: ./tests/Test_hmc_WilsonFermionGauge.cc - -Copyright (C) 2015 - -Author: Peter Boyle -Author: neo -Author: Guido Cossu - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -See the full license in the file "LICENSE" in the top level distribution -directory -*************************************************************************************/ -/* END LEGAL */ -#include - -int main(int argc, char **argv) { - using namespace Grid; - using namespace Grid::QCD; - - Grid_init(&argc, &argv); - int threads = GridThread::GetThreads(); - // here make a routine to print all the relevant information on the run - std::cout << GridLogMessage << "Grid is setup to use " << threads << " threads" << std::endl; - - // Typedefs to simplify notation - typedef GenericHMCRunner HMCWrapper; // Uses the default minimum norm - HMCWrapper TheHMC; - - // Grid from the command line - TheHMC.Resources.AddFourDimGrid("gauge"); - // Possibile to create the module by hand - // hardcoding parameters or using a Reader - - - // Checkpointer definition - CheckpointerParameters CPparams; - CPparams.config_prefix = "ckpoint_lat"; - CPparams.rng_prefix = "ckpoint_rng"; - CPparams.saveInterval = 10; - CPparams.format = "IEEE64BIG"; - - TheHMC.Resources.LoadBinaryCheckpointer(CPparams); - - RNGModuleParameters RNGpar; - RNGpar.serial_seeds = "1 2 3 4 5"; - RNGpar.parallel_seeds = "6 7 8 9 10"; - TheHMC.Resources.SetRNGSeeds(RNGpar); - - // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); - ////////////////////////////////////////////// - - ///////////////////////////////////////////////////////////// - // Collect actions, here use more encapsulation - // need wrappers of the fermionic classes - // that have a complex construction - // standard - RealD beta = 5.6; - WilsonGaugeActionR Waction(beta); - - ActionLevel Level1(1); - Level1.push_back(&Waction); - //Level1.push_back(WGMod.getPtr()); - TheHMC.TheAction.push_back(Level1); - ///////////////////////////////////////////////////////////// - - // HMC parameters are serialisable - TheHMC.Parameters.MD.MDsteps = 40; - TheHMC.Parameters.MD.trajL = 1.0; - - TheHMC.ReadCommandLine(argc, argv); // these can be parameters from file - TheHMC.Run(); // no smearing - - Grid_finalize(); - -} // main diff --git a/tests/hmc/Test_hmc_WilsonMixedRepresentationsFermionGauge.cc b/tests/hmc/Test_hmc_WilsonMixedRepresentationsFermionGauge.cc index ebe4fc28..8c509b65 100644 --- a/tests/hmc/Test_hmc_WilsonMixedRepresentationsFermionGauge.cc +++ b/tests/hmc/Test_hmc_WilsonMixedRepresentationsFermionGauge.cc @@ -82,11 +82,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_WilsonRatio.cc b/tests/hmc/Test_hmc_WilsonRatio.cc index 0917c7c6..6fd2ad51 100644 --- a/tests/hmc/Test_hmc_WilsonRatio.cc +++ b/tests/hmc/Test_hmc_WilsonRatio.cc @@ -69,11 +69,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_hmc_WilsonTMFermionGauge.cc b/tests/hmc/Test_hmc_WilsonTMFermionGauge.cc index a0e0d5d9..573e5e0f 100644 --- a/tests/hmc/Test_hmc_WilsonTMFermionGauge.cc +++ b/tests/hmc/Test_hmc_WilsonTMFermionGauge.cc @@ -70,11 +70,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// @@ -100,7 +97,7 @@ int main(int argc, char **argv) { ConjugateGradient CG(1.0e-8, 2000); - TwoFlavourPseudoFermionAction Nf2(FermOp, CG, CG); + TwoFlavourEvenOddPseudoFermionAction Nf2(FermOp, CG, CG); // With modules /* diff --git a/tests/hmc/Test_hmc_WilsonTwoIndexSymmetricFermionGauge.cc b/tests/hmc/Test_hmc_WilsonTwoIndexSymmetricFermionGauge.cc index afc97ab3..43ec343b 100644 --- a/tests/hmc/Test_hmc_WilsonTwoIndexSymmetricFermionGauge.cc +++ b/tests/hmc/Test_hmc_WilsonTwoIndexSymmetricFermionGauge.cc @@ -72,11 +72,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_rhmc_EOWilson1p1.cc b/tests/hmc/Test_rhmc_EOWilson1p1.cc index 992d41a5..0094c934 100644 --- a/tests/hmc/Test_rhmc_EOWilson1p1.cc +++ b/tests/hmc/Test_rhmc_EOWilson1p1.cc @@ -69,11 +69,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_rhmc_EOWilsonRatio.cc b/tests/hmc/Test_rhmc_EOWilsonRatio.cc index 4c002d40..9b1b53c0 100644 --- a/tests/hmc/Test_rhmc_EOWilsonRatio.cc +++ b/tests/hmc/Test_rhmc_EOWilsonRatio.cc @@ -70,11 +70,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_rhmc_Wilson1p1.cc b/tests/hmc/Test_rhmc_Wilson1p1.cc index e62cf442..9aa2f2e3 100644 --- a/tests/hmc/Test_rhmc_Wilson1p1.cc +++ b/tests/hmc/Test_rhmc_Wilson1p1.cc @@ -70,11 +70,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/tests/hmc/Test_rhmc_WilsonRatio.cc b/tests/hmc/Test_rhmc_WilsonRatio.cc index aa65d5d8..87557212 100644 --- a/tests/hmc/Test_rhmc_WilsonRatio.cc +++ b/tests/hmc/Test_rhmc_WilsonRatio.cc @@ -69,11 +69,8 @@ int main(int argc, char **argv) { TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables - // here there is too much indirection - PlaquetteObsParameters PlPar; - PlPar.output_prefix = "Plaquette"; - PlaquetteMod PlaqModule(PlPar); - TheHMC.Resources.AddObservable(&PlaqModule); + typedef PlaquetteMod PlaqObs; + TheHMC.Resources.AddObservable(); ////////////////////////////////////////////// /////////////////////////////////////////////////////////////