Skip to content

Commit

Permalink
Add semi-analytic solver to available BVP solvers
Browse files Browse the repository at this point in the history
and update the documentation for the spectrum generator
settings.
  • Loading branch information
Dylan Harries committed Dec 13, 2016
1 parent 8dc8564 commit ccee980
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 77 deletions.
96 changes: 45 additions & 51 deletions meta/FlexibleSUSY.m
Expand Up @@ -185,8 +185,9 @@ FlexibleSUSY model file (FlexibleSUSY.m).
FSEWSBSolvers = { FPIRelative, GSLHybridS, GSLBroyden };

(* BVP solvers *)
TwoScaleSolver; (* two-scale algorithm *)
LatticeSolver; (* lattice algorithm *)
TwoScaleSolver; (* two-scale algorithm *)
LatticeSolver; (* lattice algorithm *)
SemiAnalyticSolver; (* semi-analytic algorithm *)
FSBVPSolvers = { TwoScaleSolver };

(* macros *)
Expand Down Expand Up @@ -257,7 +258,7 @@ FlexibleSUSY model file (FlexibleSUSY.m).
allEWSBSolvers = { GSLHybrid, GSLHybridS, GSLBroyden, GSLNewton,
FPIRelative, FPIAbsolute, FPITadpole };

allBVPSolvers = { TwoScaleSolver, LatticeSolver };
allBVPSolvers = { TwoScaleSolver, LatticeSolver, SemiAnalyticSolver };

HaveEWSBSolver[solver_] := MemberQ[FlexibleSUSY`FSEWSBSolvers, solver];

Expand Down Expand Up @@ -1385,13 +1386,42 @@ corresponding tadpole is real or imaginary (only in models with CP
} ];
];

GetBVPSolverHeaderName[solver_] :=
Switch[solver,
FlexibleSUSY`TwoScaleSolver, "two_scale",
FlexibleSUSY`LatticeSolver, "lattice",
FlexibleSUSY`SemiAnalyticSolver, "semi_analytic",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];

GetBVPSolverSLHAOptionKey[solver_] :=
Switch[solver,
FlexibleSUSY`TwoScaleSolver, "0",
FlexibleSUSY`LatticeSolver, "1",
FlexibleSUSY`SemiAnalyticSolver, "2",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];

GetBVPSolverTemplateParameter[solver_] :=
Switch[solver,
FlexibleSUSY`TwoScaleSolver, "Two_scale",
FlexibleSUSY`LatticeSolver, "Lattice",
FlexibleSUSY`SemiAnalyticSolver, "Semi_analytic",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];

