1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-13 04:37:05 +01:00

All functionalities ready.

Todo: add all the fermion action modules
This commit is contained in:
Guido Cossu
2017-01-20 12:56:20 +00:00
parent 851f2ad8ef
commit f96fac0aee
18 changed files with 504 additions and 64 deletions

View File

@ -29,9 +29,14 @@ directory
#include <Grid/Grid.h>
namespace Grid{
// ifdefs ?? Local makefile suggestion , policy as make parameter
// Put this section in a separate header
// ifdefs ?? Local makefile suggestion , policy as make parameter
typedef QCD::PeriodicGimplR ImplementationPolicy;
typedef QCD::NoHirep RepresentationPolicy;
typedef QCD::WilsonFermionR FermionImplementation;
static Registrar< HMCLeapFrog<ImplementationPolicy, RepresentationPolicy, XmlReader> , HMCRunnerModuleFactory<hmc_string, XmlReader> > __HMCLFmodXMLInit("LeapFrog");
static Registrar< HMCMinimumNorm2<ImplementationPolicy, RepresentationPolicy, XmlReader> , HMCRunnerModuleFactory<hmc_string, XmlReader> > __HMCMN2modXMLInit("MinimumNorm2");
@ -53,6 +58,8 @@ int main(int argc, char **argv) {
// Reader, file should come from command line
InputFileReader Reader("input.wilson_gauge.params.xml");
// Test HMC factory (put in an external file)
auto &HMCfactory = HMCRunnerModuleFactory<hmc_string, InputFileReader >::getInstance();
// Simplify this step (IntergratorName field?)
@ -61,6 +68,38 @@ int main(int argc, char **argv) {
// Construct the module
auto myHMCmodule = HMCfactory.create(HMCpar.MD.name, Reader);
/*
// Test solver creation
auto &SolverFactory = HMC_SolverModuleFactory<solver_string, FermionImplementation::FermionField, XmlReader>::getInstance();
Reader.push("Solver");
std::string name;
read(Reader, "name",name);
auto SModule = SolverFactory.create(name, Reader);
std::cout << "Registered types " << std::endl;
std::cout << SolverFactory.getBuilderList() << std::endl;
SModule->print_parameters();
Reader.pop();
*/
/*
// Test fermion operator module creation
auto &FOFactory = HMC_FermionOperatorModuleFactory<fermionop_string, WilsonImplR, XmlReader>::getInstance();
Reader.push("Operator");
std::string op_name;
Reader.readDefault("name",op_name);
auto FOModule = FOFactory.create(op_name, Reader);
std::cout << "Registered types " << std::endl;
std::cout << FOFactory.getBuilderList() << std::endl;
GridFourDimModule GMod;
FOModule->AddGridPair(GMod);
FOModule->print_parameters();
Reader.pop();
*/
myHMCmodule->getPtr()->initialize(Reader);
myHMCmodule->getPtr()->Run();

View File

@ -85,7 +85,7 @@ int main(int argc, char **argv) {
RealD beta = 5.6 ;
WilsonGaugeActionR Waction(beta);
// temporarily need a gauge field
// temporarily need a gauge field
auto GridPtr = TheHMC.Resources.GetCartesian();
auto GridRBPtr = TheHMC.Resources.GetRBCartesian();