1 #include "InputOutput/JsonInput/json.hpp" 2 #include "InputOutput/JsonInput/jsoninput.h" 3 #include "InputOutput/JsonInput/JsonAction/jsonaction.h" 11 void validateAction(){
13 if(jsonFile[
"App"][
"type"] ==
"PGFG" || jsonFile[
"App"][
"type"] ==
"FLOW"){
14 if(jsonFile.count(
"Action") == 0){
15 std::cerr <<
"LatticeQCD Error: no Action specified\n";
18 if(jsonFile.count(
"Action") != 1){
19 std::cerr <<
"LatticeQCD Error: too many Action specified\n";
24 if( jsonFile[
"Action"][
"type"].size() != 1
25 || jsonFile[
"Action"][
"params"].size() == 0){
26 std::cerr <<
"LatticeQCD Error: wrong Action specification\n" 27 "Correct format is:\n" 29 " \"type\" : actionType, \n" 31 " \"param1\" : param1, \n" 32 " \"param2\" : param2, \n" 40 if( !validateCoreActions()
43 std::cerr <<
"LatticeQCD Error: unknown Action " 44 << jsonFile[
"Action"][
"type"] <<
"\n";
51 bool validateCoreActions(){
53 if(jsonFile[
"Action"][
"type"] ==
"puregauge"){
60 void validatePureGauge(){
62 if( jsonFile[
"Action"][
"params"].size() != 1
63 || jsonFile[
"Action"][
"params"][
"beta"].size() != 1){
64 std::cerr <<
"LatticeQCD Error: wrong \"puregauge\" action specification\n" 67 " \"type\" : \"puregauge\", \n" 76 void registerAction(
class App*& app){
77 registerCoreActions(app);
81 void registerCoreActions(
class App*& app){
82 if(jsonFile[
"Action"][
"type"] ==
"puregauge")
83 registerPureGauge(app);
86 void registerPureGauge(
class App*& app){
87 double beta = jsonFile[
"Action"][
"params"][
"beta"];
Main include file for Action derived classes.
Implementation of the PureGauge derived Action class.
void setAction(Action *action)
Initializes the Action object pointer given an instance of it.
Contains the definition of the App prototype.
Prototype for the App class group.