EnableForBVPSolver[solver_, statements_String] :=
Module[{result = "#ifdef "},
Switch[solver,
FlexibleSUSY`TwoScaleSolver,
result = result <> "ENABLE_TWO_SCALE_SOLVER\n" <> statements,
FlexibleSUSY`LatticeSolver,
result = result <> "ENABLE_LATTICE_SOLVER\n" <> statements,
FlexibleSUSY`SemiAnalyticSolver,
result = result <> "ENABLE_SEMI_ANALYTIC_SOLVER\n" <> statements,
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
Expand All @@ -1400,24 +1430,15 @@ corresponding tadpole is real or imaginary (only in models with CP

EnableSpectrumGenerator[solver_] :=
Module[{header = "#include \"" <> FlexibleSUSY`FSModelName},
Switch[solver,
FlexibleSUSY`TwoScaleSolver, header = header <> "_two_scale",
FlexibleSUSY`LatticeSolver, header = header <> "_lattice",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
header = header <> "_" <> GetBVPSolverHeaderName[solver];
header = header <> "_spectrum_generator.hpp\"\n";
EnableForBVPSolver[solver, header] <> "\n"
];

RunEnabledSpectrumGenerator[solver_] :=
Module[{key = "", class = "", macro = "", body = "", result = ""},
Switch[solver,
FlexibleSUSY`TwoScaleSolver, key = "0"; class = "Two_scale",
FlexibleSUSY`LatticeSolver, key = "1"; class = "Lattice",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
key = GetBVPSolverSLHAOptionKey[solver];
class = GetBVPSolverTemplateParameter[solver];
body = "exit_code = run_solver<" <> class <> ">(\n"
<> IndentText["slha_io, spectrum_generator_settings, slha_output_file,\n"]
<> IndentText["database_output_file, spectrum_file, rgflow_file);\n"]
Expand All @@ -1428,25 +1449,17 @@ corresponding tadpole is real or imaginary (only in models with CP

ScanEnabledSpectrumGenerator[solver_] :=
Module[{key = "", class = "", macro = "", body = "", result = ""},
Switch[solver,
FlexibleSUSY`TwoScaleSolver, key = "0"; class = "Two_scale",
FlexibleSUSY`LatticeSolver, key = "1"; class = "Lattice",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
key = GetBVPSolverSLHAOptionKey[solver];
class = GetBVPSolverTemplateParameter[solver];
body = "run_scan<" <> class <> ">(input, range);\nbreak;\n";
result = "case " <> key <> ":\n" <> IndentText[body];
EnableForBVPSolver[solver, IndentText[result]] <> "\n"
];

RunCmdLineEnabledSpectrumGenerator[solver_] :=
Module[{key = "", class = "", macro = "", body = "", result = ""},
Switch[solver,
FlexibleSUSY`TwoScaleSolver, key = "0"; class = "Two_scale",
FlexibleSUSY`LatticeSolver, key = "1"; class = "Lattice",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
key = GetBVPSolverSLHAOptionKey[solver];
class = GetBVPSolverTemplateParameter[solver];
body = "exit_code = run_solver<" <> class <> ">(input);\nbreak;\n";
result = "case " <> key <> ":\n" <> IndentText[body];
EnableForBVPSolver[solver, IndentText[result]] <> "\n"
Expand All @@ -1465,12 +1478,7 @@ corresponding tadpole is real or imaginary (only in models with CP
(runEnabledCmdLineSolvers = runEnabledCmdLineSolvers <> RunCmdLineEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers;
If[Length[FlexibleSUSY`FSBVPSolvers] == 0,
defaultSolverType = "-1",
Which[FlexibleSUSY`FSBVPSolvers[[1]] === FlexibleSUSY`TwoScaleSolver,
defaultSolverType = "0",
FlexibleSUSY`FSBVPSolvers[[1]] === FlexibleSUSY`LatticeSolver,
defaultSolverType = "1",
True, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]
];
defaultSolverType = GetBVPSolverSLHAOptionKey[FlexibleSUSY`FSBVPSolvers[[1]]]
];
WriteOut`ReplaceInFiles[files,
{ "@parseCmdLineOptions@" -> IndentText[IndentText[parseCmdLineOptions]],
Expand All @@ -1486,25 +1494,16 @@ corresponding tadpole is real or imaginary (only in models with CP

EnableMathlinkSpectrumGenerator[solver_] :=
Module[{type, headers = ""},
Switch[solver,
FlexibleSUSY`TwoScaleSolver, type = "two_scale",
FlexibleSUSY`LatticeSolver, type = "lattice",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
type = GetBVPSolverHeaderName[solver];
headers = "#include \"" <> FlexibleSUSY`FSModelName <> "_" <> type <> "_model.hpp\"\n";
headers = headers <> "#include \"" <> FlexibleSUSY`FSModelName <> "_" <> type <> "_spectrum_generator.hpp\"\n";
EnableForBVPSolver[solver, headers] <> "\n"
];

InitialiseEnabledModelType[solver_] :=
Module[{key, class, body, result},
Switch[solver,
FlexibleSUSY`TwoScaleSolver, key = "0"; class = "Two_scale",
FlexibleSUSY`LatticeSolver, key = "1"; class = "Lattice",
_, Print["Error: invalid BVP solver requested: ", solver];
Quit[1];
];
key = GetBVPSolverSLHAOptionKey[solver];
class = GetBVPSolverTemplateParameter[solver];
body = "data.reset(new " <> FlexibleSUSY`FSModelName <> "_model_data<" <> class <> ">());\nbreak;\n";
result = "case " <> key <> ":\n" <> IndentText[body];
EnableForBVPSolver[solver, IndentText[result]] <> "\n"
Expand Down Expand Up @@ -1542,12 +1541,7 @@ corresponding tadpole is real or imaginary (only in models with CP
(initialiseDataPointer = initialiseDataPointer <> InitialiseEnabledModelType[#])& /@ FlexibleSUSY`FSBVPSolvers;
If[Length[FlexibleSUSY`FSBVPSolvers] == 0,
defaultSolverType = "-1",
Which[FlexibleSUSY`FSBVPSolvers[[1]] === FlexibleSUSY`TwoScaleSolver,
defaultSolverType = "0",
FlexibleSUSY`FSBVPSolvers[[1]] === FlexibleSUSY`LatticeSolver,
defaultSolverType = "1",
True, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]
];
defaultSolverType = GetBVPSolverSLHAOptionKey[FlexibleSUSY`FSBVPSolvers[[1]]];
];
WriteOut`ReplaceInFiles[files,
{ "@numberOfInputParameters@" -> ToString[numberOfInputParameters],
Expand Down
52 changes: 26 additions & 26 deletions src/spectrum_generator_settings.cpp
Expand Up @@ -80,32 +80,32 @@ void Spectrum_generator_settings::set(Settings o, double value)
/**
* Resets all spectrum generator settings to their defaults.
*
* | enum | possible values | default value |
* |----------------------------------|------------------------------|-----------------|
* | precision | any positive double | 1.0e-4 |
* | max_iterations | any positive double | 0 (= automatic) |
* | solver | 0 (two-scale) or 1 (lattice) | 0 (= two-scale) |
* | calculate_sm_masses | 0 (no) or 1 (yes) | 0 (= no) |
* | pole_mass_loop_order | 0, 1, 2 | 2 (= 2-loop) |
* | ewsb_loop_order | 0, 1, 2 | 2 (= 2-loop) |
* | beta_loop_order | 0, 1, 2, 3 | 2 (= 2-loop) |
* | threshold_corrections_loop_order | 0, 1, 2 | 2 (= 2-loop) |
* | higgs_2loop_correction_at_as | 0, 1 | 1 (= enabled) |
* | higgs_2loop_correction_ab_as | 0, 1 | 1 (= enabled) |
* | higgs_2loop_correction_at_at | 0, 1 | 1 (= enabled) |
* | higgs_2loop_correction_atau_atau | 0, 1 | 1 (= enabled) |
* | force_output | 0 (no) or 1 (yes) | 0 (= no) |
* | top_pole_qcd_corrections | 0 (1L), 1 (2L), 2 (3L) | 1 (= 2L QCD) |
* | beta_zero_threshold | any positive double | 1.0e-11 |
* | calculate_observables | 0 (no) or 1 (yes) | 0 (= no) |
* | force_positive_masses | 0 (no) or 1 (yes) | 0 (= no) |
* | pole_mass_scale | any positive double | 0 (= SUSY scale)|
* | eft_pole_mass_scale | any positive double | 0 (= minimum of {Mt, SUSY scale})|
* | eft_matching_scale | any positive double | 0 (= SUSY scale)|
* | eft_matching_loop_order_up | 0, 1, 2 | 2 (= 2-loop) |
* | eft_matching_loop_order_down | 0, 1 | 1 (= 1-loop) |
* | eft_higgs_index | any integer >= 0 | 0 (= lightest) |
* | calculate_bsm_masses | 0 (no) or 1 (yes) | 1 (= yes) |
* | enum | possible values | default value |
* |----------------------------------|-------------------------------------------------|-----------------|
* | precision | any positive double | 1.0e-4 |
* | max_iterations | any positive double | 0 (= automatic) |
* | solver | 0 (two-scale), 1 (lattice) or 2 (semi-analytic) | 0 (= two-scale) |
* | calculate_sm_masses | 0 (no) or 1 (yes) | 0 (= no) |
* | pole_mass_loop_order | 0, 1, 2 | 2 (= 2-loop) |
* | ewsb_loop_order | 0, 1, 2 | 2 (= 2-loop) |
* | beta_loop_order | 0, 1, 2, 3 | 2 (= 2-loop) |
* | threshold_corrections_loop_order | 0, 1, 2 | 2 (= 2-loop) |
* | higgs_2loop_correction_at_as | 0, 1 | 1 (= enabled) |
* | higgs_2loop_correction_ab_as | 0, 1 | 1 (= enabled) |
* | higgs_2loop_correction_at_at | 0, 1 | 1 (= enabled) |
* | higgs_2loop_correction_atau_atau | 0, 1 | 1 (= enabled) |
* | force_output | 0 (no) or 1 (yes) | 0 (= no) |
* | top_pole_qcd_corrections | 0 (1L), 1 (2L), 2 (3L) | 1 (= 2L QCD) |
* | beta_zero_threshold | any positive double | 1.0e-11 |
* | calculate_observables | 0 (no) or 1 (yes) | 0 (= no) |
* | force_positive_masses | 0 (no) or 1 (yes) | 0 (= no) |
* | pole_mass_scale | any positive double | 0 (= SUSY scale)|
* | eft_pole_mass_scale | any positive double | 0 (= minimum of {Mt, SUSY scale})|
* | eft_matching_scale | any positive double | 0 (= SUSY scale)|
* | eft_matching_loop_order_up | 0, 1, 2 | 2 (= 2-loop) |
* | eft_matching_loop_order_down | 0, 1 | 1 (= 1-loop) |
* | eft_higgs_index | any integer >= 0 | 0 (= lightest) |
* | calculate_bsm_masses | 0 (no) or 1 (yes) | 1 (= yes) |
*/
void Spectrum_generator_settings::reset()
{
Expand Down

0 comments on commit ccee980

Please sign in to comment.