From 035a1235ff55ab417c7382e4bb2fb877a4fd4c29 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Tue, 1 Nov 2016 12:12:32 +1030 Subject: [PATCH 01/34] Check settings of BVP and EWSB solvers --- meta/FlexibleSUSY.m | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 7e1963ed6..822dfdf37 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -175,6 +175,11 @@ FlexibleSUSY model file (FlexibleSUSY.m). FPITadpole; (* Fixed point iteration, convergence crit. relative step size + tadpoles *) FSEWSBSolvers = { FPIRelative, GSLHybridS, GSLBroyden }; +(* BVP solvers *) +TwoScaleSolver; (* two-scale algorithm *) +LatticeSolver; (* lattice algorithm *) +FSBVPSolvers = { TwoScaleSolver }; + (* input value for the calculation of the weak mixing angle *) FSFermiConstant; FSMassW; @@ -236,6 +241,11 @@ FlexibleSUSY model file (FlexibleSUSY.m). numberOfModelParameters = 0; +allEWSBSolvers = { GSLHybrid, GSLHybridS, GSLBroyden, GSLNewton, + FPIRelative, FPIAbsolute, FPITadpole }; + +allBVPSolvers = { TwoScaleSolver, LatticeSolver }; + PrintHeadline[text_] := Block[{}, Print[""]; @@ -352,6 +362,24 @@ FlexibleSUSY model file (FlexibleSUSY.m). FlexibleSUSY`FSMassW ]; +CheckEWSBSolvers[solvers_List] := + Module[{invalidSolvers}, + invalidSolvers = Complement[solvers, allEWSBSolvers]; + If[invalidSolvers =!= {}, + Print["Error: invalid EWSB solvers requested: ", invalidSolvers]; + Quit[1]; + ]; + ]; + +CheckBVPSolvers[solvers_List] := + Module[{invalidSolvers}, + invalidSolvers = Complement[solvers, allBVPSolvers]; + If[invalidSolvers =!= {}, + Print["Error: invalid BVP solvers requested: ", invalidSolvers]; + Quit[1]; + ]; + ]; + CheckModelFileSettings[] := Module[{}, (* FlexibleSUSY model name *) @@ -448,6 +476,8 @@ FlexibleSUSY model file (FlexibleSUSY.m). " {{A, AInput, {3,3}}, ... }"]; ]; ]; + CheckEWSBSolvers[FlexibleSUSY`FSEWSBSolvers]; + CheckBVPSolvers[FlexibleSUSY`FSBVPSolvers]; ]; ReplaceIndicesInUserInput[rules_] := From bbe5958d5c7222eaba713b119779996754819a02 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Tue, 1 Nov 2016 12:45:50 +1030 Subject: [PATCH 02/34] Rename template Makefile module --- meta/FlexibleSUSY.m | 4 ++-- templates/{two_scale.mk.in => two_scale_betas.mk.in} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename templates/{two_scale.mk.in => two_scale_betas.mk.in} (100%) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 822dfdf37..dd81594de 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -2258,7 +2258,7 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_parameters.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_parameters.cpp"}]}}, "two_scale_susy_beta_.cpp.in", - {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale.mk.in"}], + {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], FileNameJoin[{FSOutputDir, "two_scale_susy.mk"}]}} ]; @@ -2269,7 +2269,7 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_soft_parameters.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_soft_parameters.cpp"}]}}, "two_scale_soft_beta_.cpp.in", - {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale.mk.in"}], + {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], FileNameJoin[{FSOutputDir, "two_scale_soft.mk"}]}}, If[Head[SARAH`TraceAbbr] === List, SARAH`TraceAbbr, {}], numberOfSusyParameters]; diff --git a/templates/two_scale.mk.in b/templates/two_scale_betas.mk.in similarity index 100% rename from templates/two_scale.mk.in rename to templates/two_scale_betas.mk.in From f2de08a6284bc40755d1368d6c886117f04d6f21 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Tue, 1 Nov 2016 15:16:15 +1030 Subject: [PATCH 03/34] Consist documentation style --- createmodel | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/createmodel b/createmodel index bdeba9091..a3c455c3d 100755 --- a/createmodel +++ b/createmodel @@ -315,10 +315,11 @@ EOF fi } -# searches for string of the form -# FSDefaultSARAHModel = XXX; -# and sets $2 to XXX +#_____________________________________________________________________ search_default_model() { + # searches for string of the form + # FSDefaultSARAHModel = XXX; + # and sets $2 to XXX if test $# -ne 2 ; then echo "Error: search_default_model expects 2 arguments" exit ${exit_syntax_error} From 9c1074ae8a31d87a7661e74d39e98cf206095d37 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Tue, 1 Nov 2016 17:09:47 +1030 Subject: [PATCH 04/34] Separate solver specific generated code into separate Makefiles so that code can be disabled at the model file level or in the configure script --- createmodel | 2 +- meta/FlexibleSUSY.m | 11 +- templates/lattice.mk.in | 17 +++ templates/module.mk.in | 295 +++++++++++++++++--------------------- templates/two_scale.mk.in | 62 ++++++++ 5 files changed, 219 insertions(+), 168 deletions(-) create mode 100644 templates/lattice.mk.in create mode 100644 templates/two_scale.mk.in diff --git a/createmodel b/createmodel index a3c455c3d..bf32b09fd 100755 --- a/createmodel +++ b/createmodel @@ -489,7 +489,7 @@ SLHA_input_files_in_mk=$(echo "$SLHA_input_files" | message -n " Creating Makefile module $targetdir/module.mk ... " sed -e "s|@DIR@|$targetdir|g" \ -e "s|@MODEL@|$sarah_model|g" \ - -e "s|@CLASSNAME@|$name|g" \ + -e "s|@MODELNAME@|$name|g" \ -e "s|@SLHA_INPUT@|$SLHA_input_files_in_mk|g" \ < templates/module.mk.in > $targetdir/module.mk message "done" diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index dd81594de..737809dde 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -656,7 +656,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). Sequence @@ GeneralReplacementRules[] } ]; singleBetaFunctionsDefsFiles = BetaFunction`CreateSingleBetaFunctionDefs[betaFun, templateFile, sarahTraces]; - Print["Creating makefile module for the two-scale method ..."]; + Print["Creating makefile module for the beta functions ..."]; WriteMakefileModule[singleBetaFunctionsDefsFiles, makefileModuleTemplates]; ]; @@ -1444,6 +1444,11 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; +WriteBVPSolverMakefile[files_List] := + WriteOut`ReplaceInFiles[files, + { Sequence @@ GeneralReplacementRules[] + } ]; + WriteUtilitiesClass[massMatrices_List, betaFun_List, inputParameters_List, extraSLHAOutputBlocks_List, files_List] := Module[{k, particles, susyParticles, smParticles, @@ -2607,6 +2612,10 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]} }]; + Print["Creating makefile module for two-scale method ..."]; + WriteBVPSolverMakefile[{{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale.mk.in"}], + FileNameJoin[{FSOutputDir, "two_scale.mk"}]}}]; + Print["Creating observables"]; (* @note separating this out for now for simplicity *) (* @todo maybe implement a flag (like for addons) to turn on/off? *) diff --git a/templates/lattice.mk.in b/templates/lattice.mk.in new file mode 100644 index 000000000..218e8a5cc --- /dev/null +++ b/templates/lattice.mk.in @@ -0,0 +1,17 @@ +# ==================================================================== +# This file is part of FlexibleSUSY. +# +# FlexibleSUSY 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 3 of the License, +# or (at your option) any later version. +# +# FlexibleSUSY 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 FlexibleSUSY. If not, see +# . +# ==================================================================== diff --git a/templates/module.mk.in b/templates/module.mk.in index c5b1092e8..33d2c58e3 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -1,121 +1,86 @@ DIR := @DIR@ -MODNAME := @CLASSNAME@ +MODNAME := @MODELNAME@ SARAH_MODEL := @MODEL@ WITH_$(MODNAME) := yes -@CLASSNAME@_INSTALL_DIR := $(INSTALL_DIR)/$(DIR) +@MODELNAME@_INSTALL_DIR := $(INSTALL_DIR)/$(DIR) -@CLASSNAME@_MK := \ +@MODELNAME@_MK := \ $(DIR)/module.mk -@CLASSNAME@_TWO_SCALE_SUSY_MK := \ +@MODELNAME@_TWO_SCALE_SUSY_MK := \ $(DIR)/two_scale_susy.mk -@CLASSNAME@_TWO_SCALE_SOFT_MK := \ +@MODELNAME@_TWO_SCALE_SOFT_MK := \ $(DIR)/two_scale_soft.mk -@CLASSNAME@_TWO_SCALE_MK := \ - $(@CLASSNAME@_TWO_SCALE_SUSY_MK) \ - $(@CLASSNAME@_TWO_SCALE_SOFT_MK) +@MODELNAME@_INCLUDE_MK := \ + $(@MODELNAME@_TWO_SCALE_SUSY_MK) \ + $(@MODELNAME@_TWO_SCALE_SOFT_MK) -@CLASSNAME@_SLHA_INPUT := \ - $(DIR)/LesHouches.in.@CLASSNAME@_generated \ +@MODELNAME@_SLHA_INPUT := \ + $(DIR)/LesHouches.in.@MODELNAME@_generated \ @SLHA_INPUT@ -@CLASSNAME@_GNUPLOT := \ - $(DIR)/@CLASSNAME@_plot_rgflow.gnuplot \ - $(DIR)/@CLASSNAME@_plot_spectrum.gnuplot +@MODELNAME@_GNUPLOT := \ + $(DIR)/@MODELNAME@_plot_rgflow.gnuplot \ + $(DIR)/@MODELNAME@_plot_spectrum.gnuplot -@CLASSNAME@_TARBALL := \ +@MODELNAME@_TARBALL := \ $(MODNAME).tar.gz -LIB@CLASSNAME@_SRC := -EXE@CLASSNAME@_SRC := -LL@CLASSNAME@_LIB := -LL@CLASSNAME@_OBJ := -LL@CLASSNAME@_SRC := -LL@CLASSNAME@_MMA := - -LIB@CLASSNAME@_HDR := +LIB@MODELNAME@_SRC := \ + $(DIR)/@MODELNAME@_a_muon.cpp \ + $(DIR)/@MODELNAME@_effective_couplings.cpp \ + $(DIR)/@MODELNAME@_info.cpp \ + $(DIR)/@MODELNAME@_input_parameters.cpp \ + $(DIR)/@MODELNAME@_mass_eigenstates.cpp \ + $(DIR)/@MODELNAME@_observables.cpp \ + $(DIR)/@MODELNAME@_physical.cpp \ + $(DIR)/@MODELNAME@_utilities.cpp \ + $(DIR)/@MODELNAME@_two_scale_susy_parameters.cpp \ + $(DIR)/@MODELNAME@_two_scale_soft_parameters.cpp \ + +EXE@MODELNAME@_SRC := +LL@MODELNAME@_LIB := +LL@MODELNAME@_OBJ := +LL@MODELNAME@_SRC := +LL@MODELNAME@_MMA := + +LIB@MODELNAME@_HDR := \ + $(DIR)/@MODELNAME@_a_muon.hpp \ + $(DIR)/@MODELNAME@_effective_couplings.hpp \ + $(DIR)/@MODELNAME@_info.hpp \ + $(DIR)/@MODELNAME@_input_parameters.hpp \ + $(DIR)/@MODELNAME@_mass_eigenstates.hpp \ + $(DIR)/@MODELNAME@_observables.hpp \ + $(DIR)/@MODELNAME@_physical.hpp \ + $(DIR)/@MODELNAME@_utilities.hpp \ + $(DIR)/@MODELNAME@_two_scale_soft_parameters.hpp \ + $(DIR)/@MODELNAME@_two_scale_susy_parameters.hpp \ ifneq ($(findstring two_scale,$(ALGORITHMS)),) -LIB@CLASSNAME@_SRC += \ - $(DIR)/@CLASSNAME@_effective_couplings.cpp \ - $(DIR)/@CLASSNAME@_mass_eigenstates.cpp \ - $(DIR)/@CLASSNAME@_a_muon.cpp \ - $(DIR)/@CLASSNAME@_info.cpp \ - $(DIR)/@CLASSNAME@_input_parameters.cpp \ - $(DIR)/@CLASSNAME@_observables.cpp \ - $(DIR)/@CLASSNAME@_slha_io.cpp \ - $(DIR)/@CLASSNAME@_physical.cpp \ - $(DIR)/@CLASSNAME@_utilities.cpp \ - $(DIR)/@CLASSNAME@_standard_model_matching.cpp \ - $(DIR)/@CLASSNAME@_standard_model_two_scale_matching.cpp \ - $(DIR)/@CLASSNAME@_two_scale_convergence_tester.cpp \ - $(DIR)/@CLASSNAME@_two_scale_high_scale_constraint.cpp \ - $(DIR)/@CLASSNAME@_two_scale_initial_guesser.cpp \ - $(DIR)/@CLASSNAME@_two_scale_low_scale_constraint.cpp \ - $(DIR)/@CLASSNAME@_two_scale_model.cpp \ - $(DIR)/@CLASSNAME@_two_scale_model_slha.cpp \ - $(DIR)/@CLASSNAME@_two_scale_susy_parameters.cpp \ - $(DIR)/@CLASSNAME@_two_scale_soft_parameters.cpp \ - $(DIR)/@CLASSNAME@_two_scale_susy_scale_constraint.cpp -EXE@CLASSNAME@_SRC += \ - $(DIR)/run_@CLASSNAME@.cpp \ - $(DIR)/run_cmd_line_@CLASSNAME@.cpp \ - $(DIR)/scan_@CLASSNAME@.cpp -LIB@CLASSNAME@_HDR += \ - $(DIR)/@CLASSNAME@_a_muon.hpp \ - $(DIR)/@CLASSNAME@_convergence_tester.hpp \ - $(DIR)/@CLASSNAME@_effective_couplings.hpp \ - $(DIR)/@CLASSNAME@_high_scale_constraint.hpp \ - $(DIR)/@CLASSNAME@_mass_eigenstates.hpp \ - $(DIR)/@CLASSNAME@_info.hpp \ - $(DIR)/@CLASSNAME@_initial_guesser.hpp \ - $(DIR)/@CLASSNAME@_input_parameters.hpp \ - $(DIR)/@CLASSNAME@_low_scale_constraint.hpp \ - $(DIR)/@CLASSNAME@_model.hpp \ - $(DIR)/@CLASSNAME@_model_slha.hpp \ - $(DIR)/@CLASSNAME@_observables.hpp \ - $(DIR)/@CLASSNAME@_physical.hpp \ - $(DIR)/@CLASSNAME@_slha_io.hpp \ - $(DIR)/@CLASSNAME@_spectrum_generator_interface.hpp \ - $(DIR)/@CLASSNAME@_spectrum_generator.hpp \ - $(DIR)/@CLASSNAME@_standard_model_matching.hpp \ - $(DIR)/@CLASSNAME@_standard_model_two_scale_matching.hpp \ - $(DIR)/@CLASSNAME@_susy_scale_constraint.hpp \ - $(DIR)/@CLASSNAME@_utilities.hpp \ - $(DIR)/@CLASSNAME@_two_scale_convergence_tester.hpp \ - $(DIR)/@CLASSNAME@_two_scale_high_scale_constraint.hpp \ - $(DIR)/@CLASSNAME@_two_scale_initial_guesser.hpp \ - $(DIR)/@CLASSNAME@_two_scale_low_scale_constraint.hpp \ - $(DIR)/@CLASSNAME@_two_scale_model.hpp \ - $(DIR)/@CLASSNAME@_two_scale_model_slha.hpp \ - $(DIR)/@CLASSNAME@_two_scale_soft_parameters.hpp \ - $(DIR)/@CLASSNAME@_two_scale_susy_parameters.hpp \ - $(DIR)/@CLASSNAME@_two_scale_susy_scale_constraint.hpp -LL@CLASSNAME@_SRC += \ - $(DIR)/@CLASSNAME@_librarylink.cpp - -LL@CLASSNAME@_MMA += \ - $(DIR)/@CLASSNAME@_librarylink.m \ - $(DIR)/run_@CLASSNAME@.m +-include $(DIR)/two_scale.mk +endif +ifneq ($(findstring lattice,$(ALGORITHMS)),) +-include $(DIR)/lattice.mk +endif ifneq ($(MAKECMDGOALS),showbuild) ifneq ($(MAKECMDGOALS),tag) ifneq ($(MAKECMDGOALS),release) ifneq ($(MAKECMDGOALS),doc) --include $(@CLASSNAME@_TWO_SCALE_SUSY_MK) --include $(@CLASSNAME@_TWO_SCALE_SOFT_MK) +-include $(@MODELNAME@_TWO_SCALE_SUSY_MK) +-include $(@MODELNAME@_TWO_SCALE_SOFT_MK) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),pack-$(MODNAME)-src) ifeq ($(findstring clean-,$(MAKECMDGOALS)),) ifeq ($(findstring distclean-,$(MAKECMDGOALS)),) ifeq ($(findstring doc-,$(MAKECMDGOALS)),) -$(@CLASSNAME@_TWO_SCALE_SUSY_MK): run-metacode-$(MODNAME) +$(@MODELNAME@_TWO_SCALE_SUSY_MK): run-metacode-$(MODNAME) @$(CONVERT_DOS_PATHS) $@ -$(@CLASSNAME@_TWO_SCALE_SOFT_MK): run-metacode-$(MODNAME) +$(@MODELNAME@_TWO_SCALE_SOFT_MK): run-metacode-$(MODNAME) @$(CONVERT_DOS_PATHS) $@ endif endif @@ -128,42 +93,40 @@ endif endif endif -endif - # remove duplicates in case all algorithms are used -LIB@CLASSNAME@_SRC := $(sort $(LIB@CLASSNAME@_SRC)) -EXE@CLASSNAME@_SRC := $(sort $(EXE@CLASSNAME@_SRC)) +LIB@MODELNAME@_SRC := $(sort $(LIB@MODELNAME@_SRC)) +EXE@MODELNAME@_SRC := $(sort $(EXE@MODELNAME@_SRC)) -LIB@CLASSNAME@_OBJ := \ - $(patsubst %.cpp, %.o, $(filter %.cpp, $(LIB@CLASSNAME@_SRC))) \ - $(patsubst %.f, %.o, $(filter %.f, $(LIB@CLASSNAME@_SRC))) +LIB@MODELNAME@_OBJ := \ + $(patsubst %.cpp, %.o, $(filter %.cpp, $(LIB@MODELNAME@_SRC))) \ + $(patsubst %.f, %.o, $(filter %.f, $(LIB@MODELNAME@_SRC))) -EXE@CLASSNAME@_OBJ := \ - $(patsubst %.cpp, %.o, $(filter %.cpp, $(EXE@CLASSNAME@_SRC))) \ - $(patsubst %.f, %.o, $(filter %.f, $(EXE@CLASSNAME@_SRC))) +EXE@MODELNAME@_OBJ := \ + $(patsubst %.cpp, %.o, $(filter %.cpp, $(EXE@MODELNAME@_SRC))) \ + $(patsubst %.f, %.o, $(filter %.f, $(EXE@MODELNAME@_SRC))) -EXE@CLASSNAME@_EXE := \ - $(patsubst %.cpp, %.x, $(filter %.cpp, $(EXE@CLASSNAME@_SRC))) \ - $(patsubst %.f, %.x, $(filter %.f, $(EXE@CLASSNAME@_SRC))) +EXE@MODELNAME@_EXE := \ + $(patsubst %.cpp, %.x, $(filter %.cpp, $(EXE@MODELNAME@_SRC))) \ + $(patsubst %.f, %.x, $(filter %.f, $(EXE@MODELNAME@_SRC))) -LIB@CLASSNAME@_DEP := \ - $(LIB@CLASSNAME@_OBJ:.o=.d) +LIB@MODELNAME@_DEP := \ + $(LIB@MODELNAME@_OBJ:.o=.d) -EXE@CLASSNAME@_DEP := \ - $(EXE@CLASSNAME@_OBJ:.o=.d) +EXE@MODELNAME@_DEP := \ + $(EXE@MODELNAME@_OBJ:.o=.d) -LL@CLASSNAME@_DEP := \ - $(patsubst %.cpp, %.d, $(filter %.cpp, $(LL@CLASSNAME@_SRC))) +LL@MODELNAME@_DEP := \ + $(patsubst %.cpp, %.d, $(filter %.cpp, $(LL@MODELNAME@_SRC))) -LL@CLASSNAME@_OBJ := $(LL@CLASSNAME@_SRC:.cpp=.o) -LL@CLASSNAME@_LIB := $(LL@CLASSNAME@_SRC:.cpp=$(LIBLNK_LIBEXT)) +LL@MODELNAME@_OBJ := $(LL@MODELNAME@_SRC:.cpp=.o) +LL@MODELNAME@_LIB := $(LL@MODELNAME@_SRC:.cpp=$(LIBLNK_LIBEXT)) -LIB@CLASSNAME@ := $(DIR)/lib$(MODNAME)$(MODULE_LIBEXT) +LIB@MODELNAME@ := $(DIR)/lib$(MODNAME)$(MODULE_LIBEXT) -METACODE_STAMP_@CLASSNAME@ := $(DIR)/00_DELETE_ME_TO_RERUN_METACODE +METACODE_STAMP_@MODELNAME@ := $(DIR)/00_DELETE_ME_TO_RERUN_METACODE ifeq ($(ENABLE_META),yes) -SARAH_MODEL_FILES_@CLASSNAME@ := \ +SARAH_MODEL_FILES_@MODELNAME@ := \ $(shell $(SARAH_DEP_GEN) $(SARAH_MODEL)) endif @@ -172,56 +135,56 @@ endif clean-$(MODNAME)-obj distclean-$(MODNAME) \ run-metacode-$(MODNAME) pack-$(MODNAME)-src -all-$(MODNAME): $(LIB@CLASSNAME@) $(EXE@CLASSNAME@_EXE) +all-$(MODNAME): $(LIB@MODELNAME@) $(EXE@MODELNAME@_EXE) @true ifneq ($(INSTALL_DIR),) install-src:: - install -d $(@CLASSNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LIB@CLASSNAME@_SRC) $(@CLASSNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LIB@CLASSNAME@_HDR) $(@CLASSNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(EXE@CLASSNAME@_SRC) $(@CLASSNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LL@CLASSNAME@_SRC) $(@CLASSNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LL@CLASSNAME@_MMA) $(@CLASSNAME@_INSTALL_DIR) - $(INSTALL_STRIPPED) $(@CLASSNAME@_MK) $(@CLASSNAME@_INSTALL_DIR) -m u=rw,g=r,o=r - install -m u=rw,g=r,o=r $(@CLASSNAME@_TWO_SCALE_MK) $(@CLASSNAME@_INSTALL_DIR) -ifneq ($(@CLASSNAME@_SLHA_INPUT),) - install -m u=rw,g=r,o=r $(@CLASSNAME@_SLHA_INPUT) $(@CLASSNAME@_INSTALL_DIR) + install -d $(@MODELNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LIB@MODELNAME@_SRC) $(@MODELNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LIB@MODELNAME@_HDR) $(@MODELNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(EXE@MODELNAME@_SRC) $(@MODELNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LL@MODELNAME@_SRC) $(@MODELNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LL@MODELNAME@_MMA) $(@MODELNAME@_INSTALL_DIR) + $(INSTALL_STRIPPED) $(@MODELNAME@_MK) $(@MODELNAME@_INSTALL_DIR) -m u=rw,g=r,o=r + install -m u=rw,g=r,o=r $(@MODELNAME@_INCLUDE_MK) $(@MODELNAME@_INSTALL_DIR) +ifneq ($(@MODELNAME@_SLHA_INPUT),) + install -m u=rw,g=r,o=r $(@MODELNAME@_SLHA_INPUT) $(@MODELNAME@_INSTALL_DIR) endif - install -m u=rw,g=r,o=r $(@CLASSNAME@_GNUPLOT) $(@CLASSNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(@MODELNAME@_GNUPLOT) $(@MODELNAME@_INSTALL_DIR) endif clean-$(MODNAME)-dep: - -rm -f $(LIB@CLASSNAME@_DEP) - -rm -f $(EXE@CLASSNAME@_DEP) - -rm -f $(LL@CLASSNAME@_DEP) + -rm -f $(LIB@MODELNAME@_DEP) + -rm -f $(EXE@MODELNAME@_DEP) + -rm -f $(LL@MODELNAME@_DEP) clean-$(MODNAME)-lib: - -rm -f $(LIB@CLASSNAME@) - -rm -f $(LL@CLASSNAME@_LIB) + -rm -f $(LIB@MODELNAME@) + -rm -f $(LL@MODELNAME@_LIB) clean-$(MODNAME)-obj: - -rm -f $(LIB@CLASSNAME@_OBJ) - -rm -f $(EXE@CLASSNAME@_OBJ) - -rm -f $(LL@CLASSNAME@_OBJ) + -rm -f $(LIB@MODELNAME@_OBJ) + -rm -f $(EXE@MODELNAME@_OBJ) + -rm -f $(LL@MODELNAME@_OBJ) # BEGIN: NOT EXPORTED ########################################## clean-$(MODNAME)-src: - -rm -f $(LIB@CLASSNAME@_SRC) - -rm -f $(LIB@CLASSNAME@_HDR) - -rm -f $(EXE@CLASSNAME@_SRC) - -rm -f $(LL@CLASSNAME@_SRC) - -rm -f $(LL@CLASSNAME@_MMA) - -rm -f $(METACODE_STAMP_@CLASSNAME@) - -rm -f $(@CLASSNAME@_TWO_SCALE_MK) - -rm -f $(@CLASSNAME@_SLHA_INPUT) - -rm -f $(@CLASSNAME@_GNUPLOT) + -rm -f $(LIB@MODELNAME@_SRC) + -rm -f $(LIB@MODELNAME@_HDR) + -rm -f $(EXE@MODELNAME@_SRC) + -rm -f $(LL@MODELNAME@_SRC) + -rm -f $(LL@MODELNAME@_MMA) + -rm -f $(METACODE_STAMP_@MODELNAME@) + -rm -f $(@MODELNAME@_INCLUDE_MK) + -rm -f $(@MODELNAME@_SLHA_INPUT) + -rm -f $(@MODELNAME@_GNUPLOT) distclean-$(MODNAME): clean-$(MODNAME)-src # END: NOT EXPORTED ########################################## clean-$(MODNAME): clean-$(MODNAME)-dep clean-$(MODNAME)-lib clean-$(MODNAME)-obj - -rm -f $(EXE@CLASSNAME@_EXE) + -rm -f $(EXE@MODELNAME@_EXE) distclean-$(MODNAME): clean-$(MODNAME) @true @@ -235,59 +198,59 @@ clean:: clean-$(MODNAME) distclean:: distclean-$(MODNAME) pack-$(MODNAME)-src: - tar -czf $(@CLASSNAME@_TARBALL) \ - $(LIB@CLASSNAME@_SRC) $(LIB@CLASSNAME@_HDR) \ - $(EXE@CLASSNAME@_SRC) \ - $(@CLASSNAME@_MK) $(@CLASSNAME@_TWO_SCALE_MK) \ - $(@CLASSNAME@_SLHA_INPUT) $(@CLASSNAME@_GNUPLOT) + tar -czf $(@MODELNAME@_TARBALL) \ + $(LIB@MODELNAME@_SRC) $(LIB@MODELNAME@_HDR) \ + $(EXE@MODELNAME@_SRC) \ + $(@MODELNAME@_MK) $(@MODELNAME@_INCLUDE_MK) \ + $(@MODELNAME@_SLHA_INPUT) $(@MODELNAME@_GNUPLOT) -$(LIB@CLASSNAME@_SRC) $(LIB@CLASSNAME@_HDR) $(EXE@CLASSNAME@_SRC) $(LL@CLASSNAME@_SRC) $(LL@CLASSNAME@_MMA) \ +$(LIB@MODELNAME@_SRC) $(LIB@MODELNAME@_HDR) $(EXE@MODELNAME@_SRC) $(LL@MODELNAME@_SRC) $(LL@MODELNAME@_MMA) \ : run-metacode-$(MODNAME) @true -run-metacode-$(MODNAME): $(METACODE_STAMP_@CLASSNAME@) +run-metacode-$(MODNAME): $(METACODE_STAMP_@MODELNAME@) @true ifeq ($(ENABLE_META),yes) -$(METACODE_STAMP_@CLASSNAME@): $(DIR)/start.m $(DIR)/FlexibleSUSY.m $(META_SRC) $(TEMPLATES) $(SARAH_MODEL_FILES_@CLASSNAME@) +$(METACODE_STAMP_@MODELNAME@): $(DIR)/start.m $(DIR)/FlexibleSUSY.m $(META_SRC) $(TEMPLATES) $(SARAH_MODEL_FILES_@MODELNAME@) "$(MATH)" -run "Get[\"$<\"]; Quit[]" - @touch "$(METACODE_STAMP_@CLASSNAME@)" - @echo "Note: to regenerate @CLASSNAME@ source files," \ + @touch "$(METACODE_STAMP_@MODELNAME@)" + @echo "Note: to regenerate @MODELNAME@ source files," \ "please remove the file " - @echo "\"$(METACODE_STAMP_@CLASSNAME@)\" and run make" + @echo "\"$(METACODE_STAMP_@MODELNAME@)\" and run make" @echo "---------------------------------" else -$(METACODE_STAMP_@CLASSNAME@): +$(METACODE_STAMP_@MODELNAME@): @true endif -$(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP) $(LL@CLASSNAME@_DEP) $(LIB@CLASSNAME@_OBJ) $(EXE@CLASSNAME@_OBJ) $(LL@CLASSNAME@_OBJ) $(LL@CLASSNAME@_LIB): \ +$(LIB@MODELNAME@_DEP) $(EXE@MODELNAME@_DEP) $(LL@MODELNAME@_DEP) $(LIB@MODELNAME@_OBJ) $(EXE@MODELNAME@_OBJ) $(LL@MODELNAME@_OBJ) $(LL@MODELNAME@_LIB): \ CPPFLAGS += $(GSLFLAGS) $(EIGENFLAGS) $(BOOSTFLAGS) $(TSILFLAGS) ifneq (,$(findstring yes,$(ENABLE_LOOPTOOLS)$(ENABLE_FFLITE))) -$(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP) $(LL@CLASSNAME@_DEP) $(LIB@CLASSNAME@_OBJ) $(EXE@CLASSNAME@_OBJ) $(LL@CLASSNAME@_OBJ) $(LL@CLASSNAME@_LIB): \ +$(LIB@MODELNAME@_DEP) $(EXE@MODELNAME@_DEP) $(LL@MODELNAME@_DEP) $(LIB@MODELNAME@_OBJ) $(EXE@MODELNAME@_OBJ) $(LL@MODELNAME@_OBJ) $(LL@MODELNAME@_LIB): \ CPPFLAGS += $(LOOPFUNCFLAGS) endif -$(LL@CLASSNAME@_OBJ) $(LL@CLASSNAME@_LIB): \ +$(LL@MODELNAME@_OBJ) $(LL@MODELNAME@_LIB): \ CPPFLAGS += $(shell $(MATH_INC_PATHS) --math-cmd="$(MATH)" -I --librarylink --mathlink) -$(LIB@CLASSNAME@): $(LIB@CLASSNAME@_OBJ) +$(LIB@MODELNAME@): $(LIB@MODELNAME@_OBJ) $(MODULE_MAKE_LIB_CMD) $@ $^ -$(DIR)/%.x: $(DIR)/%.o $(LIB@CLASSNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) +$(DIR)/%.x: $(DIR)/%.o $(LIB@MODELNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) $(CXX) $(LDFLAGS) -o $@ $(call abspathx,$^ $(ADDONLIBS)) $(filter -%,$(LOOPFUNCLIBS)) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS) -$(LL@CLASSNAME@_LIB): $(LL@CLASSNAME@_OBJ) $(LIB@CLASSNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) +$(LL@MODELNAME@_LIB): $(LL@MODELNAME@_OBJ) $(LIB@MODELNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) $(LIBLNK_MAKE_LIB_CMD) $@ $(CPPFLAGS) $(CFLAGS) $(call abspathx,$^) $(ADDONLIBS) $(filter -%,$(LOOPFUNCLIBS)) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS) -ALLDEP += $(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP) -ALLSRC += $(LIB@CLASSNAME@_SRC) $(EXE@CLASSNAME@_SRC) -ALLLIB += $(LIB@CLASSNAME@) -ALLEXE += $(EXE@CLASSNAME@_EXE) +ALLDEP += $(LIB@MODELNAME@_DEP) $(EXE@MODELNAME@_DEP) +ALLSRC += $(LIB@MODELNAME@_SRC) $(EXE@MODELNAME@_SRC) +ALLLIB += $(LIB@MODELNAME@) +ALLEXE += $(EXE@MODELNAME@_EXE) ifeq ($(ENABLE_LIBRARYLINK),yes) -ALLDEP += $(LL@CLASSNAME@_DEP) -ALLSRC += $(LL@CLASSNAME@_SRC) -ALLLL += $(LL@CLASSNAME@_LIB) +ALLDEP += $(LL@MODELNAME@_DEP) +ALLSRC += $(LL@MODELNAME@_SRC) +ALLLL += $(LL@MODELNAME@_LIB) endif diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in new file mode 100644 index 000000000..fc1b3aad7 --- /dev/null +++ b/templates/two_scale.mk.in @@ -0,0 +1,62 @@ +# ==================================================================== +# This file is part of FlexibleSUSY. +# +# FlexibleSUSY 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 3 of the License, +# or (at your option) any later version. +# +# FlexibleSUSY 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 FlexibleSUSY. If not, see +# . +# ==================================================================== + +@ModelName@_INCLUDE_MK += $(DIR)/two_scale.mk + +LIB@ModelName@_SRC += \ + $(DIR)/@ModelName@_slha_io.cpp \ + $(DIR)/@ModelName@_standard_model_matching.cpp \ + $(DIR)/@ModelName@_standard_model_two_scale_matching.cpp \ + $(DIR)/@ModelName@_two_scale_convergence_tester.cpp \ + $(DIR)/@ModelName@_two_scale_high_scale_constraint.cpp \ + $(DIR)/@ModelName@_two_scale_initial_guesser.cpp \ + $(DIR)/@ModelName@_two_scale_low_scale_constraint.cpp \ + $(DIR)/@ModelName@_two_scale_model.cpp \ + $(DIR)/@ModelName@_two_scale_model_slha.cpp \ + $(DIR)/@ModelName@_two_scale_susy_scale_constraint.cpp +EXE@ModelName@_SRC += \ + $(DIR)/run_@ModelName@.cpp \ + $(DIR)/run_cmd_line_@ModelName@.cpp \ + $(DIR)/scan_@ModelName@.cpp +LIB@ModelName@_HDR += \ + $(DIR)/@ModelName@_convergence_tester.hpp \ + $(DIR)/@ModelName@_high_scale_constraint.hpp \ + $(DIR)/@ModelName@_initial_guesser.hpp \ + $(DIR)/@ModelName@_low_scale_constraint.hpp \ + $(DIR)/@ModelName@_model.hpp \ + $(DIR)/@ModelName@_model_slha.hpp \ + $(DIR)/@ModelName@_slha_io.hpp \ + $(DIR)/@ModelName@_spectrum_generator_interface.hpp \ + $(DIR)/@ModelName@_spectrum_generator.hpp \ + $(DIR)/@ModelName@_standard_model_matching.hpp \ + $(DIR)/@ModelName@_standard_model_two_scale_matching.hpp \ + $(DIR)/@ModelName@_susy_scale_constraint.hpp \ + $(DIR)/@ModelName@_two_scale_convergence_tester.hpp \ + $(DIR)/@ModelName@_two_scale_high_scale_constraint.hpp \ + $(DIR)/@ModelName@_two_scale_initial_guesser.hpp \ + $(DIR)/@ModelName@_two_scale_low_scale_constraint.hpp \ + $(DIR)/@ModelName@_two_scale_model.hpp \ + $(DIR)/@ModelName@_two_scale_model_slha.hpp \ + $(DIR)/@ModelName@_two_scale_susy_scale_constraint.hpp +LL@ModelName@_SRC += \ + $(DIR)/@ModelName@_librarylink.cpp + +LL@ModelName@_MMA += \ + $(DIR)/@ModelName@_librarylink.m \ + $(DIR)/run_@ModelName@.m + From ef1f6771ff32c44018923558df1ed5c04d153cf4 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Wed, 2 Nov 2016 10:29:19 +1030 Subject: [PATCH 05/34] Change --with-algorithms to --with-solvers --- configure | 62 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/configure b/configure index 55f1ccfb5..9988fda72 100755 --- a/configure +++ b/configure @@ -202,9 +202,9 @@ sqlite_lib_dir="" sqlite_inc_dir="" tsil_lib_dir="" tsil_inc_dir="" -# available RG algorithms -ALGORITHMS="two_scale" -available_algorithms="two_scale lattice" +# available RG solvers +SOLVERS="two_scale" +available_solvers="two_scale lattice" # models that will be compiled MODELS="all" # BEGIN: NOT EXPORTED ########################################## @@ -778,17 +778,17 @@ try_compile_run_cpp_program() { } #_____________________________________________________________________ -use_algorithm() { - # This function tests if a certain algorithm [$1] is used. +use_solver() { + # This function tests if a certain solver [$1] is used. # Assert that we got enough arguments if test $# -ne 1 ; then - echo "use_algorithm: Exactly one argument required" + echo "use_solver: Exactly one argument required" return 1 fi - # check if the argument is in the list of used algorithms - contains "$ALGORITHMS" "$1" + # check if the argument is in the list of used solvers + contains "$SOLVERS" "$1" } #_____________________________________________________________________ @@ -872,34 +872,34 @@ check_install_dir() { } #_____________________________________________________________________ -check_algorithms() { - if test -z "${ALGORITHMS}"; then - logmsg "No RGE solver algorithms specified" +check_solvers() { + if test -z "${SOLVERS}"; then + logmsg "No RGE solvers specified" return 0 fi - checking_msg "RGE solver algorithms" - local algs="$(echo $ALGORITHMS | tr ',' ' ')" - ALGORITHMS="" + checking_msg "RGE solvers" + local algs="$(echo $SOLVERS | tr ',' ' ')" + SOLVERS="" for a in ${algs}; do case "$a" in all) - ALGORITHMS="$available_algorithms"; break ;; + SOLVERS="$available_solvers"; break ;; two_scale|lattice) - ALGORITHMS="$ALGORITHMS $a" + SOLVERS="$SOLVERS $a" continue ;; *) - message "Error: unknown algorithm: $a"; - message "Available algorithms: $available_algorithms"; + message "Error: unknown solver: $a"; + message "Available solvers: $available_solvers"; exit 1 ;; esac done # strip whitespace - ALGORITHMS="$(echo ${ALGORITHMS} | sed -e 's/^ *//' -e 's/ *$//')" + SOLVERS="$(echo ${SOLVERS} | sed -e 's/^ *//' -e 's/ *$//')" - result "ok (${ALGORITHMS})" - logmsg " Algorithms: ${ALGORITHMS}" + result "ok (${SOLVERS})" + logmsg " Solvers: ${SOLVERS}" } #_____________________________________________________________________ @@ -1171,7 +1171,7 @@ check_boost_thread_libs() { if [ -z "$found_lib" ]; then message "Error: libboost_thread or libboost_thread-mt must be installed" message " to enable multithreading in the lattice method, see http://www.boost.org" - message " You can disable the lattice method with the --with-algorithms= flag." + message " You can disable the lattice method with the --with-solvers= flag." exit 1 fi local BOOSTTHREADLIBS_=-l$(echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') @@ -1181,7 +1181,7 @@ check_boost_thread_libs() { if [ -z "$found_lib" ]; then message "Error: libboost_system or libboost_system-mt must be installed" message " to enable multithreading in the lattice method, see http://www.boost.org" - message " You can disable the lattice method with the --with-algorithms= flag." + message " You can disable the lattice method with the --with-solvers= flag." exit 1 fi BOOSTTHREADLIBS_="$BOOSTTHREADLIBS_ "-l$( @@ -1202,7 +1202,7 @@ check_boost_thread_incl() { if test "x$found_hdr" = "x" ; then message "Error: boost/thread/thread.hpp must be installed" message " to enable multithreading in the lattice method, see http://www.boost.org" - message " You can disable the lattice method with the --with-algorithms= flag." + message " You can disable the lattice method with the --with-solvers= flag." exit 1 else if contains_not "${BOOSTFLAGS}" "-I$found_dir"; then @@ -2290,7 +2290,7 @@ replace_markers() { -e "s|@ABSBASEDIR@|$ABSBASEDIR|" \ -e "s|@ADDONS@|$ADDONS|" \ -e "s|@INSTALL_DIR@|$INSTALL_DIR|" \ - -e "s|@ALGORITHMS@|$ALGORITHMS|" \ + -e "s|@ALGORITHMS@|$SOLVERS|" \ -e "s|@BLASLIBS@|$BLASLIBS|" \ -e "s|@BOOSTTESTLIBS@|$BOOSTTESTLIBS|" \ -e "s|@BOOSTTHREADLIBS@|$BOOSTTHREADLIBS|" \ @@ -2388,9 +2388,9 @@ Package directories, compilation settings and model selection --with-addons= Comma separated list of addons to be build (default: $ADDONS) - --with-algorithms= Comma separated list of RG solver algorithms - (default: $ALGORITHMS) - possible values: all $available_algorithms + --with-solvers= Comma separated list of RG solver algorithms + (default: $SOLVERS) + possible values: all $available_solvers --with-blas-libdir= Path to search for BLAS library --with-blas-libs= BLAS libraries to be linked --with-boost-libdir= Path to search for BOOST libraries @@ -2502,7 +2502,7 @@ if test $# -gt 0 ; then fi ;; --with-addons=*) ADDONS=$optarg ;; - --with-algorithms=*) ALGORITHMS=$optarg ;; + --with-solvers=*) SOLVERS=$optarg ;; --with-blas-libdir=*) blas_lib_dir=$optarg ;; --with-blas-libs=*) BLASLIBS=$optarg ;; --with-boost-libdir=*) boost_lib_dir=$optarg ;; @@ -2548,7 +2548,7 @@ fi log_package_information guess_machine_word_size check_platform -check_algorithms +check_solvers check_install check_install_dir @@ -2585,7 +2585,7 @@ if test "x${enable_compile}" = "xyes"; then check_ilp64mkl_in_math check_blas_libs check_lapack_libs - if use_algorithm "lattice"; then + if use_solver "lattice"; then check_boost_thread_incl check_boost_thread_libs fi From dae5c48c8f94cd53ab95b5c4e33ab02560748ffa Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Wed, 2 Nov 2016 16:22:40 +1030 Subject: [PATCH 06/34] Revert changing @CLASSNAME@ to @MODELNAME@ as they are equivalent, and this preserves the interface in the model files. --- createmodel | 2 +- templates/module.mk.in | 248 ++++++++++++++++++++--------------------- 2 files changed, 125 insertions(+), 125 deletions(-) diff --git a/createmodel b/createmodel index bf32b09fd..a3c455c3d 100755 --- a/createmodel +++ b/createmodel @@ -489,7 +489,7 @@ SLHA_input_files_in_mk=$(echo "$SLHA_input_files" | message -n " Creating Makefile module $targetdir/module.mk ... " sed -e "s|@DIR@|$targetdir|g" \ -e "s|@MODEL@|$sarah_model|g" \ - -e "s|@MODELNAME@|$name|g" \ + -e "s|@CLASSNAME@|$name|g" \ -e "s|@SLHA_INPUT@|$SLHA_input_files_in_mk|g" \ < templates/module.mk.in > $targetdir/module.mk message "done" diff --git a/templates/module.mk.in b/templates/module.mk.in index 33d2c58e3..d415814b0 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -1,63 +1,63 @@ DIR := @DIR@ -MODNAME := @MODELNAME@ +MODNAME := @CLASSNAME@ SARAH_MODEL := @MODEL@ WITH_$(MODNAME) := yes -@MODELNAME@_INSTALL_DIR := $(INSTALL_DIR)/$(DIR) +@CLASSNAME@_INSTALL_DIR := $(INSTALL_DIR)/$(DIR) -@MODELNAME@_MK := \ +@CLASSNAME@_MK := \ $(DIR)/module.mk -@MODELNAME@_TWO_SCALE_SUSY_MK := \ +@CLASSNAME@_TWO_SCALE_SUSY_MK := \ $(DIR)/two_scale_susy.mk -@MODELNAME@_TWO_SCALE_SOFT_MK := \ +@CLASSNAME@_TWO_SCALE_SOFT_MK := \ $(DIR)/two_scale_soft.mk -@MODELNAME@_INCLUDE_MK := \ - $(@MODELNAME@_TWO_SCALE_SUSY_MK) \ - $(@MODELNAME@_TWO_SCALE_SOFT_MK) +@CLASSNAME@_INCLUDE_MK := \ + $(@CLASSNAME@_TWO_SCALE_SUSY_MK) \ + $(@CLASSNAME@_TWO_SCALE_SOFT_MK) -@MODELNAME@_SLHA_INPUT := \ - $(DIR)/LesHouches.in.@MODELNAME@_generated \ +@CLASSNAME@_SLHA_INPUT := \ + $(DIR)/LesHouches.in.@CLASSNAME@_generated \ @SLHA_INPUT@ -@MODELNAME@_GNUPLOT := \ - $(DIR)/@MODELNAME@_plot_rgflow.gnuplot \ - $(DIR)/@MODELNAME@_plot_spectrum.gnuplot +@CLASSNAME@_GNUPLOT := \ + $(DIR)/@CLASSNAME@_plot_rgflow.gnuplot \ + $(DIR)/@CLASSNAME@_plot_spectrum.gnuplot -@MODELNAME@_TARBALL := \ +@CLASSNAME@_TARBALL := \ $(MODNAME).tar.gz -LIB@MODELNAME@_SRC := \ - $(DIR)/@MODELNAME@_a_muon.cpp \ - $(DIR)/@MODELNAME@_effective_couplings.cpp \ - $(DIR)/@MODELNAME@_info.cpp \ - $(DIR)/@MODELNAME@_input_parameters.cpp \ - $(DIR)/@MODELNAME@_mass_eigenstates.cpp \ - $(DIR)/@MODELNAME@_observables.cpp \ - $(DIR)/@MODELNAME@_physical.cpp \ - $(DIR)/@MODELNAME@_utilities.cpp \ - $(DIR)/@MODELNAME@_two_scale_susy_parameters.cpp \ - $(DIR)/@MODELNAME@_two_scale_soft_parameters.cpp \ - -EXE@MODELNAME@_SRC := -LL@MODELNAME@_LIB := -LL@MODELNAME@_OBJ := -LL@MODELNAME@_SRC := -LL@MODELNAME@_MMA := - -LIB@MODELNAME@_HDR := \ - $(DIR)/@MODELNAME@_a_muon.hpp \ - $(DIR)/@MODELNAME@_effective_couplings.hpp \ - $(DIR)/@MODELNAME@_info.hpp \ - $(DIR)/@MODELNAME@_input_parameters.hpp \ - $(DIR)/@MODELNAME@_mass_eigenstates.hpp \ - $(DIR)/@MODELNAME@_observables.hpp \ - $(DIR)/@MODELNAME@_physical.hpp \ - $(DIR)/@MODELNAME@_utilities.hpp \ - $(DIR)/@MODELNAME@_two_scale_soft_parameters.hpp \ - $(DIR)/@MODELNAME@_two_scale_susy_parameters.hpp \ +LIB@CLASSNAME@_SRC := \ + $(DIR)/@CLASSNAME@_a_muon.cpp \ + $(DIR)/@CLASSNAME@_effective_couplings.cpp \ + $(DIR)/@CLASSNAME@_info.cpp \ + $(DIR)/@CLASSNAME@_input_parameters.cpp \ + $(DIR)/@CLASSNAME@_mass_eigenstates.cpp \ + $(DIR)/@CLASSNAME@_observables.cpp \ + $(DIR)/@CLASSNAME@_physical.cpp \ + $(DIR)/@CLASSNAME@_utilities.cpp \ + $(DIR)/@CLASSNAME@_two_scale_susy_parameters.cpp \ + $(DIR)/@CLASSNAME@_two_scale_soft_parameters.cpp \ + +EXE@CLASSNAME@_SRC := +LL@CLASSNAME@_LIB := +LL@CLASSNAME@_OBJ := +LL@CLASSNAME@_SRC := +LL@CLASSNAME@_MMA := + +LIB@CLASSNAME@_HDR := \ + $(DIR)/@CLASSNAME@_a_muon.hpp \ + $(DIR)/@CLASSNAME@_effective_couplings.hpp \ + $(DIR)/@CLASSNAME@_info.hpp \ + $(DIR)/@CLASSNAME@_input_parameters.hpp \ + $(DIR)/@CLASSNAME@_mass_eigenstates.hpp \ + $(DIR)/@CLASSNAME@_observables.hpp \ + $(DIR)/@CLASSNAME@_physical.hpp \ + $(DIR)/@CLASSNAME@_utilities.hpp \ + $(DIR)/@CLASSNAME@_two_scale_soft_parameters.hpp \ + $(DIR)/@CLASSNAME@_two_scale_susy_parameters.hpp \ ifneq ($(findstring two_scale,$(ALGORITHMS)),) -include $(DIR)/two_scale.mk @@ -70,17 +70,17 @@ ifneq ($(MAKECMDGOALS),showbuild) ifneq ($(MAKECMDGOALS),tag) ifneq ($(MAKECMDGOALS),release) ifneq ($(MAKECMDGOALS),doc) --include $(@MODELNAME@_TWO_SCALE_SUSY_MK) --include $(@MODELNAME@_TWO_SCALE_SOFT_MK) +-include $(@CLASSNAME@_TWO_SCALE_SUSY_MK) +-include $(@CLASSNAME@_TWO_SCALE_SOFT_MK) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),pack-$(MODNAME)-src) ifeq ($(findstring clean-,$(MAKECMDGOALS)),) ifeq ($(findstring distclean-,$(MAKECMDGOALS)),) ifeq ($(findstring doc-,$(MAKECMDGOALS)),) -$(@MODELNAME@_TWO_SCALE_SUSY_MK): run-metacode-$(MODNAME) +$(@CLASSNAME@_TWO_SCALE_SUSY_MK): run-metacode-$(MODNAME) @$(CONVERT_DOS_PATHS) $@ -$(@MODELNAME@_TWO_SCALE_SOFT_MK): run-metacode-$(MODNAME) +$(@CLASSNAME@_TWO_SCALE_SOFT_MK): run-metacode-$(MODNAME) @$(CONVERT_DOS_PATHS) $@ endif endif @@ -94,39 +94,39 @@ endif endif # remove duplicates in case all algorithms are used -LIB@MODELNAME@_SRC := $(sort $(LIB@MODELNAME@_SRC)) -EXE@MODELNAME@_SRC := $(sort $(EXE@MODELNAME@_SRC)) +LIB@CLASSNAME@_SRC := $(sort $(LIB@CLASSNAME@_SRC)) +EXE@CLASSNAME@_SRC := $(sort $(EXE@CLASSNAME@_SRC)) -LIB@MODELNAME@_OBJ := \ - $(patsubst %.cpp, %.o, $(filter %.cpp, $(LIB@MODELNAME@_SRC))) \ - $(patsubst %.f, %.o, $(filter %.f, $(LIB@MODELNAME@_SRC))) +LIB@CLASSNAME@_OBJ := \ + $(patsubst %.cpp, %.o, $(filter %.cpp, $(LIB@CLASSNAME@_SRC))) \ + $(patsubst %.f, %.o, $(filter %.f, $(LIB@CLASSNAME@_SRC))) -EXE@MODELNAME@_OBJ := \ - $(patsubst %.cpp, %.o, $(filter %.cpp, $(EXE@MODELNAME@_SRC))) \ - $(patsubst %.f, %.o, $(filter %.f, $(EXE@MODELNAME@_SRC))) +EXE@CLASSNAME@_OBJ := \ + $(patsubst %.cpp, %.o, $(filter %.cpp, $(EXE@CLASSNAME@_SRC))) \ + $(patsubst %.f, %.o, $(filter %.f, $(EXE@CLASSNAME@_SRC))) -EXE@MODELNAME@_EXE := \ - $(patsubst %.cpp, %.x, $(filter %.cpp, $(EXE@MODELNAME@_SRC))) \ - $(patsubst %.f, %.x, $(filter %.f, $(EXE@MODELNAME@_SRC))) +EXE@CLASSNAME@_EXE := \ + $(patsubst %.cpp, %.x, $(filter %.cpp, $(EXE@CLASSNAME@_SRC))) \ + $(patsubst %.f, %.x, $(filter %.f, $(EXE@CLASSNAME@_SRC))) -LIB@MODELNAME@_DEP := \ - $(LIB@MODELNAME@_OBJ:.o=.d) +LIB@CLASSNAME@_DEP := \ + $(LIB@CLASSNAME@_OBJ:.o=.d) -EXE@MODELNAME@_DEP := \ - $(EXE@MODELNAME@_OBJ:.o=.d) +EXE@CLASSNAME@_DEP := \ + $(EXE@CLASSNAME@_OBJ:.o=.d) -LL@MODELNAME@_DEP := \ - $(patsubst %.cpp, %.d, $(filter %.cpp, $(LL@MODELNAME@_SRC))) +LL@CLASSNAME@_DEP := \ + $(patsubst %.cpp, %.d, $(filter %.cpp, $(LL@CLASSNAME@_SRC))) -LL@MODELNAME@_OBJ := $(LL@MODELNAME@_SRC:.cpp=.o) -LL@MODELNAME@_LIB := $(LL@MODELNAME@_SRC:.cpp=$(LIBLNK_LIBEXT)) +LL@CLASSNAME@_OBJ := $(LL@CLASSNAME@_SRC:.cpp=.o) +LL@CLASSNAME@_LIB := $(LL@CLASSNAME@_SRC:.cpp=$(LIBLNK_LIBEXT)) -LIB@MODELNAME@ := $(DIR)/lib$(MODNAME)$(MODULE_LIBEXT) +LIB@CLASSNAME@ := $(DIR)/lib$(MODNAME)$(MODULE_LIBEXT) -METACODE_STAMP_@MODELNAME@ := $(DIR)/00_DELETE_ME_TO_RERUN_METACODE +METACODE_STAMP_@CLASSNAME@ := $(DIR)/00_DELETE_ME_TO_RERUN_METACODE ifeq ($(ENABLE_META),yes) -SARAH_MODEL_FILES_@MODELNAME@ := \ +SARAH_MODEL_FILES_@CLASSNAME@ := \ $(shell $(SARAH_DEP_GEN) $(SARAH_MODEL)) endif @@ -135,56 +135,56 @@ endif clean-$(MODNAME)-obj distclean-$(MODNAME) \ run-metacode-$(MODNAME) pack-$(MODNAME)-src -all-$(MODNAME): $(LIB@MODELNAME@) $(EXE@MODELNAME@_EXE) +all-$(MODNAME): $(LIB@CLASSNAME@) $(EXE@CLASSNAME@_EXE) @true ifneq ($(INSTALL_DIR),) install-src:: - install -d $(@MODELNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LIB@MODELNAME@_SRC) $(@MODELNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LIB@MODELNAME@_HDR) $(@MODELNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(EXE@MODELNAME@_SRC) $(@MODELNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LL@MODELNAME@_SRC) $(@MODELNAME@_INSTALL_DIR) - install -m u=rw,g=r,o=r $(LL@MODELNAME@_MMA) $(@MODELNAME@_INSTALL_DIR) - $(INSTALL_STRIPPED) $(@MODELNAME@_MK) $(@MODELNAME@_INSTALL_DIR) -m u=rw,g=r,o=r - install -m u=rw,g=r,o=r $(@MODELNAME@_INCLUDE_MK) $(@MODELNAME@_INSTALL_DIR) -ifneq ($(@MODELNAME@_SLHA_INPUT),) - install -m u=rw,g=r,o=r $(@MODELNAME@_SLHA_INPUT) $(@MODELNAME@_INSTALL_DIR) + install -d $(@CLASSNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LIB@CLASSNAME@_SRC) $(@CLASSNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LIB@CLASSNAME@_HDR) $(@CLASSNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(EXE@CLASSNAME@_SRC) $(@CLASSNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LL@CLASSNAME@_SRC) $(@CLASSNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(LL@CLASSNAME@_MMA) $(@CLASSNAME@_INSTALL_DIR) + $(INSTALL_STRIPPED) $(@CLASSNAME@_MK) $(@CLASSNAME@_INSTALL_DIR) -m u=rw,g=r,o=r + install -m u=rw,g=r,o=r $(@CLASSNAME@_INCLUDE_MK) $(@CLASSNAME@_INSTALL_DIR) +ifneq ($(@CLASSNAME@_SLHA_INPUT),) + install -m u=rw,g=r,o=r $(@CLASSNAME@_SLHA_INPUT) $(@CLASSNAME@_INSTALL_DIR) endif - install -m u=rw,g=r,o=r $(@MODELNAME@_GNUPLOT) $(@MODELNAME@_INSTALL_DIR) + install -m u=rw,g=r,o=r $(@CLASSNAME@_GNUPLOT) $(@CLASSNAME@_INSTALL_DIR) endif clean-$(MODNAME)-dep: - -rm -f $(LIB@MODELNAME@_DEP) - -rm -f $(EXE@MODELNAME@_DEP) - -rm -f $(LL@MODELNAME@_DEP) + -rm -f $(LIB@CLASSNAME@_DEP) + -rm -f $(EXE@CLASSNAME@_DEP) + -rm -f $(LL@CLASSNAME@_DEP) clean-$(MODNAME)-lib: - -rm -f $(LIB@MODELNAME@) - -rm -f $(LL@MODELNAME@_LIB) + -rm -f $(LIB@CLASSNAME@) + -rm -f $(LL@CLASSNAME@_LIB) clean-$(MODNAME)-obj: - -rm -f $(LIB@MODELNAME@_OBJ) - -rm -f $(EXE@MODELNAME@_OBJ) - -rm -f $(LL@MODELNAME@_OBJ) + -rm -f $(LIB@CLASSNAME@_OBJ) + -rm -f $(EXE@CLASSNAME@_OBJ) + -rm -f $(LL@CLASSNAME@_OBJ) # BEGIN: NOT EXPORTED ########################################## clean-$(MODNAME)-src: - -rm -f $(LIB@MODELNAME@_SRC) - -rm -f $(LIB@MODELNAME@_HDR) - -rm -f $(EXE@MODELNAME@_SRC) - -rm -f $(LL@MODELNAME@_SRC) - -rm -f $(LL@MODELNAME@_MMA) - -rm -f $(METACODE_STAMP_@MODELNAME@) - -rm -f $(@MODELNAME@_INCLUDE_MK) - -rm -f $(@MODELNAME@_SLHA_INPUT) - -rm -f $(@MODELNAME@_GNUPLOT) + -rm -f $(LIB@CLASSNAME@_SRC) + -rm -f $(LIB@CLASSNAME@_HDR) + -rm -f $(EXE@CLASSNAME@_SRC) + -rm -f $(LL@CLASSNAME@_SRC) + -rm -f $(LL@CLASSNAME@_MMA) + -rm -f $(METACODE_STAMP_@CLASSNAME@) + -rm -f $(@CLASSNAME@_INCLUDE_MK) + -rm -f $(@CLASSNAME@_SLHA_INPUT) + -rm -f $(@CLASSNAME@_GNUPLOT) distclean-$(MODNAME): clean-$(MODNAME)-src # END: NOT EXPORTED ########################################## clean-$(MODNAME): clean-$(MODNAME)-dep clean-$(MODNAME)-lib clean-$(MODNAME)-obj - -rm -f $(EXE@MODELNAME@_EXE) + -rm -f $(EXE@CLASSNAME@_EXE) distclean-$(MODNAME): clean-$(MODNAME) @true @@ -198,59 +198,59 @@ clean:: clean-$(MODNAME) distclean:: distclean-$(MODNAME) pack-$(MODNAME)-src: - tar -czf $(@MODELNAME@_TARBALL) \ - $(LIB@MODELNAME@_SRC) $(LIB@MODELNAME@_HDR) \ - $(EXE@MODELNAME@_SRC) \ - $(@MODELNAME@_MK) $(@MODELNAME@_INCLUDE_MK) \ - $(@MODELNAME@_SLHA_INPUT) $(@MODELNAME@_GNUPLOT) + tar -czf $(@CLASSNAME@_TARBALL) \ + $(LIB@CLASSNAME@_SRC) $(LIB@CLASSNAME@_HDR) \ + $(EXE@CLASSNAME@_SRC) \ + $(@CLASSNAME@_MK) $(@CLASSNAME@_INCLUDE_MK) \ + $(@CLASSNAME@_SLHA_INPUT) $(@CLASSNAME@_GNUPLOT) -$(LIB@MODELNAME@_SRC) $(LIB@MODELNAME@_HDR) $(EXE@MODELNAME@_SRC) $(LL@MODELNAME@_SRC) $(LL@MODELNAME@_MMA) \ +$(LIB@CLASSNAME@_SRC) $(LIB@CLASSNAME@_HDR) $(EXE@CLASSNAME@_SRC) $(LL@CLASSNAME@_SRC) $(LL@CLASSNAME@_MMA) \ : run-metacode-$(MODNAME) @true -run-metacode-$(MODNAME): $(METACODE_STAMP_@MODELNAME@) +run-metacode-$(MODNAME): $(METACODE_STAMP_@CLASSNAME@) @true ifeq ($(ENABLE_META),yes) -$(METACODE_STAMP_@MODELNAME@): $(DIR)/start.m $(DIR)/FlexibleSUSY.m $(META_SRC) $(TEMPLATES) $(SARAH_MODEL_FILES_@MODELNAME@) +$(METACODE_STAMP_@CLASSNAME@): $(DIR)/start.m $(DIR)/FlexibleSUSY.m $(META_SRC) $(TEMPLATES) $(SARAH_MODEL_FILES_@CLASSNAME@) "$(MATH)" -run "Get[\"$<\"]; Quit[]" - @touch "$(METACODE_STAMP_@MODELNAME@)" - @echo "Note: to regenerate @MODELNAME@ source files," \ + @touch "$(METACODE_STAMP_@CLASSNAME@)" + @echo "Note: to regenerate @CLASSNAME@ source files," \ "please remove the file " - @echo "\"$(METACODE_STAMP_@MODELNAME@)\" and run make" + @echo "\"$(METACODE_STAMP_@CLASSNAME@)\" and run make" @echo "---------------------------------" else -$(METACODE_STAMP_@MODELNAME@): +$(METACODE_STAMP_@CLASSNAME@): @true endif -$(LIB@MODELNAME@_DEP) $(EXE@MODELNAME@_DEP) $(LL@MODELNAME@_DEP) $(LIB@MODELNAME@_OBJ) $(EXE@MODELNAME@_OBJ) $(LL@MODELNAME@_OBJ) $(LL@MODELNAME@_LIB): \ +$(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP) $(LL@CLASSNAME@_DEP) $(LIB@CLASSNAME@_OBJ) $(EXE@CLASSNAME@_OBJ) $(LL@CLASSNAME@_OBJ) $(LL@CLASSNAME@_LIB): \ CPPFLAGS += $(GSLFLAGS) $(EIGENFLAGS) $(BOOSTFLAGS) $(TSILFLAGS) ifneq (,$(findstring yes,$(ENABLE_LOOPTOOLS)$(ENABLE_FFLITE))) -$(LIB@MODELNAME@_DEP) $(EXE@MODELNAME@_DEP) $(LL@MODELNAME@_DEP) $(LIB@MODELNAME@_OBJ) $(EXE@MODELNAME@_OBJ) $(LL@MODELNAME@_OBJ) $(LL@MODELNAME@_LIB): \ +$(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP) $(LL@CLASSNAME@_DEP) $(LIB@CLASSNAME@_OBJ) $(EXE@CLASSNAME@_OBJ) $(LL@CLASSNAME@_OBJ) $(LL@CLASSNAME@_LIB): \ CPPFLAGS += $(LOOPFUNCFLAGS) endif -$(LL@MODELNAME@_OBJ) $(LL@MODELNAME@_LIB): \ +$(LL@CLASSNAME@_OBJ) $(LL@CLASSNAME@_LIB): \ CPPFLAGS += $(shell $(MATH_INC_PATHS) --math-cmd="$(MATH)" -I --librarylink --mathlink) -$(LIB@MODELNAME@): $(LIB@MODELNAME@_OBJ) +$(LIB@CLASSNAME@): $(LIB@CLASSNAME@_OBJ) $(MODULE_MAKE_LIB_CMD) $@ $^ -$(DIR)/%.x: $(DIR)/%.o $(LIB@MODELNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) +$(DIR)/%.x: $(DIR)/%.o $(LIB@CLASSNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) $(CXX) $(LDFLAGS) -o $@ $(call abspathx,$^ $(ADDONLIBS)) $(filter -%,$(LOOPFUNCLIBS)) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS) -$(LL@MODELNAME@_LIB): $(LL@MODELNAME@_OBJ) $(LIB@MODELNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) +$(LL@CLASSNAME@_LIB): $(LL@CLASSNAME@_OBJ) $(LIB@CLASSNAME@) $(LIBFLEXI) $(LIBLEGACY) $(filter-out -%,$(LOOPFUNCLIBS)) $(LIBLNK_MAKE_LIB_CMD) $@ $(CPPFLAGS) $(CFLAGS) $(call abspathx,$^) $(ADDONLIBS) $(filter -%,$(LOOPFUNCLIBS)) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS) -ALLDEP += $(LIB@MODELNAME@_DEP) $(EXE@MODELNAME@_DEP) -ALLSRC += $(LIB@MODELNAME@_SRC) $(EXE@MODELNAME@_SRC) -ALLLIB += $(LIB@MODELNAME@) -ALLEXE += $(EXE@MODELNAME@_EXE) +ALLDEP += $(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP) +ALLSRC += $(LIB@CLASSNAME@_SRC) $(EXE@CLASSNAME@_SRC) +ALLLIB += $(LIB@CLASSNAME@) +ALLEXE += $(EXE@CLASSNAME@_EXE) ifeq ($(ENABLE_LIBRARYLINK),yes) -ALLDEP += $(LL@MODELNAME@_DEP) -ALLSRC += $(LL@MODELNAME@_SRC) -ALLLL += $(LL@MODELNAME@_LIB) +ALLDEP += $(LL@CLASSNAME@_DEP) +ALLSRC += $(LL@CLASSNAME@_SRC) +ALLLL += $(LL@CLASSNAME@_LIB) endif From 5c76b043556eeaac3fb63d9fcd107b8844b853e8 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Wed, 2 Nov 2016 17:16:11 +1030 Subject: [PATCH 07/34] Overwrite value of FSModelName in generated FlexibleSUSY.m to ensure consistency between the model file and the generated Makefile. --- createmodel | 1 + 1 file changed, 1 insertion(+) diff --git a/createmodel b/createmodel index a3c455c3d..7a73b59b6 100755 --- a/createmodel +++ b/createmodel @@ -511,6 +511,7 @@ message -n " Creating FlexibleSUSY model file $targetdir/FlexibleSUSY.m ... " sed -e "s|@DIR@|$targetdir|g" \ -e "s|@ModelName@|$sarah_model|g" \ -e "s|@CLASSNAME@|$name|g" \ + -e "s|FSModelName\([[:blank:]]*=[[:blank:]]*\)[^;][^;]*|FSModelName\1\"$name\"|g" \ < $model_file_dir/FlexibleSUSY.m.in > $targetdir/FlexibleSUSY.m message "done" From 31175d0ff7287ed67dfc668171f39dcdd22b0b02 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 3 Nov 2016 12:07:14 +1030 Subject: [PATCH 08/34] Rename files for SUSY and soft-breaking parameters for clarity, as they are not specific to the two-scale method --- meta/FlexibleSUSY.m | 16 ++++++++-------- templates/mass_eigenstates.hpp.in | 2 +- templates/module.mk | 8 ++++---- templates/module.mk.in | 8 ++++---- ..._parameters.cpp.in => soft_parameters.cpp.in} | 2 +- ..._parameters.hpp.in => soft_parameters.hpp.in} | 6 +++--- ..._parameters.cpp.in => susy_parameters.cpp.in} | 2 +- ..._parameters.hpp.in => susy_parameters.hpp.in} | 4 ++-- templates/two_scale_soft_beta_.cpp.in | 2 +- templates/two_scale_susy_beta_.cpp.in | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) rename templates/{two_scale_soft_parameters.cpp.in => soft_parameters.cpp.in} (98%) rename templates/{two_scale_soft_parameters.hpp.in => soft_parameters.hpp.in} (93%) rename templates/{two_scale_susy_parameters.cpp.in => susy_parameters.cpp.in} (98%) rename templates/{two_scale_susy_parameters.hpp.in => susy_parameters.hpp.in} (96%) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 737809dde..295c6315e 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -2258,10 +2258,10 @@ corresponding tadpole is real or imaginary (only in models with CP PrintHeadline["Creating model parameter classes"]; Print["Creating class for susy parameters ..."]; WriteRGEClass[susyBetaFunctions, anomDim, - {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_parameters.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_parameters.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_parameters.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_parameters.cpp"}]}}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "susy_parameters.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_parameters.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "susy_parameters.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_parameters.cpp"}]}}, "two_scale_susy_beta_.cpp.in", {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], FileNameJoin[{FSOutputDir, "two_scale_susy.mk"}]}} @@ -2269,10 +2269,10 @@ corresponding tadpole is real or imaginary (only in models with CP Print["Creating class for soft parameters ..."]; WriteRGEClass[susyBreakingBetaFunctions, {}, - {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_soft_parameters.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_soft_parameters.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_soft_parameters.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_soft_parameters.cpp"}]}}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "soft_parameters.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_soft_parameters.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "soft_parameters.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_soft_parameters.cpp"}]}}, "two_scale_soft_beta_.cpp.in", {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], FileNameJoin[{FSOutputDir, "two_scale_soft.mk"}]}}, diff --git a/templates/mass_eigenstates.hpp.in b/templates/mass_eigenstates.hpp.in index 6e91ba323..19a8412f1 100644 --- a/templates/mass_eigenstates.hpp.in +++ b/templates/mass_eigenstates.hpp.in @@ -32,7 +32,7 @@ #ifndef @ModelName@_MASS_EIGENSTATES_H #define @ModelName@_MASS_EIGENSTATES_H -#include "@ModelName@_two_scale_soft_parameters.hpp" +#include "@ModelName@_soft_parameters.hpp" #include "@ModelName@_physical.hpp" #include "@ModelName@_info.hpp" #include "two_loop_corrections.hpp" diff --git a/templates/module.mk b/templates/module.mk index 31e5cb8bf..eadacd4a6 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -61,11 +61,11 @@ TEMPLATES := \ $(DIR)/two_scale_model_slha.hpp.in \ $(DIR)/two_scale_model_slha.cpp.in \ $(DIR)/two_scale_soft_beta_.cpp.in \ - $(DIR)/two_scale_soft_parameters.hpp.in \ - $(DIR)/two_scale_soft_parameters.cpp.in \ + $(DIR)/soft_parameters.hpp.in \ + $(DIR)/soft_parameters.cpp.in \ $(DIR)/two_scale_susy_beta_.cpp.in \ - $(DIR)/two_scale_susy_parameters.hpp.in \ - $(DIR)/two_scale_susy_parameters.cpp.in \ + $(DIR)/susy_parameters.hpp.in \ + $(DIR)/susy_parameters.cpp.in \ $(DIR)/two_scale_susy_scale_constraint.hpp.in \ $(DIR)/two_scale_susy_scale_constraint.cpp.in \ $(DIR)/utilities.hpp.in \ diff --git a/templates/module.mk.in b/templates/module.mk.in index d415814b0..5825c28d2 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -38,8 +38,8 @@ LIB@CLASSNAME@_SRC := \ $(DIR)/@CLASSNAME@_observables.cpp \ $(DIR)/@CLASSNAME@_physical.cpp \ $(DIR)/@CLASSNAME@_utilities.cpp \ - $(DIR)/@CLASSNAME@_two_scale_susy_parameters.cpp \ - $(DIR)/@CLASSNAME@_two_scale_soft_parameters.cpp \ + $(DIR)/@CLASSNAME@_susy_parameters.cpp \ + $(DIR)/@CLASSNAME@_soft_parameters.cpp \ EXE@CLASSNAME@_SRC := LL@CLASSNAME@_LIB := @@ -56,8 +56,8 @@ LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_observables.hpp \ $(DIR)/@CLASSNAME@_physical.hpp \ $(DIR)/@CLASSNAME@_utilities.hpp \ - $(DIR)/@CLASSNAME@_two_scale_soft_parameters.hpp \ - $(DIR)/@CLASSNAME@_two_scale_susy_parameters.hpp \ + $(DIR)/@CLASSNAME@_soft_parameters.hpp \ + $(DIR)/@CLASSNAME@_susy_parameters.hpp \ ifneq ($(findstring two_scale,$(ALGORITHMS)),) -include $(DIR)/two_scale.mk diff --git a/templates/two_scale_soft_parameters.cpp.in b/templates/soft_parameters.cpp.in similarity index 98% rename from templates/two_scale_soft_parameters.cpp.in rename to templates/soft_parameters.cpp.in index 034162d1a..e8b8d6eb0 100644 --- a/templates/two_scale_soft_parameters.cpp.in +++ b/templates/soft_parameters.cpp.in @@ -18,7 +18,7 @@ // File generated at @DateAndTime@ -#include "@ModelName@_two_scale_soft_parameters.hpp" +#include "@ModelName@_soft_parameters.hpp" #include "wrappers.hpp" #include "functors.hpp" diff --git a/templates/two_scale_soft_parameters.hpp.in b/templates/soft_parameters.hpp.in similarity index 93% rename from templates/two_scale_soft_parameters.hpp.in rename to templates/soft_parameters.hpp.in index d8fcadc56..5b168c943 100644 --- a/templates/two_scale_soft_parameters.hpp.in +++ b/templates/soft_parameters.hpp.in @@ -18,10 +18,10 @@ // File generated at @DateAndTime@ -#ifndef @ModelName@_TWO_SCALE_soft_parameters_H -#define @ModelName@_TWO_SCALE_soft_parameters_H +#ifndef @ModelName@_soft_parameters_H +#define @ModelName@_soft_parameters_H -#include "@ModelName@_two_scale_susy_parameters.hpp" +#include "@ModelName@_susy_parameters.hpp" #include diff --git a/templates/two_scale_susy_parameters.cpp.in b/templates/susy_parameters.cpp.in similarity index 98% rename from templates/two_scale_susy_parameters.cpp.in rename to templates/susy_parameters.cpp.in index 64358519a..96d77f877 100644 --- a/templates/two_scale_susy_parameters.cpp.in +++ b/templates/susy_parameters.cpp.in @@ -18,7 +18,7 @@ // File generated at @DateAndTime@ -#include "@ModelName@_two_scale_susy_parameters.hpp" +#include "@ModelName@_susy_parameters.hpp" #include "wrappers.hpp" #include "functors.hpp" diff --git a/templates/two_scale_susy_parameters.hpp.in b/templates/susy_parameters.hpp.in similarity index 96% rename from templates/two_scale_susy_parameters.hpp.in rename to templates/susy_parameters.hpp.in index 3b20bfc9e..ed8563c14 100644 --- a/templates/two_scale_susy_parameters.hpp.in +++ b/templates/susy_parameters.hpp.in @@ -18,8 +18,8 @@ // File generated at @DateAndTime@ -#ifndef @ModelName@_TWO_SCALE_susy_parameters_H -#define @ModelName@_TWO_SCALE_susy_parameters_H +#ifndef @ModelName@_susy_parameters_H +#define @ModelName@_susy_parameters_H #include "betafunction.hpp" #include "@ModelName@_input_parameters.hpp" diff --git a/templates/two_scale_soft_beta_.cpp.in b/templates/two_scale_soft_beta_.cpp.in index 0152273f8..682d9913a 100644 --- a/templates/two_scale_soft_beta_.cpp.in +++ b/templates/two_scale_soft_beta_.cpp.in @@ -18,7 +18,7 @@ // File generated at @DateAndTime@ -#include "@ModelName@_two_scale_soft_parameters.hpp" +#include "@ModelName@_soft_parameters.hpp" #include "wrappers.hpp" namespace flexiblesusy { diff --git a/templates/two_scale_susy_beta_.cpp.in b/templates/two_scale_susy_beta_.cpp.in index 9613b2585..ce0e12ba6 100644 --- a/templates/two_scale_susy_beta_.cpp.in +++ b/templates/two_scale_susy_beta_.cpp.in @@ -18,7 +18,7 @@ // File generated at @DateAndTime@ -#include "@ModelName@_two_scale_susy_parameters.hpp" +#include "@ModelName@_susy_parameters.hpp" #include "wrappers.hpp" namespace flexiblesusy { From ed913061e0e97dac42bd3a077aad705b66d36dac Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 3 Nov 2016 13:01:23 +1030 Subject: [PATCH 09/34] Rename files for beta functions for clarity --- meta/FlexibleSUSY.m | 4 ++-- templates/module.mk | 4 ++-- templates/{two_scale_soft_beta_.cpp.in => soft_beta_.cpp.in} | 0 templates/{two_scale_susy_beta_.cpp.in => susy_beta_.cpp.in} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename templates/{two_scale_soft_beta_.cpp.in => soft_beta_.cpp.in} (100%) rename templates/{two_scale_susy_beta_.cpp.in => susy_beta_.cpp.in} (100%) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 295c6315e..509ba840f 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -2262,7 +2262,7 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_parameters.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "susy_parameters.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_parameters.cpp"}]}}, - "two_scale_susy_beta_.cpp.in", + "susy_beta_.cpp.in", {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], FileNameJoin[{FSOutputDir, "two_scale_susy.mk"}]}} ]; @@ -2273,7 +2273,7 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_soft_parameters.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "soft_parameters.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_soft_parameters.cpp"}]}}, - "two_scale_soft_beta_.cpp.in", + "soft_beta_.cpp.in", {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], FileNameJoin[{FSOutputDir, "two_scale_soft.mk"}]}}, If[Head[SARAH`TraceAbbr] === List, SARAH`TraceAbbr, {}], diff --git a/templates/module.mk b/templates/module.mk index eadacd4a6..f34585a9e 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -60,10 +60,10 @@ TEMPLATES := \ $(DIR)/two_scale_model.cpp.in \ $(DIR)/two_scale_model_slha.hpp.in \ $(DIR)/two_scale_model_slha.cpp.in \ - $(DIR)/two_scale_soft_beta_.cpp.in \ + $(DIR)/soft_beta_.cpp.in \ $(DIR)/soft_parameters.hpp.in \ $(DIR)/soft_parameters.cpp.in \ - $(DIR)/two_scale_susy_beta_.cpp.in \ + $(DIR)/susy_beta_.cpp.in \ $(DIR)/susy_parameters.hpp.in \ $(DIR)/susy_parameters.cpp.in \ $(DIR)/two_scale_susy_scale_constraint.hpp.in \ diff --git a/templates/two_scale_soft_beta_.cpp.in b/templates/soft_beta_.cpp.in similarity index 100% rename from templates/two_scale_soft_beta_.cpp.in rename to templates/soft_beta_.cpp.in diff --git a/templates/two_scale_susy_beta_.cpp.in b/templates/susy_beta_.cpp.in similarity index 100% rename from templates/two_scale_susy_beta_.cpp.in rename to templates/susy_beta_.cpp.in From 6bc760dfd367b032b8259f5278ebc3d838aaafe6 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 3 Nov 2016 13:16:56 +1030 Subject: [PATCH 10/34] Rename Makefile module for beta functions --- meta/FlexibleSUSY.m | 8 ++++---- .../{two_scale_betas.mk.in => betas.mk.in} | 0 templates/module.mk.in | 20 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) rename templates/{two_scale_betas.mk.in => betas.mk.in} (100%) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 509ba840f..51bc1e00f 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -2263,8 +2263,8 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "susy_parameters.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_parameters.cpp"}]}}, "susy_beta_.cpp.in", - {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], - FileNameJoin[{FSOutputDir, "two_scale_susy.mk"}]}} + {{FileNameJoin[{$flexiblesusyTemplateDir, "betas.mk.in"}], + FileNameJoin[{FSOutputDir, "susy_betas.mk"}]}} ]; Print["Creating class for soft parameters ..."]; @@ -2274,8 +2274,8 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "soft_parameters.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_soft_parameters.cpp"}]}}, "soft_beta_.cpp.in", - {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_betas.mk.in"}], - FileNameJoin[{FSOutputDir, "two_scale_soft.mk"}]}}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "betas.mk.in"}], + FileNameJoin[{FSOutputDir, "soft_betas.mk"}]}}, If[Head[SARAH`TraceAbbr] === List, SARAH`TraceAbbr, {}], numberOfSusyParameters]; diff --git a/templates/two_scale_betas.mk.in b/templates/betas.mk.in similarity index 100% rename from templates/two_scale_betas.mk.in rename to templates/betas.mk.in diff --git a/templates/module.mk.in b/templates/module.mk.in index 5825c28d2..cdf485f56 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -8,15 +8,15 @@ WITH_$(MODNAME) := yes @CLASSNAME@_MK := \ $(DIR)/module.mk -@CLASSNAME@_TWO_SCALE_SUSY_MK := \ - $(DIR)/two_scale_susy.mk +@CLASSNAME@_SUSY_BETAS_MK := \ + $(DIR)/susy_betas.mk -@CLASSNAME@_TWO_SCALE_SOFT_MK := \ - $(DIR)/two_scale_soft.mk +@CLASSNAME@_SOFT_BETAS_MK := \ + $(DIR)/soft_betas.mk @CLASSNAME@_INCLUDE_MK := \ - $(@CLASSNAME@_TWO_SCALE_SUSY_MK) \ - $(@CLASSNAME@_TWO_SCALE_SOFT_MK) + $(@CLASSNAME@_SUSY_BETAS_MK) \ + $(@CLASSNAME@_SOFT_BETAS_MK) @CLASSNAME@_SLHA_INPUT := \ $(DIR)/LesHouches.in.@CLASSNAME@_generated \ @@ -70,17 +70,17 @@ ifneq ($(MAKECMDGOALS),showbuild) ifneq ($(MAKECMDGOALS),tag) ifneq ($(MAKECMDGOALS),release) ifneq ($(MAKECMDGOALS),doc) --include $(@CLASSNAME@_TWO_SCALE_SUSY_MK) --include $(@CLASSNAME@_TWO_SCALE_SOFT_MK) +-include $(@CLASSNAME@_SUSY_BETAS_MK) +-include $(@CLASSNAME@_SOFT_BETAS_MK) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),pack-$(MODNAME)-src) ifeq ($(findstring clean-,$(MAKECMDGOALS)),) ifeq ($(findstring distclean-,$(MAKECMDGOALS)),) ifeq ($(findstring doc-,$(MAKECMDGOALS)),) -$(@CLASSNAME@_TWO_SCALE_SUSY_MK): run-metacode-$(MODNAME) +$(@CLASSNAME@_SUSY_BETAS_MK): run-metacode-$(MODNAME) @$(CONVERT_DOS_PATHS) $@ -$(@CLASSNAME@_TWO_SCALE_SOFT_MK): run-metacode-$(MODNAME) +$(@CLASSNAME@_SOFT_BETAS_MK): run-metacode-$(MODNAME) @$(CONVERT_DOS_PATHS) $@ endif endif From 0679699699a83f0daa4dbecec1d914bb44b4070d Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 3 Nov 2016 13:48:03 +1030 Subject: [PATCH 11/34] Slightly more fine-grained organisation of templates Makefile to make it easier to see where each file is used and avoid very long lists when new solvers are added --- templates/module.mk | 66 ++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/templates/module.mk b/templates/module.mk index f34585a9e..fccf510be 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -1,47 +1,61 @@ DIR := templates MODNAME := templates -TEMPLATES := \ +BASE_TEMPLATES := \ $(DIR)/a_muon.hpp.in \ $(DIR)/a_muon.cpp.in \ - $(DIR)/convergence_tester.hpp.in \ $(DIR)/effective_couplings.hpp.in \ $(DIR)/effective_couplings.cpp.in \ - $(DIR)/high_scale_constraint.hpp.in \ - $(DIR)/mass_eigenstates.hpp.in \ - $(DIR)/mass_eigenstates.cpp.in \ - $(DIR)/initial_guesser.hpp.in \ $(DIR)/info.hpp.in \ $(DIR)/info.cpp.in \ $(DIR)/input_parameters.hpp.in \ $(DIR)/input_parameters.cpp.in \ - $(DIR)/low_scale_constraint.hpp.in \ - $(DIR)/librarylink.cpp.in \ - $(DIR)/librarylink.m.in \ - $(DIR)/model.hpp.in \ - $(DIR)/model_slha.hpp.in \ + $(DIR)/mass_eigenstates.hpp.in \ + $(DIR)/mass_eigenstates.cpp.in \ $(DIR)/observables.hpp.in \ $(DIR)/observables.cpp.in \ $(DIR)/physical.hpp.in \ $(DIR)/physical.cpp.in \ + $(DIR)/plot_rgflow.gnuplot.in \ + $(DIR)/plot_spectrum.gnuplot.in \ + $(DIR)/soft_beta_.cpp.in \ + $(DIR)/soft_parameters.hpp.in \ + $(DIR)/soft_parameters.cpp.in \ + $(DIR)/susy_beta_.cpp.in \ + $(DIR)/susy_parameters.hpp.in \ + $(DIR)/susy_parameters.cpp.in \ + $(DIR)/utilities.hpp.in \ + $(DIR)/utilities.cpp.in + +TWO_SCALE_TEMPLATES := \ + $(DIR)/convergence_tester.hpp.in \ + $(DIR)/high_scale_constraint.hpp.in \ + $(DIR)/high_scale_spectrum_generator.hpp.in \ + $(DIR)/initial_guesser.hpp.in \ + $(DIR)/librarylink.cpp.in \ + $(DIR)/librarylink.m.in \ + $(DIR)/low_scale_constraint.hpp.in \ + $(DIR)/low_scale_spectrum_generator.hpp.in \ + $(DIR)/model.hpp.in \ + $(DIR)/model_slha.hpp.in \ $(DIR)/run.cpp.in \ $(DIR)/run.m.in \ $(DIR)/run_cmd_line.cpp.in \ $(DIR)/scan.cpp.in \ $(DIR)/slha_io.hpp.in \ $(DIR)/slha_io.cpp.in \ - $(DIR)/susy_scale_constraint.hpp.in \ - $(DIR)/plot_rgflow.gnuplot.in \ - $(DIR)/plot_spectrum.gnuplot.in \ + $(DIR)/spectrum_generator_interface.hpp.in \ + $(DIR)/standard_model_high_scale_spectrum_generator.hpp.in \ + $(DIR)/standard_model_low_scale_spectrum_generator.hpp.in \ $(DIR)/standard_model_matching.hpp.in \ $(DIR)/standard_model_matching.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.hpp.in \ $(DIR)/standard_model_two_scale_low_scale_initial_guesser.cpp.in \ $(DIR)/standard_model_two_scale_low_scale_initial_guesser.hpp.in \ - $(DIR)/spectrum_generator_interface.hpp.in \ - $(DIR)/high_scale_spectrum_generator.hpp.in \ - $(DIR)/low_scale_spectrum_generator.hpp.in \ + $(DIR)/standard_model_two_scale_matching.hpp.in \ + $(DIR)/standard_model_two_scale_matching.cpp.in \ + $(DIR)/susy_scale_constraint.hpp.in \ $(DIR)/two_scale_convergence_tester.hpp.in \ $(DIR)/two_scale_convergence_tester.cpp.in \ $(DIR)/two_scale_high_scale_constraint.hpp.in \ @@ -52,24 +66,16 @@ TEMPLATES := \ $(DIR)/two_scale_low_scale_constraint.cpp.in \ $(DIR)/two_scale_low_scale_initial_guesser.hpp.in \ $(DIR)/two_scale_low_scale_initial_guesser.cpp.in \ - $(DIR)/standard_model_two_scale_matching.hpp.in \ - $(DIR)/standard_model_two_scale_matching.cpp.in \ - $(DIR)/standard_model_high_scale_spectrum_generator.hpp.in \ - $(DIR)/standard_model_low_scale_spectrum_generator.hpp.in \ $(DIR)/two_scale_model.hpp.in \ $(DIR)/two_scale_model.cpp.in \ $(DIR)/two_scale_model_slha.hpp.in \ $(DIR)/two_scale_model_slha.cpp.in \ - $(DIR)/soft_beta_.cpp.in \ - $(DIR)/soft_parameters.hpp.in \ - $(DIR)/soft_parameters.cpp.in \ - $(DIR)/susy_beta_.cpp.in \ - $(DIR)/susy_parameters.hpp.in \ - $(DIR)/susy_parameters.cpp.in \ $(DIR)/two_scale_susy_scale_constraint.hpp.in \ - $(DIR)/two_scale_susy_scale_constraint.cpp.in \ - $(DIR)/utilities.hpp.in \ - $(DIR)/utilities.cpp.in + $(DIR)/two_scale_susy_scale_constraint.cpp.in + +TEMPLATES := \ + $(BASE_TEMPLATES) \ + $(TWO_SCALE_TEMPLATES) .PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME) From ad5404673d426de5df935187bd51fb4c9b002f7a Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 3 Nov 2016 15:48:43 +1030 Subject: [PATCH 12/34] Add macros to configure indicating which solvers are enabled --- config/config.h.in | 6 ++++++ configure | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/config/config.h.in b/config/config.h.in index 61dca343b..570fa47f0 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -83,5 +83,11 @@ /* Enable header */ @DEFINE_ENABLE_RANDOM@ +/* Enable two-scale BVP solver */ +@DEFINE_ENABLE_TWO_SCALE_SOLVER@ + +/* Enable lattice BVP solver */ +@DEFINE_ENABLE_LATTICE_SOLVER@ + /* Enable statements for addons */ @DEFINE_ENABLE_ADDONS@ diff --git a/configure b/configure index 9988fda72..dee669f3c 100755 --- a/configure +++ b/configure @@ -151,6 +151,8 @@ DEFINE_ENABLE_SQLITE="#undef ENABLE_SQLITE" DEFINE_ENABLE_THREADS="#define ENABLE_THREADS 1" DEFINE_ENABLE_TSIL="#undef ENABLE_TSIL" DEFINE_ENABLE_VERBOSE="#undef ENABLE_VERBOSE" +DEFINE_ENABLE_TWO_SCALE_SOLVER="#undef ENABLE_TWO_SCALE_SOLVER" +DEFINE_ENABLE_LATTICE_SOLVER="#undef ENABLE_LATTICE_SOLVER" DEFINE_ENABLE_ADDONS="" boost_lib_dir="" @@ -2272,6 +2274,29 @@ enable_defines() { logmsg " ${DEFINE_ENABLE_TSIL}" fi + for s in ${SOLVERS}; do + case "$s" in + all) + DEFINE_ENABLE_TWO_SCALE_SOLVER="#define ENABLE_TWO_SCALE_SOLVER 1" + DEFINE_ENABLE_LATTICE_SOLVER="#define ENABLE_LATTICE_SOLVER 1" + logmsg " ${DEFINE_ENABLE_TWO_SCALE_SOLVER}" + logmsg " ${DEFINE_ENABLE_LATTICE_SOLVER}" + break ;; + two_scale) + DEFINE_ENABLE_TWO_SCALE_SOLVER="#define ENABLE_TWO_SCALE_SOLVER 1"; + logmsg " ${DEFINE_ENABLE_TWO_SCALE_SOLVER}" + continue ;; + lattice) + DEFINE_ENABLE_LATTICE_SOLVER="#define ENABLE_LATTICE_SOLVER 1"; + logmsg " ${DEFINE_ENABLE_LATTICE_SOLVER}" + continue ;; + *) + message "Error: unknown solver: $a"; + message "Available solvers: $available_solvers"; + exit 1 ;; + esac + done + for a in ${ADDONS}; do local addon_name="$(basename ${a})" DEFINE_ENABLE_ADDONS="${DEFINE_ENABLE_ADDONS}\n#define ENABLE_${addon_name} 1" @@ -2675,6 +2700,8 @@ sed -e "s|@FLEXIBLESUSY_VERSION@|$FLEXIBLESUSY_VERSION|" \ -e "s|@DEFINE_ENABLE_THREADS@|$DEFINE_ENABLE_THREADS|" \ -e "s|@DEFINE_ENABLE_TSIL@|$DEFINE_ENABLE_TSIL|" \ -e "s|@DEFINE_ENABLE_VERBOSE@|$DEFINE_ENABLE_VERBOSE|" \ + -e "s|@DEFINE_ENABLE_TWO_SCALE_SOLVER@|$DEFINE_ENABLE_TWO_SCALE_SOLVER|" \ + -e "s|@DEFINE_ENABLE_LATTICE_SOLVER@|$DEFINE_ENABLE_LATTICE_SOLVER|" \ -e "s|@DEFINE_ENABLE_ADDONS@|$DEFINE_ENABLE_ADDONS|" \ < $CONFIGHDR_TMPL > $CONFIGHDR From 0bc1df6d64f6fdcc3273fa39a4bfaabff68d4517 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 4 Nov 2016 16:47:41 +1030 Subject: [PATCH 13/34] Correct trailing continuations --- templates/module.mk.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/module.mk.in b/templates/module.mk.in index cdf485f56..ba406655e 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -39,7 +39,7 @@ LIB@CLASSNAME@_SRC := \ $(DIR)/@CLASSNAME@_physical.cpp \ $(DIR)/@CLASSNAME@_utilities.cpp \ $(DIR)/@CLASSNAME@_susy_parameters.cpp \ - $(DIR)/@CLASSNAME@_soft_parameters.cpp \ + $(DIR)/@CLASSNAME@_soft_parameters.cpp EXE@CLASSNAME@_SRC := LL@CLASSNAME@_LIB := @@ -57,7 +57,7 @@ LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_physical.hpp \ $(DIR)/@CLASSNAME@_utilities.hpp \ $(DIR)/@CLASSNAME@_soft_parameters.hpp \ - $(DIR)/@CLASSNAME@_susy_parameters.hpp \ + $(DIR)/@CLASSNAME@_susy_parameters.hpp ifneq ($(findstring two_scale,$(ALGORITHMS)),) -include $(DIR)/two_scale.mk From 923183507a4427a897fc9942dac45999d0ac7ccc Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Tue, 8 Nov 2016 08:46:18 +1030 Subject: [PATCH 14/34] Add functions to check if solver is present --- meta/FlexibleSUSY.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 154bd9fed..c92d0b973 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -250,6 +250,10 @@ FlexibleSUSY model file (FlexibleSUSY.m). allBVPSolvers = { TwoScaleSolver, LatticeSolver }; +HaveEWSBSolver[solver_] := MemberQ[FlexibleSUSY`FSEWSBSolvers, solver]; + +HaveBVPSolver[solver_] := MemberQ[FlexibleSUSY`FSBVPSolvers, solver]; + PrintHeadline[text_] := Block[{}, Print[""]; From 675677efa6894845fe60c1d2e2b352b6f51f29ce Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Tue, 8 Nov 2016 08:50:57 +1030 Subject: [PATCH 15/34] Generate two-scale specialisation for spectrum generator rather than a generic template. In general for other solvers the default template currently provided need not be applicable, so this is really already a specialisation. Also change the template parameter in the spectrum generator interface, so that it can be separated from the two-scale specific code. --- meta/FlexibleSUSY.m | 45 ++-- .../high_scale_spectrum_generator.cpp.in | 150 +++++++++++ .../high_scale_spectrum_generator.hpp.in | 145 ++--------- templates/librarylink.cpp.in | 2 +- templates/low_scale_spectrum_generator.cpp.in | 144 +++++++++++ templates/low_scale_spectrum_generator.hpp.in | 137 +---------- templates/module.mk | 7 +- templates/module.mk.in | 10 +- templates/run.cpp.in | 2 +- templates/run_cmd_line.cpp.in | 2 +- templates/scan.cpp.in | 2 +- templates/spectrum_generator.hpp.in | 31 +++ templates/spectrum_generator_interface.hpp.in | 30 +-- ...model_high_scale_spectrum_generator.cpp.in | 228 +++++++++++++++++ ...model_high_scale_spectrum_generator.hpp.in | 232 ++---------------- ..._model_low_scale_spectrum_generator.cpp.in | 220 +++++++++++++++++ ..._model_low_scale_spectrum_generator.hpp.in | 222 ++--------------- templates/two_scale.mk.in | 4 +- 18 files changed, 893 insertions(+), 720 deletions(-) create mode 100644 templates/high_scale_spectrum_generator.cpp.in create mode 100644 templates/low_scale_spectrum_generator.cpp.in create mode 100644 templates/spectrum_generator.hpp.in create mode 100644 templates/standard_model_high_scale_spectrum_generator.cpp.in create mode 100644 templates/standard_model_low_scale_spectrum_generator.cpp.in diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index c92d0b973..37b76e4db 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1945,7 +1945,7 @@ corresponding tadpole is real or imaginary (only in models with CP lesHouchesInputParameters, lesHouchesInputParameterReplacementRules, extraSLHAOutputBlocks, effectiveCouplings ={}, extraVertices = {}, vertexRules, vertexRuleFileName, effectiveCouplingsFileName, - Lat$massMatrices}, + Lat$massMatrices, spectrumGeneratorFiles, spectrumGeneratorInputFile}, (* check if SARAH`Start[] was called *) If[!ValueQ[Model`Name], Print["Error: Model`Name is not defined. Did you call SARAH`Start[\"Model\"]?"]; @@ -2648,24 +2648,35 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.cpp"}]}}]; Print["Creating user example spectrum generator program ..."]; - spectrumGeneratorInputFile = "high_scale_spectrum_generator.hpp.in"; - If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, - spectrumGeneratorInputFile = "low_scale_spectrum_generator.hpp.in";]; - If[FlexibleSUSY`FlexibleEFTHiggs === True, - spectrumGeneratorInputFile = "standard_model_" <> spectrumGeneratorInputFile; + spectrumGeneratorFiles = {}; + If[HaveBVPSolver[FlexibleSUSY`TwoScaleSolver], + spectrumGeneratorInputFile = "high_scale_spectrum_generator"; + If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, + spectrumGeneratorInputFile = "low_scale_spectrum_generator";]; + If[FlexibleSUSY`FlexibleEFTHiggs === True, + spectrumGeneratorInputFile = "standard_model_" <> spectrumGeneratorInputFile; + ]; + spectrumGeneratorFiles = Join[spectrumGeneratorFiles, + {{FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_spectrum_generator.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_spectrum_generator.cpp"}]} + }]; ]; + WriteUserExample[inputParameters, - {{FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator_interface.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator_interface.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "run.cpp.in"}], - FileNameJoin[{FSOutputDir, "run_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "run_cmd_line.cpp.in"}], - FileNameJoin[{FSOutputDir, "run_cmd_line_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "scan.cpp.in"}], - FileNameJoin[{FSOutputDir, "scan_" <> FlexibleSUSY`FSModelName <> ".cpp"}]} - }]; + Join[{{FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator_interface.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator_interface.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "run.cpp.in"}], + FileNameJoin[{FSOutputDir, "run_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "run_cmd_line.cpp.in"}], + FileNameJoin[{FSOutputDir, "run_cmd_line_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "scan.cpp.in"}], + FileNameJoin[{FSOutputDir, "scan_" <> FlexibleSUSY`FSModelName <> ".cpp"}]} + }, spectrumGeneratorFiles] + ]; Print["Creating LibraryLink ", FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> ".mx"}], " ..."]; WriteMathLink[inputParameters, extraSLHAOutputBlocks, diff --git a/templates/high_scale_spectrum_generator.cpp.in b/templates/high_scale_spectrum_generator.cpp.in new file mode 100644 index 000000000..fbe49d97a --- /dev/null +++ b/templates/high_scale_spectrum_generator.cpp.in @@ -0,0 +1,150 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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 3 of the License, +// or (at your option) any later version. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +// File generated at @DateAndTime@ + +#include "@ModelName@_two_scale_spectrum_generator.hpp" +#include "@ModelName@_two_scale_convergence_tester.hpp" +#include "@ModelName@_two_scale_initial_guesser.hpp" + +#include "error.hpp" +#include "numerics2.hpp" +#include "two_scale_running_precision.hpp" +#include "two_scale_solver.hpp" + +#include + +namespace flexiblesusy { + +/** + * @brief Run's the RG solver with the given input parameters + * + * This function sets up the RG solver using a high-scale, susy-scale + * and low-scale constraint. Afterwards the solver is run until + * convergence is reached or an error occours. Finally the particle + * spectrum (pole masses) is calculated. + * + * @param qedqcd Standard Model input parameters + * @param input model input parameters + */ +void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, + const @ModelName@_input_parameters& input) +{ + @ModelName@& model = this->model; + model.clear(); + model.set_input_parameters(input); + model.do_calculate_sm_pole_masses( + settings.get(Spectrum_generator_settings::calculate_sm_masses)); + model.do_calculate_bsm_pole_masses( + settings.get(Spectrum_generator_settings::calculate_bsm_masses)); + model.do_force_output( + settings.get(Spectrum_generator_settings::force_output)); + model.set_loops(settings.get(Spectrum_generator_settings::beta_loop_order)); + model.set_thresholds( + settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); + model.set_zero_threshold( + settings.get(Spectrum_generator_settings::beta_zero_threshold)); + + high_scale_constraint.clear(); + susy_scale_constraint.clear(); + low_scale_constraint .clear(); + + // needed for constraint::initialize() + high_scale_constraint.set_model(&model); + susy_scale_constraint.set_model(&model); + low_scale_constraint .set_model(&model); + + susy_scale_constraint.set_sm_parameters(qedqcd); + low_scale_constraint .set_sm_parameters(qedqcd); + + high_scale_constraint.initialize(); + susy_scale_constraint.initialize(); + low_scale_constraint .initialize(); + + @ModelName@_convergence_tester convergence_tester( + &model, settings.get(Spectrum_generator_settings::precision)); + if (settings.get(Spectrum_generator_settings::max_iterations) > 0) + convergence_tester.set_max_iterations( + settings.get(Spectrum_generator_settings::max_iterations)); + + @ModelName@_initial_guesser initial_guesser(&model, qedqcd, + low_scale_constraint, + susy_scale_constraint, + high_scale_constraint); + + Two_scale_increasing_precision precision( + 10.0, settings.get(Spectrum_generator_settings::precision)); + + RGFlow solver; + solver.set_convergence_tester(&convergence_tester); + solver.set_running_precision(&precision); + solver.set_initial_guesser(&initial_guesser); + solver.add(&low_scale_constraint, &model); + solver.add(&high_scale_constraint, &model); + solver.add(&susy_scale_constraint, &model); + + high_scale = susy_scale = low_scale = 0.; + reached_precision = std::numeric_limits::infinity(); + + try { + solver.solve(); + + // impose low-scale constraint one last time + model.run_to(low_scale_constraint.get_scale()); + low_scale_constraint.apply(); + + high_scale = high_scale_constraint.get_scale(); + susy_scale = susy_scale_constraint.get_scale(); + low_scale = low_scale_constraint.get_scale(); + reached_precision = convergence_tester.get_current_accuracy(); + + const double mass_scale = + settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? + settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; + + model.run_to(mass_scale); + model.solve_ewsb(); + model.calculate_spectrum(); + + // copy calculated W pole mass + model.get_physical().M@VectorW@ + = low_scale_constraint.get_sm_parameters().displayPoleMW(); + + // run to output scale (if scale > 0) + if (!is_zero(parameter_output_scale)) { + model.run_to(parameter_output_scale); + } + } catch (...) { + translate_exception_to_problem(model); + } +} + +/** + * Create a text file which contains the values of all model + * parameters at all scales between the low-scale and the high-scale. + * + * @param filename name of output file + */ +void @ModelName@_spectrum_generator::write_running_couplings( + const std::string& filename) const +{ + @ModelName@_spectrum_generator_interface<@ModelName@ >::write_running_couplings( + filename, low_scale, high_scale); +} + +} // namespace flexiblesusy diff --git a/templates/high_scale_spectrum_generator.hpp.in b/templates/high_scale_spectrum_generator.hpp.in index 1ba60e864..c4926ec14 100644 --- a/templates/high_scale_spectrum_generator.hpp.in +++ b/templates/high_scale_spectrum_generator.hpp.in @@ -18,34 +18,29 @@ // File generated at @DateAndTime@ -#ifndef @ModelName@_SPECTRUM_GENERATOR_H -#define @ModelName@_SPECTRUM_GENERATOR_H +#ifndef @ModelName@_TWO_SCALE_SPECTRUM_GENERATOR_H +#define @ModelName@_TWO_SCALE_SPECTRUM_GENERATOR_H +#include "@ModelName@_input_parameters.hpp" #include "@ModelName@_spectrum_generator_interface.hpp" +#include "@ModelName@_spectrum_generator.hpp" #include "@ModelName@_two_scale_high_scale_constraint.hpp" #include "@ModelName@_two_scale_susy_scale_constraint.hpp" #include "@ModelName@_two_scale_low_scale_constraint.hpp" -#include "@ModelName@_two_scale_convergence_tester.hpp" -#include "@ModelName@_two_scale_initial_guesser.hpp" -#include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_info.hpp" +#include "@ModelName@_two_scale_model.hpp" #include "lowe.h" -#include "error.hpp" -#include "numerics2.hpp" -#include "two_scale_running_precision.hpp" -#include "two_scale_solver.hpp" - -#include namespace flexiblesusy { -template -class @ModelName@_spectrum_generator - : public @ModelName@_spectrum_generator_interface { +class Two_scale; + +template <> +class @ModelName@_spectrum_generator + : public @ModelName@_spectrum_generator_interface<@ModelName@ > { public: @ModelName@_spectrum_generator() - : @ModelName@_spectrum_generator_interface() + : @ModelName@_spectrum_generator_interface<@ModelName@ >() , high_scale_constraint() , susy_scale_constraint() , low_scale_constraint() @@ -63,124 +58,12 @@ public: void write_running_couplings(const std::string& filename = "@ModelName@_rgflow.dat") const; private: - @ModelName@_high_scale_constraint high_scale_constraint; - @ModelName@_susy_scale_constraint susy_scale_constraint; - @ModelName@_low_scale_constraint low_scale_constraint; + @ModelName@_high_scale_constraint high_scale_constraint; + @ModelName@_susy_scale_constraint susy_scale_constraint; + @ModelName@_low_scale_constraint low_scale_constraint; double high_scale, susy_scale, low_scale; }; -/** - * @brief Run's the RG solver with the given input parameters - * - * This function sets up the RG solver using a high-scale, susy-scale - * and low-scale constraint. Afterwards the solver is run until - * convergence is reached or an error occours. Finally the particle - * spectrum (pole masses) is calculated. - * - * @param qedqcd Standard Model input parameters - * @param input model input parameters - */ -template -void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, - const @ModelName@_input_parameters& input) -{ - @ModelName@& model = this->model; - model.clear(); - model.set_input_parameters(input); - model.do_calculate_sm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_sm_masses)); - model.do_calculate_bsm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_bsm_masses)); - model.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); - model.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); - model.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); - model.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); - - high_scale_constraint.clear(); - susy_scale_constraint.clear(); - low_scale_constraint .clear(); - - // needed for constraint::initialize() - high_scale_constraint.set_model(&model); - susy_scale_constraint.set_model(&model); - low_scale_constraint .set_model(&model); - - susy_scale_constraint.set_sm_parameters(qedqcd); - low_scale_constraint .set_sm_parameters(qedqcd); - - high_scale_constraint.initialize(); - susy_scale_constraint.initialize(); - low_scale_constraint .initialize(); - - @ModelName@_convergence_tester convergence_tester( - &model, this->settings.get(Spectrum_generator_settings::precision)); - if (this->settings.get(Spectrum_generator_settings::max_iterations) > 0) - convergence_tester.set_max_iterations( - this->settings.get(Spectrum_generator_settings::max_iterations)); - - @ModelName@_initial_guesser initial_guesser(&model, qedqcd, - low_scale_constraint, - susy_scale_constraint, - high_scale_constraint); - - Two_scale_increasing_precision precision( - 10.0, this->settings.get(Spectrum_generator_settings::precision)); - - RGFlow solver; - solver.set_convergence_tester(&convergence_tester); - solver.set_running_precision(&precision); - solver.set_initial_guesser(&initial_guesser); - solver.add(&low_scale_constraint, &model); - solver.add(&high_scale_constraint, &model); - solver.add(&susy_scale_constraint, &model); - - high_scale = susy_scale = low_scale = 0.; - this->reached_precision = std::numeric_limits::infinity(); - - try { - solver.solve(); - - // impose low-scale constraint one last time - model.run_to(low_scale_constraint.get_scale()); - low_scale_constraint.apply(); - - high_scale = high_scale_constraint.get_scale(); - susy_scale = susy_scale_constraint.get_scale(); - low_scale = low_scale_constraint.get_scale(); - this->reached_precision = convergence_tester.get_current_accuracy(); - - const double mass_scale = - this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? - this->settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; - - model.run_to(mass_scale); - model.solve_ewsb(); - model.calculate_spectrum(); - - // copy calculated W pole mass - model.get_physical().M@VectorW@ - = low_scale_constraint.get_sm_parameters().displayPoleMW(); - - // run to output scale (if scale > 0) - if (!is_zero(this->parameter_output_scale)) { - model.run_to(this->parameter_output_scale); - } - } catch (...) { - this->translate_exception_to_problem(model); - } -} - -/** - * Create a text file which contains the values of all model - * parameters at all scales between the low-scale and the high-scale. - * - * @param filename name of output file - */ -template -void @ModelName@_spectrum_generator::write_running_couplings( - const std::string& filename) const -{ - @ModelName@_spectrum_generator_interface::write_running_couplings(filename, low_scale, high_scale); -} - } // namespace flexiblesusy #endif diff --git a/templates/librarylink.cpp.in b/templates/librarylink.cpp.in index 6b7b07024..465f742ed 100644 --- a/templates/librarylink.cpp.in +++ b/templates/librarylink.cpp.in @@ -22,7 +22,7 @@ #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_physical.hpp" -#include "@ModelName@_spectrum_generator.hpp" +#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_two_scale_model.hpp" #include "@ModelName@_two_scale_model_slha.hpp" diff --git a/templates/low_scale_spectrum_generator.cpp.in b/templates/low_scale_spectrum_generator.cpp.in new file mode 100644 index 000000000..4879fcb4d --- /dev/null +++ b/templates/low_scale_spectrum_generator.cpp.in @@ -0,0 +1,144 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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 3 of the License, +// or (at your option) any later version. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +// File generated at @DateAndTime@ + +#include "@ModelName@_two_scale_spectrum_generator.hpp" +#include "@ModelName@_two_scale_convergence_tester.hpp" +#include "@ModelName@_two_scale_initial_guesser.hpp" + +#include "error.hpp" +#include "numerics2.hpp" +#include "two_scale_running_precision.hpp" +#include "two_scale_solver.hpp" + +#include + +namespace flexiblesusy { + +/** + * @brief Run's the RG solver with the given input parameters + * + * This function sets up the RG solver using a susy-scale + * and low-scale constraint. Afterwards the solver is run until + * convergence is reached or an error occours. Finally the particle + * spectrum (pole masses) is calculated. + * + * @param qedqcd Standard Model input parameters + * @param input model input parameters + */ +void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, + const @ModelName@_input_parameters& input) +{ + @ModelName@& model = this->model; + model.clear(); + model.set_input_parameters(input); + model.do_calculate_sm_pole_masses( + settings.get(Spectrum_generator_settings::calculate_sm_masses)); + model.do_calculate_bsm_pole_masses( + settings.get(Spectrum_generator_settings::calculate_bsm_masses)); + model.do_force_output( + settings.get(Spectrum_generator_settings::force_output)); + model.set_loops(settings.get(Spectrum_generator_settings::beta_loop_order)); + model.set_thresholds( + settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); + model.set_zero_threshold( + settings.get(Spectrum_generator_settings::beta_zero_threshold)); + + susy_scale_constraint.clear(); + low_scale_constraint .clear(); + + // needed for constraint::initialize() + susy_scale_constraint.set_model(&model); + low_scale_constraint .set_model(&model); + + susy_scale_constraint.set_sm_parameters(qedqcd); + low_scale_constraint .set_sm_parameters(qedqcd); + + susy_scale_constraint.initialize(); + low_scale_constraint .initialize(); + + @ModelName@_convergence_tester convergence_tester( + &model, settings.get(Spectrum_generator_settings::precision)); + if (settings.get(Spectrum_generator_settings::max_iterations) > 0) + convergence_tester.set_max_iterations( + settings.get(Spectrum_generator_settings::max_iterations)); + + @ModelName@_initial_guesser initial_guesser(&model, qedqcd, + low_scale_constraint, + susy_scale_constraint); + Two_scale_increasing_precision precision( + 10.0, settings.get(Spectrum_generator_settings::precision)); + + RGFlow solver; + solver.reset(); + solver.set_convergence_tester(&convergence_tester); + solver.set_running_precision(&precision); + solver.set_initial_guesser(&initial_guesser); + solver.add(&low_scale_constraint, &model); + solver.add(&susy_scale_constraint, &model); + + susy_scale = low_scale = 0.; + reached_precision = std::numeric_limits::infinity(); + + try { + solver.solve(); + + // impose low-scale constraint one last time + model.run_to(low_scale_constraint.get_scale()); + low_scale_constraint.apply(); + + susy_scale = susy_scale_constraint.get_scale(); + low_scale = low_scale_constraint.get_scale(); + reached_precision = convergence_tester.get_current_accuracy(); + + const double mass_scale = + settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? + settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; + + model.run_to(mass_scale); + model.solve_ewsb(); + model.calculate_spectrum(); + + // copy calculated W pole mass + model.get_physical().M@VectorW@ + = low_scale_constraint.get_sm_parameters().displayPoleMW(); + + // run to output scale (if scale > 0) + if (!is_zero(parameter_output_scale)) { + model.run_to(parameter_output_scale); + } + } catch (...) { + translate_exception_to_problem(model); + } +} + +/** + * Create a text file which contains the values of all model + * parameters at all scales between the low-scale and the high-scale. + * + * @param filename name of output file + */ +void @ModelName@_spectrum_generator::write_running_couplings( + const std::string& filename) const +{ + @ModelName@_spectrum_generator_interface<@ModelName@ >::write_running_couplings( + filename, low_scale, susy_scale); +} + +} // namespace flexiblesusy diff --git a/templates/low_scale_spectrum_generator.hpp.in b/templates/low_scale_spectrum_generator.hpp.in index 015492d50..1e9378df4 100644 --- a/templates/low_scale_spectrum_generator.hpp.in +++ b/templates/low_scale_spectrum_generator.hpp.in @@ -18,33 +18,28 @@ // File generated at @DateAndTime@ -#ifndef @ModelName@_SPECTRUM_GENERATOR_H -#define @ModelName@_SPECTRUM_GENERATOR_H +#ifndef @ModelName@_TWO_SCALE_SPECTRUM_GENERATOR_H +#define @ModelName@_TWO_SCALE_SPECTRUM_GENERATOR_H +#include "@ModelName@_input_parameters.hpp" #include "@ModelName@_spectrum_generator_interface.hpp" +#include "@ModelName@_spectrum_generator.hpp" #include "@ModelName@_two_scale_susy_scale_constraint.hpp" #include "@ModelName@_two_scale_low_scale_constraint.hpp" -#include "@ModelName@_two_scale_convergence_tester.hpp" -#include "@ModelName@_two_scale_initial_guesser.hpp" -#include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_info.hpp" +#include "@ModelName@_two_scale_model.hpp" #include "lowe.h" -#include "error.hpp" -#include "numerics2.hpp" -#include "two_scale_running_precision.hpp" -#include "two_scale_solver.hpp" - -#include namespace flexiblesusy { -template -class @ModelName@_spectrum_generator - : public @ModelName@_spectrum_generator_interface { +class Two_scale; + +template <> +class @ModelName@_spectrum_generator + : public @ModelName@_spectrum_generator_interface<@ModelName@ > { public: @ModelName@_spectrum_generator() - : @ModelName@_spectrum_generator_interface() + : @ModelName@_spectrum_generator_interface<@ModelName@ >() , susy_scale_constraint() , low_scale_constraint() , susy_scale(0.) @@ -60,117 +55,11 @@ public: void write_running_couplings(const std::string& filename = "@ModelName@_rgflow.dat") const; private: - @ModelName@_susy_scale_constraint susy_scale_constraint; - @ModelName@_low_scale_constraint low_scale_constraint; + @ModelName@_susy_scale_constraint susy_scale_constraint; + @ModelName@_low_scale_constraint low_scale_constraint; double susy_scale, low_scale; }; -/** - * @brief Run's the RG solver with the given input parameters - * - * This function sets up the RG solver using a susy-scale - * and low-scale constraint. Afterwards the solver is run until - * convergence is reached or an error occours. Finally the particle - * spectrum (pole masses) is calculated. - * - * @param qedqcd Standard Model input parameters - * @param input model input parameters - */ -template -void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, - const @ModelName@_input_parameters& input) -{ - @ModelName@& model = this->model; - model.clear(); - model.set_input_parameters(input); - model.do_calculate_sm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_sm_masses)); - model.do_calculate_bsm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_bsm_masses)); - model.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); - model.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); - model.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); - model.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); - - susy_scale_constraint.clear(); - low_scale_constraint .clear(); - - // needed for constraint::initialize() - susy_scale_constraint.set_model(&model); - low_scale_constraint .set_model(&model); - - susy_scale_constraint.set_sm_parameters(qedqcd); - low_scale_constraint .set_sm_parameters(qedqcd); - - susy_scale_constraint.initialize(); - low_scale_constraint .initialize(); - - @ModelName@_convergence_tester convergence_tester( - &model, this->settings.get(Spectrum_generator_settings::precision)); - if (this->settings.get(Spectrum_generator_settings::max_iterations) > 0) - convergence_tester.set_max_iterations( - this->settings.get(Spectrum_generator_settings::max_iterations)); - - @ModelName@_initial_guesser initial_guesser(&model, qedqcd, - low_scale_constraint, - susy_scale_constraint); - Two_scale_increasing_precision precision( - 10.0, this->settings.get(Spectrum_generator_settings::precision)); - - RGFlow solver; - solver.reset(); - solver.set_convergence_tester(&convergence_tester); - solver.set_running_precision(&precision); - solver.set_initial_guesser(&initial_guesser); - solver.add(&low_scale_constraint, &model); - solver.add(&susy_scale_constraint, &model); - - susy_scale = low_scale = 0.; - this->reached_precision = std::numeric_limits::infinity(); - - try { - solver.solve(); - - // impose low-scale constraint one last time - model.run_to(low_scale_constraint.get_scale()); - low_scale_constraint.apply(); - - susy_scale = susy_scale_constraint.get_scale(); - low_scale = low_scale_constraint.get_scale(); - this->reached_precision = convergence_tester.get_current_accuracy(); - - const double mass_scale = - this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? - this->settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; - - model.run_to(mass_scale); - model.solve_ewsb(); - model.calculate_spectrum(); - - // copy calculated W pole mass - model.get_physical().M@VectorW@ - = low_scale_constraint.get_sm_parameters().displayPoleMW(); - - // run to output scale (if scale > 0) - if (!is_zero(this->parameter_output_scale)) { - model.run_to(this->parameter_output_scale); - } - } catch (...) { - this->translate_exception_to_problem(model); - } -} - -/** - * Create a text file which contains the values of all model - * parameters at all scales between the low-scale and the high-scale. - * - * @param filename name of output file - */ -template -void @ModelName@_spectrum_generator::write_running_couplings( - const std::string& filename) const -{ - @ModelName@_spectrum_generator_interface::write_running_couplings(filename, low_scale, susy_scale); -} - } // namespace flexiblesusy #endif diff --git a/templates/module.mk b/templates/module.mk index fccf510be..dcf0ef46d 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -21,6 +21,8 @@ BASE_TEMPLATES := \ $(DIR)/soft_beta_.cpp.in \ $(DIR)/soft_parameters.hpp.in \ $(DIR)/soft_parameters.cpp.in \ + $(DIR)/spectrum_generator.hpp.in \ + $(DIR)/spectrum_generator_interface.hpp.in \ $(DIR)/susy_beta_.cpp.in \ $(DIR)/susy_parameters.hpp.in \ $(DIR)/susy_parameters.cpp.in \ @@ -31,11 +33,13 @@ TWO_SCALE_TEMPLATES := \ $(DIR)/convergence_tester.hpp.in \ $(DIR)/high_scale_constraint.hpp.in \ $(DIR)/high_scale_spectrum_generator.hpp.in \ + $(DIR)/high_scale_spectrum_generator.cpp.in \ $(DIR)/initial_guesser.hpp.in \ $(DIR)/librarylink.cpp.in \ $(DIR)/librarylink.m.in \ $(DIR)/low_scale_constraint.hpp.in \ $(DIR)/low_scale_spectrum_generator.hpp.in \ + $(DIR)/low_scale_spectrum_generator.cpp.in \ $(DIR)/model.hpp.in \ $(DIR)/model_slha.hpp.in \ $(DIR)/run.cpp.in \ @@ -44,9 +48,10 @@ TWO_SCALE_TEMPLATES := \ $(DIR)/scan.cpp.in \ $(DIR)/slha_io.hpp.in \ $(DIR)/slha_io.cpp.in \ - $(DIR)/spectrum_generator_interface.hpp.in \ $(DIR)/standard_model_high_scale_spectrum_generator.hpp.in \ + $(DIR)/standard_model_high_scale_spectrum_generator.cpp.in \ $(DIR)/standard_model_low_scale_spectrum_generator.hpp.in \ + $(DIR)/standard_model_low_scale_spectrum_generator.cpp.in \ $(DIR)/standard_model_matching.hpp.in \ $(DIR)/standard_model_matching.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.cpp.in \ diff --git a/templates/module.mk.in b/templates/module.mk.in index ba406655e..a95ab6569 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -37,9 +37,9 @@ LIB@CLASSNAME@_SRC := \ $(DIR)/@CLASSNAME@_mass_eigenstates.cpp \ $(DIR)/@CLASSNAME@_observables.cpp \ $(DIR)/@CLASSNAME@_physical.cpp \ - $(DIR)/@CLASSNAME@_utilities.cpp \ $(DIR)/@CLASSNAME@_susy_parameters.cpp \ - $(DIR)/@CLASSNAME@_soft_parameters.cpp + $(DIR)/@CLASSNAME@_soft_parameters.cpp \ + $(DIR)/@CLASSNAME@_utilities.cpp EXE@CLASSNAME@_SRC := LL@CLASSNAME@_LIB := @@ -55,9 +55,11 @@ LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_mass_eigenstates.hpp \ $(DIR)/@CLASSNAME@_observables.hpp \ $(DIR)/@CLASSNAME@_physical.hpp \ - $(DIR)/@CLASSNAME@_utilities.hpp \ + $(DIR)/@CLASSNAME@_spectrum_generator.hpp \ + $(DIR)/@CLASSNAME@_spectrum_generator_interface.hpp \ $(DIR)/@CLASSNAME@_soft_parameters.hpp \ - $(DIR)/@CLASSNAME@_susy_parameters.hpp + $(DIR)/@CLASSNAME@_susy_parameters.hpp \ + $(DIR)/@CLASSNAME@_utilities.hpp ifneq ($(findstring two_scale,$(ALGORITHMS)),) -include $(DIR)/two_scale.mk diff --git a/templates/run.cpp.in b/templates/run.cpp.in index ea6dd6c32..ad6841538 100644 --- a/templates/run.cpp.in +++ b/templates/run.cpp.in @@ -21,7 +21,7 @@ #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_slha_io.hpp" -#include "@ModelName@_spectrum_generator.hpp" +#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_utilities.hpp" #include "physical_input.hpp" diff --git a/templates/run_cmd_line.cpp.in b/templates/run_cmd_line.cpp.in index 6125afde0..2a949f1c4 100644 --- a/templates/run_cmd_line.cpp.in +++ b/templates/run_cmd_line.cpp.in @@ -19,7 +19,7 @@ // File generated at @DateAndTime@ #include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_spectrum_generator.hpp" +#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_slha_io.hpp" diff --git a/templates/scan.cpp.in b/templates/scan.cpp.in index 125da1e27..01fb20e69 100644 --- a/templates/scan.cpp.in +++ b/templates/scan.cpp.in @@ -19,7 +19,7 @@ // File generated at @DateAndTime@ #include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_spectrum_generator.hpp" +#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_two_scale_model_slha.hpp" #include "command_line_options.hpp" diff --git a/templates/spectrum_generator.hpp.in b/templates/spectrum_generator.hpp.in new file mode 100644 index 000000000..7c225f54e --- /dev/null +++ b/templates/spectrum_generator.hpp.in @@ -0,0 +1,31 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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 3 of the License, +// or (at your option) any later version. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +// File generated at @DateAndTime@ + +#ifndef @ModelName@_SPECTRUM_GENERATOR_H +#define @ModelName@_SPECTRUM_GENERATOR_H + +namespace flexiblesusy { + +template +class @ModelName@_spectrum_generator; + +} // namespace flexiblesusy + +#endif diff --git a/templates/spectrum_generator_interface.hpp.in b/templates/spectrum_generator_interface.hpp.in index 9f2ea3e04..6669a561d 100644 --- a/templates/spectrum_generator_interface.hpp.in +++ b/templates/spectrum_generator_interface.hpp.in @@ -21,7 +21,6 @@ #ifndef @ModelName@_SPECTRUM_GENERATOR_INTERFACE_H #define @ModelName@_SPECTRUM_GENERATOR_INTERFACE_H -#include "@ModelName@_two_scale_model.hpp" #include "@ModelName@_utilities.hpp" #include "spectrum_generator_settings.hpp" @@ -30,6 +29,8 @@ #include "error.hpp" #include "logger.hpp" +#include + namespace softsusy { class QedQcd; } @@ -38,7 +39,7 @@ namespace flexiblesusy { struct @ModelName@_input_parameters; -template +template class @ModelName@_spectrum_generator_interface { public: @ModelName@_spectrum_generator_interface() @@ -49,8 +50,8 @@ public: {} virtual ~@ModelName@_spectrum_generator_interface() {} - const @ModelName@& get_model() const { return model; } - @ModelName@& get_model() { return model; } + const Model& get_model() const { return model; } + Model& get_model() { return model; } const Problems<@ModelName@_info::NUMBER_OF_PARTICLES, @ModelName@_info::NUMBER_OF_PARAMETERS>& get_problems() const { return model.get_problems(); } @@ -101,12 +102,12 @@ public: void write_spectrum(const std::string& filename = "@ModelName@_spectrum.dat") const; protected: - @ModelName@ model; + Model model; Spectrum_generator_settings settings; double parameter_output_scale; ///< output scale for running parameters double reached_precision; ///< the precision that was reached - void translate_exception_to_problem(@ModelName@& model); + void translate_exception_to_problem(Model& model); }; /** @@ -114,8 +115,8 @@ protected: * * @param settings_ spectrum generator settings */ -template -void @ModelName@_spectrum_generator_interface::set_settings( +template +void @ModelName@_spectrum_generator_interface::set_settings( const Spectrum_generator_settings& settings_) { settings = settings_; @@ -132,8 +133,8 @@ void @ModelName@_spectrum_generator_interface::set_settings( * @param start lowest scale * @param stop highest scale */ -template -void @ModelName@_spectrum_generator_interface::write_running_couplings( +template +void @ModelName@_spectrum_generator_interface::write_running_couplings( const std::string& filename, double start, double stop) const { @@ -159,8 +160,9 @@ void @ModelName@_spectrum_generator_interface::write_running_couplings( * * @param filename output file name */ -template -void @ModelName@_spectrum_generator_interface::write_spectrum(const std::string& filename) const +template +void @ModelName@_spectrum_generator_interface::write_spectrum( + const std::string& filename) const { @ModelName@_spectrum_plotter plotter; plotter.extract_spectrum(model); @@ -175,8 +177,8 @@ void @ModelName@_spectrum_generator_interface::write_spectrum(const std::stri * * @param model model class */ -template -void @ModelName@_spectrum_generator_interface::translate_exception_to_problem(@ModelName@& model) +template +void @ModelName@_spectrum_generator_interface::translate_exception_to_problem(Model& model) { try { throw; diff --git a/templates/standard_model_high_scale_spectrum_generator.cpp.in b/templates/standard_model_high_scale_spectrum_generator.cpp.in new file mode 100644 index 000000000..f72369318 --- /dev/null +++ b/templates/standard_model_high_scale_spectrum_generator.cpp.in @@ -0,0 +1,228 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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 3 of the License, +// or (at your option) any later version. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +// File generated at @DateAndTime@ + +#include "@ModelName@_two_scale_spectrum_generator.hpp" +#include "@ModelName@_two_scale_convergence_tester.hpp" +#include "@ModelName@_two_scale_initial_guesser.hpp" +#include "standard_model_two_scale_convergence_tester.hpp" +#include "two_scale_composite_convergence_tester.hpp" + +#include "error.hpp" +#include "numerics2.hpp" +#include "two_scale_running_precision.hpp" + +#include +#include + +namespace flexiblesusy { + +/** + * @brief Run's the RG solver with the given input parameters + * + * This function sets up the RG solver using a high-scale, susy-scale + * and low-scale constraint. Afterwards the solver is run until + * convergence is reached or an error occours. Finally the particle + * spectrum (pole masses) is calculated. + * + * @param qedqcd Standard Model input parameters + * @param input model input parameters + */ +void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, + const @ModelName@_input_parameters& input) +{ + @ModelName@& model = this->model; + model.clear(); + model.set_input_parameters(input); + model.do_calculate_sm_pole_masses(settings.get(Spectrum_generator_settings::calculate_sm_masses)); + model.do_calculate_bsm_pole_masses(settings.get(Spectrum_generator_settings::calculate_bsm_masses)); + model.do_force_output(settings.get(Spectrum_generator_settings::force_output)); + model.set_loops(settings.get(Spectrum_generator_settings::beta_loop_order)); + model.set_thresholds(settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); + model.set_zero_threshold(settings.get(Spectrum_generator_settings::beta_zero_threshold)); + + eft.clear(); + eft.do_force_output(settings.get(Spectrum_generator_settings::force_output)); + eft.set_loops(settings.get(Spectrum_generator_settings::beta_loop_order)); + eft.set_thresholds(settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); + eft.set_zero_threshold(settings.get(Spectrum_generator_settings::beta_zero_threshold)); + eft.set_pole_mass_loop_order(this->model.get_pole_mass_loop_order()); + eft.set_ewsb_loop_order(this->model.get_ewsb_loop_order()); + eft.set_ewsb_iteration_precision(this->model.get_ewsb_iteration_precision()); + eft.set_number_of_ewsb_iterations(this->model.get_number_of_ewsb_iterations()); + eft.set_number_of_mass_iterations(this->model.get_number_of_mass_iterations()); + eft.set_two_loop_corrections(this->model.get_two_loop_corrections()); + + high_scale_constraint.clear(); + susy_scale_constraint.clear(); + low_scale_constraint .clear(); + + // needed for constraint::initialize() + high_scale_constraint.set_model(&model); + susy_scale_constraint.set_model(&model); + low_scale_constraint .set_model(&eft); + + low_scale_constraint .set_sm_parameters(qedqcd); + + const unsigned index = settings.get(Spectrum_generator_settings::eft_higgs_index); + + matching_up.set_models(&eft, &model); + matching_up.set_constraint(&susy_scale_constraint); + matching_up.set_scale(settings.get(Spectrum_generator_settings::eft_matching_scale)); + matching_up.set_loop_order(settings.get(Spectrum_generator_settings::eft_matching_loop_order_up)); + matching_up.set_higgs_index(index); + + matching_down.set_models(&model, &eft); + matching_down.set_constraint(&susy_scale_constraint); + matching_down.set_scale(settings.get(Spectrum_generator_settings::eft_matching_scale)); + matching_down.set_loop_order(settings.get(Spectrum_generator_settings::eft_matching_loop_order_down)); + matching_down.set_higgs_index(index); + + high_scale_constraint.initialize(); + susy_scale_constraint.initialize(); + low_scale_constraint .initialize(); + + // convergence tester for @ModelName@ + @ModelName@_convergence_tester model_ct( + &model, settings.get(Spectrum_generator_settings::precision)); + + // convergence tester for Standard Model + standard_model::Standard_model_convergence_tester eft_ct( + &eft, settings.get(Spectrum_generator_settings::precision)); + + if (settings.get(Spectrum_generator_settings::max_iterations) > 0) { + model_ct.set_max_iterations( + settings.get(Spectrum_generator_settings::max_iterations)); + eft_ct.set_max_iterations( + settings.get(Spectrum_generator_settings::max_iterations)); + } + + Composite_convergence_tester cct; + cct.add_convergence_tester(&model_ct); + cct.add_convergence_tester(&eft_ct); + + @ModelName@_standard_model_initial_guesser initial_guesser(&model, &eft, qedqcd, + low_scale_constraint, + susy_scale_constraint, + high_scale_constraint); + + Two_scale_increasing_precision precision( + 10.0, settings.get(Spectrum_generator_settings::precision)); + + solver.reset(); + solver.set_convergence_tester(&cct); + solver.set_running_precision(&precision); + solver.set_initial_guesser(&initial_guesser); + solver.add(&low_scale_constraint, &eft); + solver.add(&matching_up, &eft, &model); + solver.add(&susy_scale_constraint, &model); + solver.add(&high_scale_constraint, &model); + solver.add(&susy_scale_constraint, &model); + solver.add(&matching_down, &model, &eft); + + high_scale = susy_scale = low_scale = 0.; + reached_precision = std::numeric_limits::infinity(); + + try { + solver.solve(); + + // impose low-scale constraint one last time + eft.run_to(low_scale_constraint.get_scale()); + low_scale_constraint.apply(); + + high_scale = high_scale_constraint.get_scale(); + susy_scale = susy_scale_constraint.get_scale(); + low_scale = low_scale_constraint.get_scale(); + reached_precision = std::max(model_ct.get_current_accuracy(), + eft_ct.get_current_accuracy()); + + const double mass_scale = + settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? + settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; + + model.run_to(mass_scale); + model.solve_ewsb(); + model.calculate_spectrum(); + + // start logarithmic resummation + { + double Q_higgs = settings.get(Spectrum_generator_settings::eft_pole_mass_scale); + + if (Q_higgs == 0.) { + const double Mt = low_scale_constraint.get_sm_parameters().displayPoleMt(); + Q_higgs = std::min(susy_scale, Mt); + } + + eft.run_to(Q_higgs); + + // computation of pole mass spectrum in the SM + const unsigned eft_pole_loops = eft.get_pole_mass_loop_order(); + const unsigned eft_ewsb_loops = eft.get_ewsb_loop_order(); + + if (eft_pole_loops > 1) { + WARNING("Pole mass loop order " << eft_pole_loops + << " in the EFT is currently not supported! I'm using 1-loop."); + eft.set_pole_mass_loop_order(1); + } + if (eft_ewsb_loops > 1) { + WARNING("EWSB loop order " << eft_ewsb_loops + << " in the EFT is currently not supported! I'm using 1-loop."); + eft.set_ewsb_loop_order(1); + } + + eft.calculate_DRbar_masses(); + eft.solve_ewsb(); + eft.calculate_spectrum(); + + eft.set_pole_mass_loop_order(eft_pole_loops); + eft.set_ewsb_loop_order(eft_ewsb_loops); + + this->model.get_physical().M@HiggsBoson_index@ = eft.get_physical().Mhh; + this->model.get_physical().M@VectorZ_0@ = eft.get_physical().MVZ; + this->model.get_physical().M@VectorW_0@ = eft.get_physical().MVWp; +@fillSMFermionPoleMasses@ + } + + // copy calculated W pole mass + model.get_physical().M@VectorW@ + = low_scale_constraint.get_sm_parameters().displayPoleMW(); + + // run to output scale (if scale > 0) + if (!is_zero(parameter_output_scale)) { + model.run_to(parameter_output_scale); + eft.run_to(parameter_output_scale); + } + } catch (...) { + translate_exception_to_problem(model); + } +} + +/** + * Create a text file which contains the values of all model + * parameters at all scales between the low-scale and the high-scale. + * + * @param filename name of output file + */ +void @ModelName@_spectrum_generator::write_running_couplings( + const std::string& filename) const +{ + @ModelName@_spectrum_generator_interface<@ModelName@ >::write_running_couplings(filename, low_scale, high_scale); +} + +} // namespace flexiblesusy diff --git a/templates/standard_model_high_scale_spectrum_generator.hpp.in b/templates/standard_model_high_scale_spectrum_generator.hpp.in index 60bfd04fe..6bdc10fa2 100644 --- a/templates/standard_model_high_scale_spectrum_generator.hpp.in +++ b/templates/standard_model_high_scale_spectrum_generator.hpp.in @@ -22,35 +22,29 @@ #define @ModelName@_STANDARD_MODEL_SPECTRUM_GENERATOR_H #include "@ModelName@_spectrum_generator_interface.hpp" +#include "@ModelName@_spectrum_generator.hpp" #include "@ModelName@_two_scale_high_scale_constraint.hpp" #include "@ModelName@_two_scale_susy_scale_constraint.hpp" -#include "@ModelName@_two_scale_convergence_tester.hpp" -#include "@ModelName@_two_scale_initial_guesser.hpp" +#include "@ModelName@_two_scale_model.hpp" #include "@ModelName@_standard_model_matching.hpp" #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_standard_model_two_scale_matching.hpp" #include "standard_model_two_scale_model.hpp" #include "standard_model_two_scale_low_scale_constraint.hpp" -#include "standard_model_two_scale_convergence_tester.hpp" -#include "two_scale_composite_convergence_tester.hpp" #include "lowe.h" -#include "error.hpp" -#include "numerics2.hpp" -#include "two_scale_running_precision.hpp" #include "two_scale_solver.hpp" -#include -#include - namespace flexiblesusy { -template -class @ModelName@_spectrum_generator - : public @ModelName@_spectrum_generator_interface { +class Two_scale; + +template <> +class @ModelName@_spectrum_generator + : public @ModelName@_spectrum_generator_interface<@ModelName@ > { public: @ModelName@_spectrum_generator() - : @ModelName@_spectrum_generator_interface() + : @ModelName@_spectrum_generator_interface<@ModelName@ >() , solver() , high_scale_constraint() , susy_scale_constraint() @@ -64,7 +58,7 @@ public: {} virtual ~@ModelName@_spectrum_generator() {} - const standard_model::StandardModel& get_eft() const { return eft; } + const standard_model::StandardModel& get_eft() const { return eft; } double get_high_scale() const { return high_scale; } double get_susy_scale() const { return susy_scale; } double get_low_scale() const { return low_scale; } @@ -73,210 +67,16 @@ public: void write_running_couplings(const std::string& filename = "@ModelName@_rgflow.dat") const; private: - RGFlow solver; - @ModelName@_high_scale_constraint high_scale_constraint; - @ModelName@_susy_scale_constraint susy_scale_constraint; - standard_model::Standard_model_low_scale_constraint low_scale_constraint; - @ModelName@_standard_model_matching_up matching_up; - @ModelName@_standard_model_matching_down matching_down; - standard_model::StandardModel eft; + RGFlow solver; + @ModelName@_high_scale_constraint high_scale_constraint; + @ModelName@_susy_scale_constraint susy_scale_constraint; + standard_model::Standard_model_low_scale_constraint low_scale_constraint; + @ModelName@_standard_model_matching_up matching_up; + @ModelName@_standard_model_matching_down matching_down; + standard_model::StandardModel eft; double high_scale, susy_scale, low_scale; }; -/** - * @brief Run's the RG solver with the given input parameters - * - * This function sets up the RG solver using a high-scale, susy-scale - * and low-scale constraint. Afterwards the solver is run until - * convergence is reached or an error occours. Finally the particle - * spectrum (pole masses) is calculated. - * - * @param qedqcd Standard Model input parameters - * @param input model input parameters - */ -template -void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, - const @ModelName@_input_parameters& input) -{ - @ModelName@& model = this->model; - model.clear(); - model.set_input_parameters(input); - model.do_calculate_sm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_sm_masses)); - model.do_calculate_bsm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_bsm_masses)); - model.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); - model.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); - model.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); - model.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); - - eft.clear(); - eft.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); - eft.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); - eft.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); - eft.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); - eft.set_pole_mass_loop_order(this->model.get_pole_mass_loop_order()); - eft.set_ewsb_loop_order(this->model.get_ewsb_loop_order()); - eft.set_ewsb_iteration_precision(this->model.get_ewsb_iteration_precision()); - eft.set_number_of_ewsb_iterations(this->model.get_number_of_ewsb_iterations()); - eft.set_number_of_mass_iterations(this->model.get_number_of_mass_iterations()); - eft.set_two_loop_corrections(this->model.get_two_loop_corrections()); - - high_scale_constraint.clear(); - susy_scale_constraint.clear(); - low_scale_constraint .clear(); - - // needed for constraint::initialize() - high_scale_constraint.set_model(&model); - susy_scale_constraint.set_model(&model); - low_scale_constraint .set_model(&eft); - - low_scale_constraint .set_sm_parameters(qedqcd); - - const unsigned index = this->settings.get(Spectrum_generator_settings::eft_higgs_index); - - matching_up.set_models(&eft, &model); - matching_up.set_constraint(&susy_scale_constraint); - matching_up.set_scale(this->settings.get(Spectrum_generator_settings::eft_matching_scale)); - matching_up.set_loop_order(this->settings.get(Spectrum_generator_settings::eft_matching_loop_order_up)); - matching_up.set_higgs_index(index); - - matching_down.set_models(&model, &eft); - matching_down.set_constraint(&susy_scale_constraint); - matching_down.set_scale(this->settings.get(Spectrum_generator_settings::eft_matching_scale)); - matching_down.set_loop_order(this->settings.get(Spectrum_generator_settings::eft_matching_loop_order_down)); - matching_down.set_higgs_index(index); - - high_scale_constraint.initialize(); - susy_scale_constraint.initialize(); - low_scale_constraint .initialize(); - - // convergence tester for @ModelName@ - @ModelName@_convergence_tester model_ct( - &model, this->settings.get(Spectrum_generator_settings::precision)); - - // convergence tester for Standard Model - standard_model::Standard_model_convergence_tester eft_ct( - &eft, this->settings.get(Spectrum_generator_settings::precision)); - - if (this->settings.get(Spectrum_generator_settings::max_iterations) > 0) { - model_ct.set_max_iterations( - this->settings.get(Spectrum_generator_settings::max_iterations)); - eft_ct.set_max_iterations( - this->settings.get(Spectrum_generator_settings::max_iterations)); - } - - Composite_convergence_tester cct; - cct.add_convergence_tester(&model_ct); - cct.add_convergence_tester(&eft_ct); - - @ModelName@_standard_model_initial_guesser initial_guesser(&model, &eft, qedqcd, - low_scale_constraint, - susy_scale_constraint, - high_scale_constraint); - - Two_scale_increasing_precision precision( - 10.0, this->settings.get(Spectrum_generator_settings::precision)); - - solver.reset(); - solver.set_convergence_tester(&cct); - solver.set_running_precision(&precision); - solver.set_initial_guesser(&initial_guesser); - solver.add(&low_scale_constraint, &eft); - solver.add(&matching_up, &eft, &model); - solver.add(&susy_scale_constraint, &model); - solver.add(&high_scale_constraint, &model); - solver.add(&susy_scale_constraint, &model); - solver.add(&matching_down, &model, &eft); - - high_scale = susy_scale = low_scale = 0.; - this->reached_precision = std::numeric_limits::infinity(); - - try { - solver.solve(); - - // impose low-scale constraint one last time - eft.run_to(low_scale_constraint.get_scale()); - low_scale_constraint.apply(); - - high_scale = high_scale_constraint.get_scale(); - susy_scale = susy_scale_constraint.get_scale(); - low_scale = low_scale_constraint.get_scale(); - this->reached_precision = std::max(model_ct.get_current_accuracy(), - eft_ct.get_current_accuracy()); - - const double mass_scale = - this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? - this->settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; - - model.run_to(mass_scale); - model.solve_ewsb(); - model.calculate_spectrum(); - - // start logarithmic resummation - { - double Q_higgs = this->settings.get(Spectrum_generator_settings::eft_pole_mass_scale); - - if (Q_higgs == 0.) { - const double Mt = low_scale_constraint.get_sm_parameters().displayPoleMt(); - Q_higgs = std::min(susy_scale, Mt); - } - - eft.run_to(Q_higgs); - - // computation of pole mass spectrum in the SM - const unsigned eft_pole_loops = eft.get_pole_mass_loop_order(); - const unsigned eft_ewsb_loops = eft.get_ewsb_loop_order(); - - if (eft_pole_loops > 1) { - WARNING("Pole mass loop order " << eft_pole_loops - << " in the EFT is currently not supported! I'm using 1-loop."); - eft.set_pole_mass_loop_order(1); - } - if (eft_ewsb_loops > 1) { - WARNING("EWSB loop order " << eft_ewsb_loops - << " in the EFT is currently not supported! I'm using 1-loop."); - eft.set_ewsb_loop_order(1); - } - - eft.calculate_DRbar_masses(); - eft.solve_ewsb(); - eft.calculate_spectrum(); - - eft.set_pole_mass_loop_order(eft_pole_loops); - eft.set_ewsb_loop_order(eft_ewsb_loops); - - this->model.get_physical().M@HiggsBoson_index@ = eft.get_physical().Mhh; - this->model.get_physical().M@VectorZ_0@ = eft.get_physical().MVZ; - this->model.get_physical().M@VectorW_0@ = eft.get_physical().MVWp; -@fillSMFermionPoleMasses@ - } - - // copy calculated W pole mass - model.get_physical().M@VectorW@ - = low_scale_constraint.get_sm_parameters().displayPoleMW(); - - // run to output scale (if scale > 0) - if (!is_zero(this->parameter_output_scale)) { - model.run_to(this->parameter_output_scale); - eft.run_to(this->parameter_output_scale); - } - } catch (...) { - this->translate_exception_to_problem(model); - } -} - -/** - * Create a text file which contains the values of all model - * parameters at all scales between the low-scale and the high-scale. - * - * @param filename name of output file - */ -template -void @ModelName@_spectrum_generator::write_running_couplings( - const std::string& filename) const -{ - @ModelName@_spectrum_generator_interface::write_running_couplings(filename, low_scale, high_scale); -} - } // namespace flexiblesusy #endif diff --git a/templates/standard_model_low_scale_spectrum_generator.cpp.in b/templates/standard_model_low_scale_spectrum_generator.cpp.in new file mode 100644 index 000000000..099ffcac5 --- /dev/null +++ b/templates/standard_model_low_scale_spectrum_generator.cpp.in @@ -0,0 +1,220 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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 3 of the License, +// or (at your option) any later version. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +// File generated at @DateAndTime@ + +#include "@ModelName@_two_scale_spectrum_generator.hpp" +#include "@ModelName@_two_scale_convergence_tester.hpp" +#include "@ModelName@_two_scale_initial_guesser.hpp" +#include "standard_model_two_scale_convergence_tester.hpp" +#include "two_scale_composite_convergence_tester.hpp" + +#include "error.hpp" +#include "numerics2.hpp" +#include "two_scale_running_precision.hpp" + +#include +#include + +namespace flexiblesusy { + +/** + * @brief Run's the RG solver with the given input parameters + * + * This function sets up the RG solver using a susy-scale + * and low-scale constraint. Afterwards the solver is run until + * convergence is reached or an error occours. Finally the particle + * spectrum (pole masses) is calculated. + * + * @param qedqcd Standard Model input parameters + * @param input model input parameters + */ +void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, + const @ModelName@_input_parameters& input) +{ + @ModelName@& model = this->model; + model.clear(); + model.set_input_parameters(input); + model.do_calculate_sm_pole_masses(settings.get(Spectrum_generator_settings::calculate_sm_masses)); + model.do_calculate_bsm_pole_masses(settings.get(Spectrum_generator_settings::calculate_bsm_masses)); + model.do_force_output(settings.get(Spectrum_generator_settings::force_output)); + model.set_loops(settings.get(Spectrum_generator_settings::beta_loop_order)); + model.set_thresholds(settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); + model.set_zero_threshold(settings.get(Spectrum_generator_settings::beta_zero_threshold)); + + eft.clear(); + eft.do_force_output(settings.get(Spectrum_generator_settings::force_output)); + eft.set_loops(settings.get(Spectrum_generator_settings::beta_loop_order)); + eft.set_thresholds(settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); + eft.set_zero_threshold(settings.get(Spectrum_generator_settings::beta_zero_threshold)); + eft.set_pole_mass_loop_order(this->model.get_pole_mass_loop_order()); + eft.set_ewsb_loop_order(this->model.get_ewsb_loop_order()); + eft.set_ewsb_iteration_precision(this->model.get_ewsb_iteration_precision()); + eft.set_number_of_ewsb_iterations(this->model.get_number_of_ewsb_iterations()); + eft.set_number_of_mass_iterations(this->model.get_number_of_mass_iterations()); + eft.set_two_loop_corrections(this->model.get_two_loop_corrections()); + + susy_scale_constraint.clear(); + low_scale_constraint .clear(); + + // needed for constraint::initialize() + susy_scale_constraint.set_model(&model); + low_scale_constraint .set_model(&eft); + + low_scale_constraint .set_sm_parameters(qedqcd); + + const unsigned index = settings.get(Spectrum_generator_settings::eft_higgs_index); + + matching_up.set_models(&eft, &model); + matching_up.set_constraint(&susy_scale_constraint); + matching_up.set_scale(settings.get(Spectrum_generator_settings::eft_matching_scale)); + matching_up.set_loop_order(settings.get(Spectrum_generator_settings::eft_matching_loop_order_up)); + matching_up.set_higgs_index(index); + + matching_down.set_models(&model, &eft); + matching_down.set_constraint(&susy_scale_constraint); + matching_down.set_scale(settings.get(Spectrum_generator_settings::eft_matching_scale)); + matching_down.set_loop_order(settings.get(Spectrum_generator_settings::eft_matching_loop_order_down)); + matching_down.set_higgs_index(index); + + susy_scale_constraint.initialize(); + low_scale_constraint .initialize(); + + // convergence tester for @ModelName@ + @ModelName@_convergence_tester model_ct( + &model, settings.get(Spectrum_generator_settings::precision)); + + // convergence tester for Standard Model + standard_model::Standard_model_convergence_tester eft_ct( + &eft, settings.get(Spectrum_generator_settings::precision)); + + if (settings.get(Spectrum_generator_settings::max_iterations) > 0) { + model_ct.set_max_iterations( + settings.get(Spectrum_generator_settings::max_iterations)); + eft_ct.set_max_iterations( + settings.get(Spectrum_generator_settings::max_iterations)); + } + + Composite_convergence_tester cct; + cct.add_convergence_tester(&model_ct); + cct.add_convergence_tester(&eft_ct); + + @ModelName@_standard_model_initial_guesser initial_guesser(&model, &eft, qedqcd, + low_scale_constraint, + susy_scale_constraint); + Two_scale_increasing_precision precision( + 10.0, settings.get(Spectrum_generator_settings::precision)); + + solver.reset(); + solver.set_convergence_tester(&cct); + solver.set_running_precision(&precision); + solver.set_initial_guesser(&initial_guesser); + solver.add(&low_scale_constraint, &eft); + solver.add(&matching_up, &eft, &model); + solver.add(&susy_scale_constraint, &model); + solver.add(&matching_down, &model, &eft); + + susy_scale = low_scale = 0.; + reached_precision = std::numeric_limits::infinity(); + + try { + solver.solve(); + + // impose low-scale constraint one last time + eft.run_to(low_scale_constraint.get_scale()); + low_scale_constraint.apply(); + + susy_scale = susy_scale_constraint.get_scale(); + low_scale = low_scale_constraint.get_scale(); + reached_precision = std::max(model_ct.get_current_accuracy(), + eft_ct.get_current_accuracy()); + + const double mass_scale = + settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? + settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; + + model.run_to(mass_scale); + model.solve_ewsb(); + model.calculate_spectrum(); + + // start logarithmic resummation + { + double Q_higgs = settings.get(Spectrum_generator_settings::eft_pole_mass_scale); + + if (Q_higgs == 0.) { + const double Mt = low_scale_constraint.get_sm_parameters().displayPoleMt(); + Q_higgs = std::min(susy_scale, Mt); + } + + eft.run_to(Q_higgs); + + // computation of pole mass spectrum in the SM + const unsigned eft_pole_loops = eft.get_pole_mass_loop_order(); + const unsigned eft_ewsb_loops = eft.get_ewsb_loop_order(); + + if (eft_pole_loops > 1) { + WARNING("Pole mass loop order " << eft_pole_loops + << " in the EFT is currently not supported! I'm using 1-loop."); + eft.set_pole_mass_loop_order(1); + } + if (eft_ewsb_loops > 1) { + WARNING("EWSB loop order " << eft_ewsb_loops + << " in the EFT is currently not supported! I'm using 1-loop."); + eft.set_ewsb_loop_order(1); + } + + eft.calculate_DRbar_masses(); + eft.solve_ewsb(); + eft.calculate_spectrum(); + + eft.set_pole_mass_loop_order(eft_pole_loops); + eft.set_ewsb_loop_order(eft_ewsb_loops); + + this->model.get_physical().M@HiggsBoson_index@ = eft.get_physical().Mhh; + this->model.get_physical().M@VectorZ_0@ = eft.get_physical().MVZ; + this->model.get_physical().M@VectorW_0@ = eft.get_physical().MVWp; +@fillSMFermionPoleMasses@ + } + + // copy calculated W pole mass + model.get_physical().M@VectorW@ + = low_scale_constraint.get_sm_parameters().displayPoleMW(); + + // run to output scale (if scale > 0) + if (!is_zero(parameter_output_scale)) { + model.run_to(parameter_output_scale); + eft.run_to(parameter_output_scale); + } + } catch (...) { + translate_exception_to_problem(model); + } +} + +/** + * Create a text file which contains the values of all model + * parameters at all scales between the low-scale and the high-scale. + * + * @param filename name of output file + */ +void @ModelName@_spectrum_generator::write_running_couplings( + const std::string& filename) const +{ + @ModelName@_spectrum_generator_interface<@ModelName@ >::write_running_couplings(filename, low_scale, susy_scale); +} + +} // namespace flexiblesusy diff --git a/templates/standard_model_low_scale_spectrum_generator.hpp.in b/templates/standard_model_low_scale_spectrum_generator.hpp.in index 9fca017aa..e66fba2ba 100644 --- a/templates/standard_model_low_scale_spectrum_generator.hpp.in +++ b/templates/standard_model_low_scale_spectrum_generator.hpp.in @@ -22,34 +22,28 @@ #define @ModelName@_STANDARD_MODEL_SPECTRUM_GENERATOR_H #include "@ModelName@_spectrum_generator_interface.hpp" +#include "@ModelName@_spectrum_generator.hpp" +#include "@ModelName@_two_scale_model.hpp" #include "@ModelName@_two_scale_susy_scale_constraint.hpp" -#include "@ModelName@_two_scale_convergence_tester.hpp" -#include "@ModelName@_two_scale_initial_guesser.hpp" #include "@ModelName@_standard_model_matching.hpp" #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_standard_model_two_scale_matching.hpp" #include "standard_model_two_scale_model.hpp" #include "standard_model_two_scale_low_scale_constraint.hpp" -#include "standard_model_two_scale_convergence_tester.hpp" -#include "two_scale_composite_convergence_tester.hpp" #include "lowe.h" -#include "error.hpp" -#include "numerics2.hpp" -#include "two_scale_running_precision.hpp" #include "two_scale_solver.hpp" -#include -#include - namespace flexiblesusy { -template -class @ModelName@_spectrum_generator - : public @ModelName@_spectrum_generator_interface { +class Two_scale; + +template <> +class @ModelName@_spectrum_generator + : public @ModelName@_spectrum_generator_interface<@ModelName@ > { public: @ModelName@_spectrum_generator() - : @ModelName@_spectrum_generator_interface() + : @ModelName@_spectrum_generator_interface<@ModelName@ >() , solver() , susy_scale_constraint() , low_scale_constraint() @@ -61,7 +55,7 @@ public: {} virtual ~@ModelName@_spectrum_generator() {} - const standard_model::StandardModel& get_eft() const { return eft; } + const standard_model::StandardModel& get_eft() const { return eft; } double get_high_scale() const { return 0.; } double get_susy_scale() const { return susy_scale; } double get_low_scale() const { return low_scale; } @@ -70,201 +64,15 @@ public: void write_running_couplings(const std::string& filename = "@ModelName@_rgflow.dat") const; private: - RGFlow solver; - @ModelName@_susy_scale_constraint susy_scale_constraint; - standard_model::Standard_model_low_scale_constraint low_scale_constraint; - @ModelName@_standard_model_matching_up matching_up; - @ModelName@_standard_model_matching_down matching_down; - standard_model::StandardModel eft; + RGFlow solver; + @ModelName@_susy_scale_constraint susy_scale_constraint; + standard_model::Standard_model_low_scale_constraint low_scale_constraint; + @ModelName@_standard_model_matching_up matching_up; + @ModelName@_standard_model_matching_down matching_down; + standard_model::StandardModel eft; double susy_scale, low_scale; }; -/** - * @brief Run's the RG solver with the given input parameters - * - * This function sets up the RG solver using a susy-scale - * and low-scale constraint. Afterwards the solver is run until - * convergence is reached or an error occours. Finally the particle - * spectrum (pole masses) is calculated. - * - * @param qedqcd Standard Model input parameters - * @param input model input parameters - */ -template -void @ModelName@_spectrum_generator::run(const softsusy::QedQcd& qedqcd, - const @ModelName@_input_parameters& input) -{ - @ModelName@& model = this->model; - model.clear(); - model.set_input_parameters(input); - model.do_calculate_sm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_sm_masses)); - model.do_calculate_bsm_pole_masses(this->settings.get(Spectrum_generator_settings::calculate_bsm_masses)); - model.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); - model.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); - model.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); - model.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); - - eft.clear(); - eft.do_force_output(this->settings.get(Spectrum_generator_settings::force_output)); - eft.set_loops(this->settings.get(Spectrum_generator_settings::beta_loop_order)); - eft.set_thresholds(this->settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)); - eft.set_zero_threshold(this->settings.get(Spectrum_generator_settings::beta_zero_threshold)); - eft.set_pole_mass_loop_order(this->model.get_pole_mass_loop_order()); - eft.set_ewsb_loop_order(this->model.get_ewsb_loop_order()); - eft.set_ewsb_iteration_precision(this->model.get_ewsb_iteration_precision()); - eft.set_number_of_ewsb_iterations(this->model.get_number_of_ewsb_iterations()); - eft.set_number_of_mass_iterations(this->model.get_number_of_mass_iterations()); - eft.set_two_loop_corrections(this->model.get_two_loop_corrections()); - - susy_scale_constraint.clear(); - low_scale_constraint .clear(); - - // needed for constraint::initialize() - susy_scale_constraint.set_model(&model); - low_scale_constraint .set_model(&eft); - - low_scale_constraint .set_sm_parameters(qedqcd); - - const unsigned index = this->settings.get(Spectrum_generator_settings::eft_higgs_index); - - matching_up.set_models(&eft, &model); - matching_up.set_constraint(&susy_scale_constraint); - matching_up.set_scale(this->settings.get(Spectrum_generator_settings::eft_matching_scale)); - matching_up.set_loop_order(this->settings.get(Spectrum_generator_settings::eft_matching_loop_order_up)); - matching_up.set_higgs_index(index); - - matching_down.set_models(&model, &eft); - matching_down.set_constraint(&susy_scale_constraint); - matching_down.set_scale(this->settings.get(Spectrum_generator_settings::eft_matching_scale)); - matching_down.set_loop_order(this->settings.get(Spectrum_generator_settings::eft_matching_loop_order_down)); - matching_down.set_higgs_index(index); - - susy_scale_constraint.initialize(); - low_scale_constraint .initialize(); - - // convergence tester for @ModelName@ - @ModelName@_convergence_tester model_ct( - &model, this->settings.get(Spectrum_generator_settings::precision)); - - // convergence tester for Standard Model - standard_model::Standard_model_convergence_tester eft_ct( - &eft, this->settings.get(Spectrum_generator_settings::precision)); - - if (this->settings.get(Spectrum_generator_settings::max_iterations) > 0) { - model_ct.set_max_iterations( - this->settings.get(Spectrum_generator_settings::max_iterations)); - eft_ct.set_max_iterations( - this->settings.get(Spectrum_generator_settings::max_iterations)); - } - - Composite_convergence_tester cct; - cct.add_convergence_tester(&model_ct); - cct.add_convergence_tester(&eft_ct); - - @ModelName@_standard_model_initial_guesser initial_guesser(&model, &eft, qedqcd, - low_scale_constraint, - susy_scale_constraint); - Two_scale_increasing_precision precision( - 10.0, this->settings.get(Spectrum_generator_settings::precision)); - - solver.reset(); - solver.set_convergence_tester(&cct); - solver.set_running_precision(&precision); - solver.set_initial_guesser(&initial_guesser); - solver.add(&low_scale_constraint, &eft); - solver.add(&matching_up, &eft, &model); - solver.add(&susy_scale_constraint, &model); - solver.add(&matching_down, &model, &eft); - - susy_scale = low_scale = 0.; - this->reached_precision = std::numeric_limits::infinity(); - - try { - solver.solve(); - - // impose low-scale constraint one last time - eft.run_to(low_scale_constraint.get_scale()); - low_scale_constraint.apply(); - - susy_scale = susy_scale_constraint.get_scale(); - low_scale = low_scale_constraint.get_scale(); - this->reached_precision = std::max(model_ct.get_current_accuracy(), - eft_ct.get_current_accuracy()); - - const double mass_scale = - this->settings.get(Spectrum_generator_settings::pole_mass_scale) != 0. ? - this->settings.get(Spectrum_generator_settings::pole_mass_scale) : susy_scale; - - model.run_to(mass_scale); - model.solve_ewsb(); - model.calculate_spectrum(); - - // start logarithmic resummation - { - double Q_higgs = this->settings.get(Spectrum_generator_settings::eft_pole_mass_scale); - - if (Q_higgs == 0.) { - const double Mt = low_scale_constraint.get_sm_parameters().displayPoleMt(); - Q_higgs = std::min(susy_scale, Mt); - } - - eft.run_to(Q_higgs); - - // computation of pole mass spectrum in the SM - const unsigned eft_pole_loops = eft.get_pole_mass_loop_order(); - const unsigned eft_ewsb_loops = eft.get_ewsb_loop_order(); - - if (eft_pole_loops > 1) { - WARNING("Pole mass loop order " << eft_pole_loops - << " in the EFT is currently not supported! I'm using 1-loop."); - eft.set_pole_mass_loop_order(1); - } - if (eft_ewsb_loops > 1) { - WARNING("EWSB loop order " << eft_ewsb_loops - << " in the EFT is currently not supported! I'm using 1-loop."); - eft.set_ewsb_loop_order(1); - } - - eft.calculate_DRbar_masses(); - eft.solve_ewsb(); - eft.calculate_spectrum(); - - eft.set_pole_mass_loop_order(eft_pole_loops); - eft.set_ewsb_loop_order(eft_ewsb_loops); - - this->model.get_physical().M@HiggsBoson_index@ = eft.get_physical().Mhh; - this->model.get_physical().M@VectorZ_0@ = eft.get_physical().MVZ; - this->model.get_physical().M@VectorW_0@ = eft.get_physical().MVWp; -@fillSMFermionPoleMasses@ - } - - // copy calculated W pole mass - model.get_physical().M@VectorW@ - = low_scale_constraint.get_sm_parameters().displayPoleMW(); - - // run to output scale (if scale > 0) - if (!is_zero(this->parameter_output_scale)) { - model.run_to(this->parameter_output_scale); - eft.run_to(this->parameter_output_scale); - } - } catch (...) { - this->translate_exception_to_problem(model); - } -} - -/** - * Create a text file which contains the values of all model - * parameters at all scales between the low-scale and the high-scale. - * - * @param filename name of output file - */ -template -void @ModelName@_spectrum_generator::write_running_couplings( - const std::string& filename) const -{ - @ModelName@_spectrum_generator_interface::write_running_couplings(filename, low_scale, susy_scale); -} - } // namespace flexiblesusy #endif diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in index fc1b3aad7..b1de1c28f 100644 --- a/templates/two_scale.mk.in +++ b/templates/two_scale.mk.in @@ -28,6 +28,7 @@ LIB@ModelName@_SRC += \ $(DIR)/@ModelName@_two_scale_low_scale_constraint.cpp \ $(DIR)/@ModelName@_two_scale_model.cpp \ $(DIR)/@ModelName@_two_scale_model_slha.cpp \ + $(DIR)/@ModelName@_two_scale_spectrum_generator.cpp \ $(DIR)/@ModelName@_two_scale_susy_scale_constraint.cpp EXE@ModelName@_SRC += \ $(DIR)/run_@ModelName@.cpp \ @@ -41,8 +42,6 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_model.hpp \ $(DIR)/@ModelName@_model_slha.hpp \ $(DIR)/@ModelName@_slha_io.hpp \ - $(DIR)/@ModelName@_spectrum_generator_interface.hpp \ - $(DIR)/@ModelName@_spectrum_generator.hpp \ $(DIR)/@ModelName@_standard_model_matching.hpp \ $(DIR)/@ModelName@_standard_model_two_scale_matching.hpp \ $(DIR)/@ModelName@_susy_scale_constraint.hpp \ @@ -52,6 +51,7 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_two_scale_low_scale_constraint.hpp \ $(DIR)/@ModelName@_two_scale_model.hpp \ $(DIR)/@ModelName@_two_scale_model_slha.hpp \ + $(DIR)/@ModelName@_two_scale_spectrum_generator.hpp \ $(DIR)/@ModelName@_two_scale_susy_scale_constraint.hpp LL@ModelName@_SRC += \ $(DIR)/@ModelName@_librarylink.cpp From 2bad62c5f5389f4ff13e2c73b63369de162ecb13 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 25 Nov 2016 16:44:52 +1030 Subject: [PATCH 16/34] Use generic SLHA wrapper for model instead of specialising to only two-scale method --- meta/FlexibleSUSY.m | 6 +- meta/FlexibleTower.m | 2 +- meta/WriteOut.m | 11 +- .../high_scale_spectrum_generator.hpp.in | 4 +- templates/librarylink.cpp.in | 4 +- templates/low_scale_spectrum_generator.hpp.in | 4 +- templates/model_slha.hpp.in | 212 +++++++++++++++++- templates/module.mk | 6 +- templates/module.mk.in | 2 + templates/scan.cpp.in | 2 +- templates/slha_io.hpp.in | 48 ++-- templates/spectrum_generator_interface.hpp.in | 2 +- ...model_high_scale_spectrum_generator.hpp.in | 4 +- ..._model_low_scale_spectrum_generator.hpp.in | 4 +- templates/two_scale.mk.in | 4 - templates/two_scale_model_slha.cpp.in | 157 ------------- templates/two_scale_model_slha.hpp.in | 96 -------- 17 files changed, 261 insertions(+), 307 deletions(-) delete mode 100644 templates/two_scale_model_slha.cpp.in delete mode 100644 templates/two_scale_model_slha.hpp.in diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 5b1b783f0..e3fb98ea4 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -2581,11 +2581,7 @@ corresponding tadpole is real or imaginary (only in models with CP Print["Creating class for SLHA model ..."]; WriteModelSLHAClass[massMatrices, {{FileNameJoin[{$flexiblesusyTemplateDir, "model_slha.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_model_slha.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model_slha.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model_slha.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model_slha.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model_slha.cpp"}]} + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_model_slha.hpp"}]} }]; PrintHeadline["Creating model"]; diff --git a/meta/FlexibleTower.m b/meta/FlexibleTower.m index 0d2069d5d..5d2b8278f 100644 --- a/meta/FlexibleTower.m +++ b/meta/FlexibleTower.m @@ -8,7 +8,7 @@ name <> "<" <> templatePar <> ">"; GetSLHAModelType[name_String, templatePar_String] := - GetModelType[name <> "_slha", templatePar]; + GetModelType[name <> "_slha", GetModelType[name, templatePar]]; GetModelTypes[] := Utils`StringJoinWithSeparator[ diff --git a/meta/WriteOut.m b/meta/WriteOut.m index 83cfc940b..c53350968 100644 --- a/meta/WriteOut.m +++ b/meta/WriteOut.m @@ -921,7 +921,7 @@ If[Parameters`IsOutputParameter[{vL, vR}] && ParametersHaveSameDimension[{vL, vR, #}], result = result <> - "fs_svd(" <> CConversion`ToValidCSymbolString[#] <> ", " <> + "fs_svd(MODELPARAMETER(" <> CConversion`ToValidCSymbolString[#] <> "), " <> CreateSLHAYukawaName[#] <> ", " <> CreateSLHAFermionMixingMatrixName[vR] <> ", " <> CreateSLHAFermionMixingMatrixName[vL] <> ");\n"; @@ -986,7 +986,8 @@ result = result <> CreateSLHATrilinearCouplingName[#] <> " = (" <> CreateSLHAFermionMixingMatrixName[vR] <> ".conjugate() * " <> - CConversion`ToValidCSymbolString[#] <> " * " <> + "MODELPARAMETER(" <> + CConversion`ToValidCSymbolString[#] <> ") * " <> CreateSLHAFermionMixingMatrixName[vL] <> ".adjoint()" <> ").real();\n"; , @@ -1053,14 +1054,16 @@ result = result <> CreateSLHASoftSquaredMassName[#] <> " = (" <> CreateSLHAFermionMixingMatrixName[vL] <> " * " <> - CConversion`ToValidCSymbolString[#] <> " * " <> + "MODELPARAMETER(" <> + CConversion`ToValidCSymbolString[#] <> ") * " <> CreateSLHAFermionMixingMatrixName[vL] <> ".adjoint()" <> ").real();\n"; , result = result <> CreateSLHASoftSquaredMassName[#] <> " = (" <> CreateSLHAFermionMixingMatrixName[vR] <> ".conjugate() * " <> - CConversion`ToValidCSymbolString[#] <> " * " <> + "MODELPARAMETER(" <> + CConversion`ToValidCSymbolString[#] <> ") * " <> CreateSLHAFermionMixingMatrixName[vR] <> ".transpose()" <> ").real();\n"; ]; diff --git a/templates/high_scale_spectrum_generator.hpp.in b/templates/high_scale_spectrum_generator.hpp.in index dd18d9c29..8781a578d 100644 --- a/templates/high_scale_spectrum_generator.hpp.in +++ b/templates/high_scale_spectrum_generator.hpp.in @@ -28,7 +28,7 @@ #include "@ModelName@_two_scale_susy_scale_constraint.hpp" #include "@ModelName@_two_scale_low_scale_constraint.hpp" #include "@ModelName@_two_scale_model.hpp" -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_model_slha.hpp" #include "lowe.h" @@ -51,7 +51,7 @@ public: virtual ~@ModelName@_spectrum_generator() {} std::tuple<@ModelName@ > get_models() const { return std::make_tuple(this->get_model()); } - std::tuple<@ModelName@_slha > get_models_slha() const { return std::make_tuple(this->get_model_slha()); } + std::tuple<@ModelName@_slha<@ModelName@ > > get_models_slha() const { return std::make_tuple(this->get_model_slha()); } double get_high_scale() const { return high_scale_constraint.get_scale(); } double get_susy_scale() const { return susy_scale_constraint.get_scale(); } diff --git a/templates/librarylink.cpp.in b/templates/librarylink.cpp.in index 178c8ade5..ac2ab19c5 100644 --- a/templates/librarylink.cpp.in +++ b/templates/librarylink.cpp.in @@ -25,7 +25,7 @@ #include "@ModelName@_slha_io.hpp" #include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_two_scale_model.hpp" -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_model_slha.hpp" #include "standard_model_two_scale_model.hpp" #include "array_view.hpp" @@ -548,7 +548,7 @@ void put_spectrum(const standard_model::StandardModel& model, ML /******************************************************************/ -void put_spectrum(const @ModelName@_slha& model, MLINK link) +void put_spectrum(const @ModelName@_slha<@ModelName@ >& model, MLINK link) { MLPutRule(link, @ModelName@_info::model_name); MLPutFunction(link, "List", @numberOfSpectrumEntries@); diff --git a/templates/low_scale_spectrum_generator.hpp.in b/templates/low_scale_spectrum_generator.hpp.in index c0a1bf6c4..b6e2da92d 100644 --- a/templates/low_scale_spectrum_generator.hpp.in +++ b/templates/low_scale_spectrum_generator.hpp.in @@ -27,7 +27,7 @@ #include "@ModelName@_two_scale_susy_scale_constraint.hpp" #include "@ModelName@_two_scale_low_scale_constraint.hpp" #include "@ModelName@_two_scale_model.hpp" -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_model_slha.hpp" #include "lowe.h" @@ -49,7 +49,7 @@ public: virtual ~@ModelName@_spectrum_generator() {} std::tuple<@ModelName@ > get_models() const { return std::make_tuple(this->get_model()); } - std::tuple<@ModelName@_slha > get_models_slha() const { return std::make_tuple(this->get_model_slha()); } + std::tuple<@ModelName@_slha<@ModelName@ > > get_models_slha() const { return std::make_tuple(this->get_model_slha()); } double get_high_scale() const { return 0.; } double get_susy_scale() const { return susy_scale_constraint.get_scale(); } diff --git a/templates/model_slha.hpp.in b/templates/model_slha.hpp.in index 56ea8449d..188fb6253 100644 --- a/templates/model_slha.hpp.in +++ b/templates/model_slha.hpp.in @@ -16,16 +16,224 @@ // . // ==================================================================== +/** + * @file @ModelName@_model_slha.hpp + * @brief contains wrapper class for model class in SLHA convention + */ + // File generated at @DateAndTime@ #ifndef @ModelName@_SLHA_H #define @ModelName@_SLHA_H +#include "@ModelName@_input_parameters.hpp" +#include "@ModelName@_mass_eigenstates.hpp" +#include "@ModelName@_physical.hpp" + +#include "ckm.hpp" +#include "linalg2.hpp" +#include "pmns.hpp" +#include "slha_io.hpp" +#include "wrappers.hpp" + +#define LOCALPHYSICAL(p) physical.p +#define MODELPARAMETER(p) this->p +#define PHYSICAL_SLHA(p) physical_slha.p +#define PHYSICAL_SLHA_REAL(p) Re(physical_slha.p) + namespace flexiblesusy { -template -class @ModelName@_slha; +/** + * @class @ModelName@_slha + * @brief model class wrapper in SLHA convention + * + * @tparam Model model class to wrap + */ + +template +class @ModelName@_slha : public Model { +public: + explicit @ModelName@_slha(const @ModelName@_input_parameters& input_ = @ModelName@_input_parameters()); + explicit @ModelName@_slha(const Model&, bool do_convert_masses_to_slha = true); + virtual ~@ModelName@_slha(); + + virtual void clear(); + void convert_to_slha(); ///< converts pole masses and couplings to SLHA convention + const Eigen::Matrix,3,3>& get_ckm_matrix() const { return ckm; } + const Eigen::Matrix,3,3>& get_pmns_matrix() const { return pmns; } + const @ModelName@_physical& get_physical_slha() const; ///< returns pole masses to SLHA convention + @ModelName@_physical& get_physical_slha(); ///< returns pole masses to SLHA convention + void set_convert_masses_to_slha(bool); ///< allow/disallow for negative majoran fermion masses + + // interface functions + virtual void calculate_spectrum(); + virtual void print(std::ostream&) const; + +@slhaPoleMassGetters@ +@slhaPoleMixingMatrixGetters@ +@slhaYukawaGetter@ +@slhaTrilinearCouplingsGetter@ +@slhaSoftSquaredMassesGetter@ +@slhaFerimonMixingMatricesGetters@ + +private: + @ModelName@_physical physical_slha; ///< contains the pole masses and mixings in slha convention + Eigen::Matrix,3,3> ckm; + Eigen::Matrix,3,3> pmns; + bool convert_masses_to_slha; ///< allow/disallow for negative majoran fermion masses +@slhaYukawaDef@ +@slhaFerimonMixingMatricesDef@ +@slhaTrilinearCouplingsDef@ +@slhaSoftSquaredMassesDef@ + + void calculate_ckm_matrix(); + void calculate_pmns_matrix(); + void convert_yukawa_couplings_to_slha(); + void convert_trilinear_couplings_to_slha(); + void convert_soft_squared_masses_to_slha(); +}; + +template +@ModelName@_slha::@ModelName@_slha(const @ModelName@_input_parameters& input_) + : Model(input_) + , physical_slha() + , ckm(Eigen::Matrix,3,3>::Identity()) + , pmns(Eigen::Matrix,3,3>::Identity()) + , convert_masses_to_slha(true) +{ +} +/** + * Copy constructor. Copies from base class (model class in + * BPMZ convention) and converts parameters to SLHA. + * + * @param model_ model class in BPMZ convention + * @param do_convert_masses_to_slha whether to convert majorana + * fermion masses to SLHA convention (allow them to be negative) + */ +template +@ModelName@_slha::@ModelName@_slha(const Model& model_, + bool do_convert_masses_to_slha) + : Model(model_) + , convert_masses_to_slha(do_convert_masses_to_slha) +{ + convert_to_slha(); } +template +@ModelName@_slha::~@ModelName@_slha() +{ +} + +template +void @ModelName@_slha::clear() +{ + Model::clear(); + physical_slha.clear(); +} + +template +void @ModelName@_slha::calculate_spectrum() +{ + Model::calculate_spectrum(); + convert_to_slha(); +} + +template +void @ModelName@_slha::convert_to_slha() +{ + physical_slha = this->get_physical(); + + if (convert_masses_to_slha) + physical_slha.convert_to_slha(); + + convert_yukawa_couplings_to_slha(); + calculate_ckm_matrix(); + calculate_pmns_matrix(); + convert_trilinear_couplings_to_slha(); + convert_soft_squared_masses_to_slha(); +} + +template +void @ModelName@_slha::calculate_ckm_matrix() +{ +@calculateCKMMatrix@ +} + +template +void @ModelName@_slha::calculate_pmns_matrix() +{ +@calculatePMNSMatrix@ +} + +/** + * Convert Yukawa couplings to SLHA convention + */ +template +void @ModelName@_slha::convert_yukawa_couplings_to_slha() +{ +@convertYukawaCouplingsToSLHA@ +} + +/** + * Convert trilinear couplings to SLHA convention + */ +template +void @ModelName@_slha::convert_trilinear_couplings_to_slha() +{ +@convertTrilinearCouplingsToSLHA@ +} + +/** + * Convert soft-breaking squared mass parameters to SLHA convention + */ +template +void @ModelName@_slha::convert_soft_squared_masses_to_slha() +{ +@convertSoftSquaredMassesToSLHA@ +} + +template +const @ModelName@_physical& @ModelName@_slha::get_physical_slha() const +{ + return physical_slha; +} + +template +@ModelName@_physical& @ModelName@_slha::get_physical_slha() +{ + return physical_slha; +} + +template +void @ModelName@_slha::print(std::ostream& ostr) const +{ + Model::print(ostr); + + ostr << "----------------------------------------\n" + "SLHA convention:\n" + "----------------------------------------\n"; + physical_slha.print(ostr); +} + +template +void @ModelName@_slha::set_convert_masses_to_slha(bool flag) +{ + convert_masses_to_slha = flag; +} + +template +std::ostream& operator<<(std::ostream& ostr, const @ModelName@_slha& model) +{ + model.print(ostr); + return ostr; +} + +} // namespace flexiblesusy + +#undef LOCALPHYSICAL +#undef MODELPARAMETER +#undef PHYSICAL_SLHA +#undef PHYSICAL_SLHA_REAL + #endif diff --git a/templates/module.mk b/templates/module.mk index dcf0ef46d..ed45384ee 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -12,6 +12,8 @@ BASE_TEMPLATES := \ $(DIR)/input_parameters.cpp.in \ $(DIR)/mass_eigenstates.hpp.in \ $(DIR)/mass_eigenstates.cpp.in \ + $(DIR)/model.hpp.in \ + $(DIR)/model_slha.hpp.in \ $(DIR)/observables.hpp.in \ $(DIR)/observables.cpp.in \ $(DIR)/physical.hpp.in \ @@ -40,8 +42,6 @@ TWO_SCALE_TEMPLATES := \ $(DIR)/low_scale_constraint.hpp.in \ $(DIR)/low_scale_spectrum_generator.hpp.in \ $(DIR)/low_scale_spectrum_generator.cpp.in \ - $(DIR)/model.hpp.in \ - $(DIR)/model_slha.hpp.in \ $(DIR)/run.cpp.in \ $(DIR)/run.m.in \ $(DIR)/run_cmd_line.cpp.in \ @@ -73,8 +73,6 @@ TWO_SCALE_TEMPLATES := \ $(DIR)/two_scale_low_scale_initial_guesser.cpp.in \ $(DIR)/two_scale_model.hpp.in \ $(DIR)/two_scale_model.cpp.in \ - $(DIR)/two_scale_model_slha.hpp.in \ - $(DIR)/two_scale_model_slha.cpp.in \ $(DIR)/two_scale_susy_scale_constraint.hpp.in \ $(DIR)/two_scale_susy_scale_constraint.cpp.in diff --git a/templates/module.mk.in b/templates/module.mk.in index a95ab6569..e37f094ca 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -53,6 +53,8 @@ LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_info.hpp \ $(DIR)/@CLASSNAME@_input_parameters.hpp \ $(DIR)/@CLASSNAME@_mass_eigenstates.hpp \ + $(DIR)/@CLASSNAME@_model.hpp \ + $(DIR)/@CLASSNAME@_model_slha.hpp \ $(DIR)/@CLASSNAME@_observables.hpp \ $(DIR)/@CLASSNAME@_physical.hpp \ $(DIR)/@CLASSNAME@_spectrum_generator.hpp \ diff --git a/templates/scan.cpp.in b/templates/scan.cpp.in index 26c0f7a29..ea48b4bfa 100644 --- a/templates/scan.cpp.in +++ b/templates/scan.cpp.in @@ -20,7 +20,7 @@ #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_two_scale_spectrum_generator.hpp" -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_model_slha.hpp" #include "command_line_options.hpp" #include "scan.hpp" diff --git a/templates/slha_io.hpp.in b/templates/slha_io.hpp.in index 5fd3d0e9a..9778404a1 100644 --- a/templates/slha_io.hpp.in +++ b/templates/slha_io.hpp.in @@ -21,7 +21,8 @@ #ifndef @ModelName@_SLHA_IO_H #define @ModelName@_SLHA_IO_H -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_mass_eigenstates.hpp" +#include "@ModelName@_model_slha.hpp" #include "@ModelName@_info.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_physical.hpp" @@ -54,6 +55,9 @@ namespace flexiblesusy { struct @ModelName@_input_parameters; class Spectrum_generator_settings; +template +class @ModelName@; + struct @ModelName@_scales { @ModelName@_scales() : HighScale(0.), SUSYScale(0.), LowScale(0.) {} double HighScale, SUSYScale, LowScale; @@ -68,7 +72,7 @@ public: void fill(softsusy::QedQcd& qedqcd) const { slha_io.fill(qedqcd); } void fill(@ModelName@_input_parameters&) const; void fill(@ModelName@_mass_eigenstates&) const; - template void fill(@ModelName@_slha&) const; + template void fill(@ModelName@_slha&) const; void fill(Physical_input&) const; void fill(Spectrum_generator_settings&) const; double get_parameter_output_scale() const; @@ -78,14 +82,14 @@ public: void read_from_stream(std::istream&); void set_block(const std::string& str, SLHA_io::Position position = SLHA_io::back) { slha_io.set_block(str, position); } void set_blocks(const std::vector& vec, SLHA_io::Position position = SLHA_io::back) { slha_io.set_blocks(vec, position); } - template void set_extra(const @ModelName@_slha&, const @ModelName@_scales&, const @ModelName@_observables&); + template void set_extra(const @ModelName@_slha&, const @ModelName@_scales&, const @ModelName@_observables&); void set_input(const @ModelName@_input_parameters&); void set_modsel(const SLHA_io::Modsel&); void set_physical_input(const Physical_input&); void set_settings(const Spectrum_generator_settings&); void set_sminputs(const softsusy::QedQcd&); template void set_spectrum(const std::tuple&); - template void set_spectrum(const @ModelName@_slha&); + template void set_spectrum(const @ModelName@_slha&); template void set_spectrum(const @ModelName@&); void set_spectrum(const standard_model::Standard_model& m) { slha_io.set_spectrum(m); } void set_spinfo(const Problems<@ModelName@_info::NUMBER_OF_PARTICLES, @ModelName@_info::NUMBER_OF_PARAMETERS>&); @@ -98,11 +102,11 @@ public: static void fill_minpar_tuple(@ModelName@_input_parameters&, int, double); static void fill_extpar_tuple(@ModelName@_input_parameters&, int, double); - template - static void fill_slhaea(SLHAea::Coll&, const @ModelName@_slha&, const softsusy::QedQcd&, const @ModelName@_scales&, const @ModelName@_observables&); + template + static void fill_slhaea(SLHAea::Coll&, const @ModelName@_slha&, const softsusy::QedQcd&, const @ModelName@_scales&, const @ModelName@_observables&); - template - static SLHAea::Coll fill_slhaea(const @ModelName@_slha&, const softsusy::QedQcd&, const @ModelName@_scales&, const @ModelName@_observables&); + template + static SLHAea::Coll fill_slhaea(const @ModelName@_slha&, const softsusy::QedQcd&, const @ModelName@_scales&, const @ModelName@_observables&); private: SLHA_io slha_io; ///< SLHA io class @@ -112,7 +116,7 @@ private: void set_minpar(const @ModelName@_input_parameters&); void set_mass(const @ModelName@_physical&, bool); void set_mixing_matrices(const @ModelName@_physical&, bool); - template void set_model_parameters(const @ModelName@_slha&); + template void set_model_parameters(const @ModelName@_slha&); void set_ckm(const Eigen::Matrix,3,3>&, double); void set_pmns(const Eigen::Matrix,3,3>&, double); double read_scale() const; @@ -124,16 +128,16 @@ private: * Reads DR-bar parameters, pole masses and mixing matrices from a * SLHA output file. */ -template -void @ModelName@_slha_io::fill(@ModelName@_slha& model) const +template +void @ModelName@_slha_io::fill(@ModelName@_slha& model) const { fill(static_cast<@ModelName@_mass_eigenstates&>(model)); fill_physical(model.get_physical_slha()); } -template +template void @ModelName@_slha_io::fill_slhaea( - SLHAea::Coll& slhaea, const @ModelName@_slha& model, + SLHAea::Coll& slhaea, const @ModelName@_slha& model, const softsusy::QedQcd& qedqcd, const @ModelName@_scales& scales, const @ModelName@_observables& observables) { @@ -153,9 +157,9 @@ void @ModelName@_slha_io::fill_slhaea( slhaea = slha_io.get_slha_io().get_data(); } -template +template SLHAea::Coll @ModelName@_slha_io::fill_slhaea( - const @ModelName@_slha& model, const softsusy::QedQcd& qedqcd, + const @ModelName@_slha& model, const softsusy::QedQcd& qedqcd, const @ModelName@_scales& scales, const @ModelName@_observables& observables) { SLHAea::Coll slhaea; @@ -169,8 +173,8 @@ SLHAea::Coll @ModelName@_slha_io::fill_slhaea( * * @param model model class */ -template -void @ModelName@_slha_io::set_model_parameters(const @ModelName@_slha& model) +template +void @ModelName@_slha_io::set_model_parameters(const @ModelName@_slha& model) { @writeSLHAModelParametersBlocks@ @writeSLHAPhasesBlocks@ @@ -183,9 +187,9 @@ void @ModelName@_slha_io::set_model_parameters(const @ModelName@_slha& model) * @param scales struct of boundary condition scales * @param observables struct of observables */ -template +template void @ModelName@_slha_io::set_extra( - const @ModelName@_slha& model, const @ModelName@_scales& scales, + const @ModelName@_slha& model, const @ModelName@_scales& scales, const @ModelName@_observables& observables) { const @ModelName@_physical physical(model.get_physical_slha()); @@ -217,7 +221,7 @@ void @ModelName@_slha_io::set_spectrum(const std::tuple& models) template void @ModelName@_slha_io::set_spectrum(const @ModelName@& model) { - set_spectrum(@ModelName@_slha(model)); + set_spectrum(@ModelName@_slha<@ModelName@ >(model)); } /** @@ -226,8 +230,8 @@ void @ModelName@_slha_io::set_spectrum(const @ModelName@& model) * * @param model model class in SLHA convention */ -template -void @ModelName@_slha_io::set_spectrum(const @ModelName@_slha& model) +template +void @ModelName@_slha_io::set_spectrum(const @ModelName@_slha& model) { const @ModelName@_physical physical(model.get_physical_slha()); const bool write_sm_masses = model.do_calculate_sm_pole_masses(); diff --git a/templates/spectrum_generator_interface.hpp.in b/templates/spectrum_generator_interface.hpp.in index f7304c24d..d50708816 100644 --- a/templates/spectrum_generator_interface.hpp.in +++ b/templates/spectrum_generator_interface.hpp.in @@ -52,7 +52,7 @@ public: const @ModelName@& get_model() const { return model; } @ModelName@& get_model() { return model; } - @ModelName@_slha get_model_slha() const { return @ModelName@_slha(model, settings.get(Spectrum_generator_settings::force_positive_masses) == 0.); } + @ModelName@_slha<@ModelName@ > get_model_slha() const { return @ModelName@_slha<@ModelName@ >(model, settings.get(Spectrum_generator_settings::force_positive_masses) == 0.); } const Problems<@ModelName@_info::NUMBER_OF_PARTICLES, @ModelName@_info::NUMBER_OF_PARAMETERS>& get_problems() const { return model.get_problems(); diff --git a/templates/standard_model_high_scale_spectrum_generator.hpp.in b/templates/standard_model_high_scale_spectrum_generator.hpp.in index 33f7c354e..120941205 100644 --- a/templates/standard_model_high_scale_spectrum_generator.hpp.in +++ b/templates/standard_model_high_scale_spectrum_generator.hpp.in @@ -26,7 +26,7 @@ #include "@ModelName@_two_scale_high_scale_constraint.hpp" #include "@ModelName@_two_scale_susy_scale_constraint.hpp" #include "@ModelName@_two_scale_model.hpp" -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_model_slha.hpp" #include "@ModelName@_standard_model_matching.hpp" #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_standard_model_two_scale_matching.hpp" @@ -58,7 +58,7 @@ public: std::tuple<@ModelName@, standard_model::StandardModel > get_models() const { return std::make_tuple(this->get_model(), eft); } - std::tuple<@ModelName@_slha, standard_model::StandardModel > get_models_slha() const + std::tuple<@ModelName@_slha<@ModelName@ >, standard_model::StandardModel > get_models_slha() const { return std::make_tuple(this->get_model_slha(), eft); } const standard_model::StandardModel& get_eft() const { return eft; } diff --git a/templates/standard_model_low_scale_spectrum_generator.hpp.in b/templates/standard_model_low_scale_spectrum_generator.hpp.in index 1c1c03ea1..3871bd7c5 100644 --- a/templates/standard_model_low_scale_spectrum_generator.hpp.in +++ b/templates/standard_model_low_scale_spectrum_generator.hpp.in @@ -24,7 +24,7 @@ #include "@ModelName@_spectrum_generator_interface.hpp" #include "@ModelName@_spectrum_generator.hpp" #include "@ModelName@_two_scale_model.hpp" -#include "@ModelName@_two_scale_model_slha.hpp" +#include "@ModelName@_model_slha.hpp" #include "@ModelName@_two_scale_susy_scale_constraint.hpp" #include "@ModelName@_standard_model_matching.hpp" #include "@ModelName@_input_parameters.hpp" @@ -56,7 +56,7 @@ public: std::tuple<@ModelName@, standard_model::StandardModel > get_models() const { return std::make_tuple(this->get_model(), eft); } - std::tuple<@ModelName@_slha, standard_model::StandardModel > get_models_slha() const + std::tuple<@ModelName@_slha<@ModelName@ >, standard_model::StandardModel > get_models_slha() const { return std::make_tuple(this->get_model_slha(), eft); } const standard_model::StandardModel& get_eft() const { return eft; } diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in index b1de1c28f..a6ea4d2f7 100644 --- a/templates/two_scale.mk.in +++ b/templates/two_scale.mk.in @@ -27,7 +27,6 @@ LIB@ModelName@_SRC += \ $(DIR)/@ModelName@_two_scale_initial_guesser.cpp \ $(DIR)/@ModelName@_two_scale_low_scale_constraint.cpp \ $(DIR)/@ModelName@_two_scale_model.cpp \ - $(DIR)/@ModelName@_two_scale_model_slha.cpp \ $(DIR)/@ModelName@_two_scale_spectrum_generator.cpp \ $(DIR)/@ModelName@_two_scale_susy_scale_constraint.cpp EXE@ModelName@_SRC += \ @@ -39,8 +38,6 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_high_scale_constraint.hpp \ $(DIR)/@ModelName@_initial_guesser.hpp \ $(DIR)/@ModelName@_low_scale_constraint.hpp \ - $(DIR)/@ModelName@_model.hpp \ - $(DIR)/@ModelName@_model_slha.hpp \ $(DIR)/@ModelName@_slha_io.hpp \ $(DIR)/@ModelName@_standard_model_matching.hpp \ $(DIR)/@ModelName@_standard_model_two_scale_matching.hpp \ @@ -50,7 +47,6 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_two_scale_initial_guesser.hpp \ $(DIR)/@ModelName@_two_scale_low_scale_constraint.hpp \ $(DIR)/@ModelName@_two_scale_model.hpp \ - $(DIR)/@ModelName@_two_scale_model_slha.hpp \ $(DIR)/@ModelName@_two_scale_spectrum_generator.hpp \ $(DIR)/@ModelName@_two_scale_susy_scale_constraint.hpp LL@ModelName@_SRC += \ diff --git a/templates/two_scale_model_slha.cpp.in b/templates/two_scale_model_slha.cpp.in deleted file mode 100644 index 45dff148c..000000000 --- a/templates/two_scale_model_slha.cpp.in +++ /dev/null @@ -1,157 +0,0 @@ -// ==================================================================== -// This file is part of FlexibleSUSY. -// -// FlexibleSUSY 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 3 of the License, -// or (at your option) any later version. -// -// FlexibleSUSY 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 FlexibleSUSY. If not, see -// . -// ==================================================================== - -// File generated at @DateAndTime@ - -/** - * @file @ModelName@_two_scale_model_slha.cpp - * @brief @ModelName@ model class wrapper for SLHA conversion - */ - -#include "@ModelName@_two_scale_model_slha.hpp" -#include "linalg2.hpp" -#include "slha_io.hpp" -#include "ckm.hpp" -#include "pmns.hpp" - -namespace flexiblesusy { - -#define CLASSNAME @ModelName@_slha -#define LOCALPHYSICAL(p) physical.p - -CLASSNAME::@ModelName@_slha(const @ModelName@_input_parameters& input_) - : @ModelName@(input_) - , physical_slha() - , ckm(Eigen::Matrix,3,3>::Identity()) - , pmns(Eigen::Matrix,3,3>::Identity()) - , convert_masses_to_slha(true) -{ -} - -/** - * Copy constructor. Copies from base class (two-scale model class in - * BPMZ convention) and converts parameters to SLHA. - * - * @param model_ model class in BPMZ convention - * @param do_convert_masses_to_slha whether to convert majorana - * fermion masses to SLHA convention (allow them to be negative) - */ -CLASSNAME::@ModelName@_slha(const @ModelName@& model_, - bool do_convert_masses_to_slha) - : @ModelName@(model_) - , convert_masses_to_slha(do_convert_masses_to_slha) -{ - convert_to_slha(); -} - -CLASSNAME::~@ModelName@_slha() -{ -} - -void CLASSNAME::clear() -{ - @ModelName@::clear(); - physical_slha.clear(); -} - -void CLASSNAME::calculate_spectrum() -{ - @ModelName@::calculate_spectrum(); - convert_to_slha(); -} - -void CLASSNAME::convert_to_slha() -{ - physical_slha = get_physical(); - - if (convert_masses_to_slha) - physical_slha.convert_to_slha(); - - convert_yukawa_couplings_to_slha(); - calculate_ckm_matrix(); - calculate_pmns_matrix(); - convert_trilinear_couplings_to_slha(); - convert_soft_squared_masses_to_slha(); -} - -void CLASSNAME::calculate_ckm_matrix() -{ -@calculateCKMMatrix@ -} - -void CLASSNAME::calculate_pmns_matrix() -{ -@calculatePMNSMatrix@ -} - -/** - * Convert Yukawa couplings to SLHA convention - */ -void CLASSNAME::convert_yukawa_couplings_to_slha() -{ -@convertYukawaCouplingsToSLHA@ -} - -/** - * Convert trilinear couplings to SLHA convention - */ -void CLASSNAME::convert_trilinear_couplings_to_slha() -{ -@convertTrilinearCouplingsToSLHA@ -} - -/** - * Convert soft-breaking squared mass parameters to SLHA convention - */ -void CLASSNAME::convert_soft_squared_masses_to_slha() -{ -@convertSoftSquaredMassesToSLHA@ -} - -const @ModelName@_physical& CLASSNAME::get_physical_slha() const -{ - return physical_slha; -} - -@ModelName@_physical& CLASSNAME::get_physical_slha() -{ - return physical_slha; -} - -void CLASSNAME::print(std::ostream& ostr) const -{ - @ModelName@::print(ostr); - - ostr << "----------------------------------------\n" - "SLHA convention:\n" - "----------------------------------------\n"; - physical_slha.print(ostr); -} - -void CLASSNAME::set_convert_masses_to_slha(bool flag) -{ - convert_masses_to_slha = flag; -} - -std::ostream& operator<<(std::ostream& ostr, const @ModelName@_slha& model) -{ - model.print(ostr); - return ostr; -} - -} // namespace flexiblesusy diff --git a/templates/two_scale_model_slha.hpp.in b/templates/two_scale_model_slha.hpp.in deleted file mode 100644 index ab74ecd0b..000000000 --- a/templates/two_scale_model_slha.hpp.in +++ /dev/null @@ -1,96 +0,0 @@ -// ==================================================================== -// This file is part of FlexibleSUSY. -// -// FlexibleSUSY 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 3 of the License, -// or (at your option) any later version. -// -// FlexibleSUSY 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 FlexibleSUSY. If not, see -// . -// ==================================================================== - -/** - * @file @ModelName@_two_scale_model_slha.hpp - * @brief contains wrapper class for model class in SLHA convention - */ - -// File generated at @DateAndTime@ - -#ifndef @ModelName@_TWO_SCALE_SLHA_H -#define @ModelName@_TWO_SCALE_SLHA_H - -#include "@ModelName@_two_scale_model.hpp" -#include "@ModelName@_physical.hpp" -#include "@ModelName@_model_slha.hpp" -#include "wrappers.hpp" - -#define PHYSICAL_SLHA(p) physical_slha.p -#define PHYSICAL_SLHA_REAL(p) Re(physical_slha.p) - -namespace flexiblesusy { - -class Two_scale; - -/** - * @class @ModelName@_slha - * @brief model class wrapper in SLHA convention - */ - -template<> -class @ModelName@_slha : public @ModelName@ { -public: - explicit @ModelName@_slha(const @ModelName@_input_parameters& input_ = @ModelName@_input_parameters()); - explicit @ModelName@_slha(const @ModelName@&, bool do_convert_masses_to_slha = true); - virtual ~@ModelName@_slha(); - - virtual void clear(); - void convert_to_slha(); ///< converts pole masses and couplings to SLHA convention - const Eigen::Matrix,3,3>& get_ckm_matrix() const { return ckm; } - const Eigen::Matrix,3,3>& get_pmns_matrix() const { return pmns; } - const @ModelName@_physical& get_physical_slha() const; ///< returns pole masses to SLHA convention - @ModelName@_physical& get_physical_slha(); ///< returns pole masses to SLHA convention - void set_convert_masses_to_slha(bool); ///< allow/disallow for negative majoran fermion masses - - // interface functions - virtual void calculate_spectrum(); - virtual void print(std::ostream&) const; - -@slhaPoleMassGetters@ -@slhaPoleMixingMatrixGetters@ -@slhaYukawaGetter@ -@slhaTrilinearCouplingsGetter@ -@slhaSoftSquaredMassesGetter@ -@slhaFerimonMixingMatricesGetters@ - -private: - @ModelName@_physical physical_slha; ///< contains the pole masses and mixings in slha convention - Eigen::Matrix,3,3> ckm; - Eigen::Matrix,3,3> pmns; - bool convert_masses_to_slha; ///< allow/disallow for negative majoran fermion masses -@slhaYukawaDef@ -@slhaFerimonMixingMatricesDef@ -@slhaTrilinearCouplingsDef@ -@slhaSoftSquaredMassesDef@ - - void calculate_ckm_matrix(); - void calculate_pmns_matrix(); - void convert_yukawa_couplings_to_slha(); - void convert_trilinear_couplings_to_slha(); - void convert_soft_squared_masses_to_slha(); -}; - -std::ostream& operator<<(std::ostream& ostr, const @ModelName@_slha& model); - -} // namespace flexiblesusy - -#undef PHYSICAL_SLHA -#undef PHYSICAL_SLHA_REAL - -#endif From 86d07499f8e9adab0e4b4eb501fcdbb45a7b5ef0 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 25 Nov 2016 17:34:44 +1030 Subject: [PATCH 17/34] only include enabled spectrum generators which are those solvers that are both compatible with the model and enabled during configuration --- meta/FlexibleSUSY.m | 29 ++++++++++++++++++++++++++++- templates/run.cpp.in | 4 +++- templates/run_cmd_line.cpp.in | 4 +++- templates/scan.cpp.in | 4 +++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index e3fb98ea4..20fe60fb6 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1363,17 +1363,44 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; +GuardedIncludeForBVPSolver[solver_, header_] := + Module[{result = "#ifdef "}, + Switch[solver, + FlexibleSUSY`TwoScaleSolver, + result = result <> "ENABLE_TWO_SCALE_SOLVER\n#include \"" <> header, + FlexibleSUSY`LatticeSolver, + result = result <> "ENABLE_LATTICE_SOLVER\n#include \"" <> header, + _, Print["Error: invalid BVP solver requested: ", solver]; + Quit[1]; + ]; + result <> "\"\n#endif" + ]; + +EnableSpectrumGenerator[solver_] := + Module[{header = 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 <> "_spectrum_generator.hpp"; + GuardedIncludeForBVPSolver[solver, header] <> "\n" + ]; + WriteUserExample[inputParameters_List, files_List] := Module[{parseCmdLineOptions, printCommandLineOptions, inputPars, - fillSMFermionPoleMasses = ""}, + fillSMFermionPoleMasses = "", solverIncludes = ""}, inputPars = {First[#], #[[3]]}& /@ inputParameters; parseCmdLineOptions = WriteOut`ParseCmdLineOptions[inputPars]; printCommandLineOptions = WriteOut`PrintCmdLineOptions[inputPars]; fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[]; + (solverIncludes = solverIncludes <> EnableSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; WriteOut`ReplaceInFiles[files, { "@parseCmdLineOptions@" -> IndentText[IndentText[parseCmdLineOptions]], "@printCommandLineOptions@" -> IndentText[IndentText[printCommandLineOptions]], "@fillSMFermionPoleMasses@" -> IndentText[fillSMFermionPoleMasses], + "@solverIncludes@" -> solverIncludes, Sequence @@ GeneralReplacementRules[] } ]; ]; diff --git a/templates/run.cpp.in b/templates/run.cpp.in index 4fd9f5c67..19a54de3f 100644 --- a/templates/run.cpp.in +++ b/templates/run.cpp.in @@ -18,12 +18,14 @@ // File generated at @DateAndTime@ +#include "config.h" + #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_slha_io.hpp" -#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_utilities.hpp" +@solverIncludes@ #include "physical_input.hpp" #include "spectrum_generator_settings.hpp" #include "lowe.h" diff --git a/templates/run_cmd_line.cpp.in b/templates/run_cmd_line.cpp.in index ec0c7cb42..9ce9aa5ce 100644 --- a/templates/run_cmd_line.cpp.in +++ b/templates/run_cmd_line.cpp.in @@ -18,11 +18,13 @@ // File generated at @DateAndTime@ +#include "config.h" + #include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_slha_io.hpp" +@solverIncludes@ #include "command_line_options.hpp" #include "lowe.h" #include "logger.hpp" diff --git a/templates/scan.cpp.in b/templates/scan.cpp.in index ea48b4bfa..c655b83cd 100644 --- a/templates/scan.cpp.in +++ b/templates/scan.cpp.in @@ -18,10 +18,12 @@ // File generated at @DateAndTime@ +#include "config.h" + #include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_two_scale_spectrum_generator.hpp" #include "@ModelName@_model_slha.hpp" +@solverIncludes@ #include "command_line_options.hpp" #include "scan.hpp" #include "lowe.h" From e33cc147c0e39b30bacd5d8d868ba6cd49d3a31d Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Sun, 27 Nov 2016 22:53:41 +1030 Subject: [PATCH 18/34] Allow multiple solvers when running SLHA file or scanning using the old approach with a templated run method --- meta/FlexibleSUSY.m | 60 +++++++++++++++--- templates/run.cpp.in | 139 ++++++++++++++++++++++++++++++++---------- templates/scan.cpp.in | 65 ++++++++++++++------ 3 files changed, 203 insertions(+), 61 deletions(-) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 20fe60fb6..16b88502f 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1363,44 +1363,88 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; -GuardedIncludeForBVPSolver[solver_, header_] := +EnableForBVPSolver[solver_, statements_String] := Module[{result = "#ifdef "}, Switch[solver, FlexibleSUSY`TwoScaleSolver, - result = result <> "ENABLE_TWO_SCALE_SOLVER\n#include \"" <> header, + result = result <> "ENABLE_TWO_SCALE_SOLVER\n" <> statements, FlexibleSUSY`LatticeSolver, - result = result <> "ENABLE_LATTICE_SOLVER\n#include \"" <> header, + result = result <> "ENABLE_LATTICE_SOLVER\n" <> statements, _, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]; ]; - result <> "\"\n#endif" + result <> "#endif" ]; EnableSpectrumGenerator[solver_] := - Module[{header = FlexibleSUSY`FSModelName}, + 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 <> "_spectrum_generator.hpp"; - GuardedIncludeForBVPSolver[solver, header] <> "\n" + 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]; + ]; + 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"] + <> "break;\n"; + result = "case " <> key <> ":\n" <> IndentText[body]; + EnableForBVPSolver[solver, IndentText[result]] <> "\n" + ]; + +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]; + ]; + body = "run_scan<" <> class <> ">(input, range);\nbreak;\n"; + result = "case " <> key <> ":\n" <> IndentText[body]; + EnableForBVPSolver[solver, IndentText[result]] <> "\n" ]; WriteUserExample[inputParameters_List, files_List] := Module[{parseCmdLineOptions, printCommandLineOptions, inputPars, - fillSMFermionPoleMasses = "", solverIncludes = ""}, + fillSMFermionPoleMasses = "", solverIncludes = "", + runEnabledSolvers = "", scanEnabledSolvers = "", defaultSolverType}, inputPars = {First[#], #[[3]]}& /@ inputParameters; parseCmdLineOptions = WriteOut`ParseCmdLineOptions[inputPars]; printCommandLineOptions = WriteOut`PrintCmdLineOptions[inputPars]; fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[]; (solverIncludes = solverIncludes <> EnableSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; + (runEnabledSolvers = runEnabledSolvers <> RunEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; + (scanEnabledSolvers = scanEnabledSolvers <> ScanEnabledSpectrumGenerator[#])& /@ 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] + ]; + ]; WriteOut`ReplaceInFiles[files, { "@parseCmdLineOptions@" -> IndentText[IndentText[parseCmdLineOptions]], "@printCommandLineOptions@" -> IndentText[IndentText[printCommandLineOptions]], "@fillSMFermionPoleMasses@" -> IndentText[fillSMFermionPoleMasses], "@solverIncludes@" -> solverIncludes, + "@runEnabledSolvers@" -> runEnabledSolvers, + "@scanEnabledSolvers@" -> scanEnabledSolvers, + "@defaultSolverType@" -> defaultSolverType, Sequence @@ GeneralReplacementRules[] } ]; ]; diff --git a/templates/run.cpp.in b/templates/run.cpp.in index 19a54de3f..729ffb590 100644 --- a/templates/run.cpp.in +++ b/templates/run.cpp.in @@ -34,46 +34,41 @@ #include #include -int main(int argc, char* argv[]) +/** + * @brief Runs the spectrum generator of type \a solver_type + * @tparam solver_type solver type + * @param slha_io SLHA input + * @param spectrum_generator_settings + * @param slha_output_file output file for SLHA output + * @param database_output_file output file for SQLite database + * @param spectrum_file output file for the mass spectrum + * @param rgflow_file output file for the RG flow + * @return value of spectrum_generator::get_exit_code() + */ +template +int run_solver(flexiblesusy::@ModelName@_slha_io& slha_io, + const flexiblesusy::Spectrum_generator_settings& spectrum_generator_settings, + const std::string& slha_output_file, + const std::string& database_output_file, + const std::string& spectrum_file, + const std::string& rgflow_file) { using namespace flexiblesusy; - typedef Two_scale algorithm_type; - - Command_line_options options(argc, argv); - if (options.must_print_model_info()) - @ModelName@_info::print(std::cout); - if (options.must_exit()) - return options.status(); - const std::string database_output_file(options.get_database_output_file()); - const std::string rgflow_file(options.get_rgflow_file()); - const std::string slha_input_source(options.get_slha_input_file()); - const std::string slha_output_file(options.get_slha_output_file()); - const std::string spectrum_file(options.get_spectrum_file()); - @ModelName@_slha_io slha_io; Physical_input physical_input; // extra non-SLHA physical input - Spectrum_generator_settings spectrum_generator_settings; softsusy::QedQcd qedqcd; @ModelName@_input_parameters input; - if (slha_input_source.empty()) { - ERROR("No SLHA input source given!\n" - " Please provide one via the option --slha-input-file="); - return EXIT_FAILURE; - } - try { - slha_io.read_from_source(slha_input_source); slha_io.fill(qedqcd); slha_io.fill(input); slha_io.fill(physical_input); - slha_io.fill(spectrum_generator_settings); } catch (const Error& error) { ERROR(error.what()); return EXIT_FAILURE; } - @ModelName@_spectrum_generator spectrum_generator; + @ModelName@_spectrum_generator spectrum_generator; spectrum_generator.set_settings(spectrum_generator_settings); spectrum_generator.set_parameter_output_scale( slha_io.get_parameter_output_scale()); @@ -92,14 +87,16 @@ int main(int argc, char* argv[]) if (spectrum_generator_settings.get(Spectrum_generator_settings::calculate_observables)) observables = calculate_observables(std::get<0>(models), qedqcd, physical_input); + const bool show_result = !problems.have_problem() || + spectrum_generator_settings.get(Spectrum_generator_settings::force_output); // SLHA output if (!slha_output_file.empty()) { slha_io.set_spinfo(problems); slha_io.set_input(input); - if (!problems.have_problem() || - spectrum_generator_settings.get(Spectrum_generator_settings::force_output)) { + if (show_result) { slha_io.set_print_imaginary_parts_of_majorana_mixings( - spectrum_generator_settings.get(Spectrum_generator_settings::force_positive_masses)); + spectrum_generator_settings.get( + Spectrum_generator_settings::force_positive_masses)); slha_io.set_spectrum(models); slha_io.set_extra(std::get<0>(models), scales, observables); } @@ -107,11 +104,10 @@ int main(int argc, char* argv[]) slha_io.write_to(slha_output_file); } - if (!database_output_file.empty() && - (!problems.have_problem() || - spectrum_generator_settings.get(Spectrum_generator_settings::force_output))) { - @ModelName@_database::to_database(database_output_file, std::get<0>(models), &qedqcd, - &physical_input, &observables); + if (!database_output_file.empty() && show_result) { + @ModelName@_database::to_database( + database_output_file, std::get<0>(models), &qedqcd, + &physical_input, &observables); } if (!spectrum_file.empty()) @@ -120,7 +116,84 @@ int main(int argc, char* argv[]) if (!rgflow_file.empty()) spectrum_generator.write_running_couplings(rgflow_file); - const int exit_code = spectrum_generator.get_exit_code(); + return spectrum_generator.get_exit_code(); +} + +/** + * @brief Runs the spectrum generator + * + * Reads the solver type from \a spectrum_generator_settings and calls + * run_solver() with the corresponding solver type. + * + * @param slha_io SLHA input + * @param spectrum_generator_settings + * @param slha_output_file output file for SLHA output + * @param database_output_file output file for SQLite database + * @param spectrum_file output file for the mass spectrum + * @param rgflow_file output file for the RG flow + * @return return value of run_solver<>() + */ +int run( + flexiblesusy::@ModelName@_slha_io& slha_io, + const flexiblesusy::Spectrum_generator_settings& spectrum_generator_settings, + const std::string& slha_output_file, + const std::string& database_output_file, + const std::string& spectrum_file, + const std::string& rgflow_file) +{ + using namespace flexiblesusy; + + int exit_code; + const int solver_type + = static_cast(spectrum_generator_settings.get( + Spectrum_generator_settings::algorithm)); + + switch (solver_type) { +@runEnabledSolvers@ + default: + ERROR("unknown solver type: " << solver_type); + exit_code = -1; + break; + } + + return exit_code; +} + +int main(int argc, char* argv[]) +{ + using namespace flexiblesusy; + + Command_line_options options(argc, argv); + if (options.must_print_model_info()) + @ModelName@_info::print(std::cout); + if (options.must_exit()) + return options.status(); + + const std::string database_output_file(options.get_database_output_file()); + const std::string rgflow_file(options.get_rgflow_file()); + const std::string slha_input_source(options.get_slha_input_file()); + const std::string slha_output_file(options.get_slha_output_file()); + const std::string spectrum_file(options.get_spectrum_file()); + @ModelName@_slha_io slha_io; + Spectrum_generator_settings spectrum_generator_settings; + + if (slha_input_source.empty()) { + ERROR("No SLHA input source given!\n" + " Please provide one via the option --slha-input-file="); + return EXIT_FAILURE; + } + + try { + slha_io.read_from_source(slha_input_source); + slha_io.fill(spectrum_generator_settings); + } catch (const Error& error) { + ERROR(error.what()); + return EXIT_FAILURE; + } + + const int exit_code + = run(slha_io, spectrum_generator_settings, slha_output_file, + database_output_file, spectrum_file, rgflow_file); return exit_code; } diff --git a/templates/scan.cpp.in b/templates/scan.cpp.in index c655b83cd..9fcff735f 100644 --- a/templates/scan.cpp.in +++ b/templates/scan.cpp.in @@ -42,17 +42,23 @@ void print_usage() "Usage: scan_@ModelName@.x [options]\n" "Options:\n" @printCommandLineOptions@ + " --solver-type= select solver type\n" " --help,-h print this help message" << std::endl; } void set_command_line_parameters(const Dynamic_array_view& args, - @ModelName@_input_parameters& input) + @ModelName@_input_parameters& input, + int& solver_type) { for (int i = 1; i < args.size(); ++i) { const auto option = args[i]; @parseCmdLineOptions@ + if (Command_line_options::get_parameter_value( + option, "--solver-type=", solver_type)) + continue; + if (strcmp(option,"--help") == 0 || strcmp(option,"-h") == 0) { print_usage(); exit(EXIT_SUCCESS); @@ -63,33 +69,18 @@ void set_command_line_parameters(const Dynamic_array_view& args, } } -} // namespace flexiblesusy - - -int main(int argc, char* argv[]) +template +void run_scan( + @ModelName@_input_parameters& input, const std::vector& range) { - using namespace flexiblesusy; - typedef Two_scale algorithm_type; - - @ModelName@_input_parameters input; - set_command_line_parameters(make_dynamic_array_view(&argv[0], argc), input); - softsusy::QedQcd qedqcd; - @ModelName@_spectrum_generator spectrum_generator; + @ModelName@_spectrum_generator spectrum_generator; spectrum_generator.set_precision_goal(1.0e-4); spectrum_generator.set_max_iterations(0); // 0 == automatic spectrum_generator.set_calculate_sm_masses(0); // 0 == no spectrum_generator.set_parameter_output_scale(0); // 0 == susy scale - const std::vector range(float_range(0., 100., 10)); - - cout << "# " - << std::setw(12) << std::left << "@InputParameter_1@" << ' ' - << std::setw(12) << std::left << "M@HiggsBoson_0@/GeV" << ' ' - << std::setw(12) << std::left << "error" - << '\n'; - for (const auto p: range) { @setInputParameterTo[1,p]@ @@ -110,6 +101,40 @@ int main(int argc, char* argv[]) } cout << '\n'; } +} + +void scan(int solver_type, @ModelName@_input_parameters& input, + const std::vector& range) +{ + switch (solver_type) { +@scanEnabledSolvers@ + default: + ERROR("unknown solver type: " << solver_type); + exit(EXIT_FAILURE); + } +} + +} // namespace flexiblesusy + + +int main(int argc, char* argv[]) +{ + using namespace flexiblesusy; + + @ModelName@_input_parameters input; + int solver_type = @defaultSolverType@; + set_command_line_parameters(make_dynamic_array_view(&argv[0], argc), input, + solver_type); + + cout << "# " + << std::setw(12) << std::left << "@InputParameter_1@" << ' ' + << std::setw(12) << std::left << "M@HiggsBoson_0@/GeV" << ' ' + << std::setw(12) << std::left << "error" + << '\n'; + + const std::vector range(float_range(0., 100., 10)); + + scan(solver_type, input, range); return 0; } From ccd02f370e885445fb3ac5fd97fd05e32c0aa1f1 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Mon, 28 Nov 2016 10:17:10 +1030 Subject: [PATCH 19/34] Allow multiple solvers when running from command line --- meta/FlexibleSUSY.m | 26 ++++++++++++--- templates/run_cmd_line.cpp.in | 61 ++++++++++++++++++++++++++--------- 2 files changed, 67 insertions(+), 20 deletions(-) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 16b88502f..f79b33cc5 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1417,17 +1417,32 @@ corresponding tadpole is real or imaginary (only in models with CP 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]; + ]; + body = "exit_code = run_solver<" <> class <> ">(input);\nbreak;\n"; + result = "case " <> key <> ":\n" <> IndentText[body]; + EnableForBVPSolver[solver, IndentText[result]] <> "\n" + ]; + WriteUserExample[inputParameters_List, files_List] := Module[{parseCmdLineOptions, printCommandLineOptions, inputPars, fillSMFermionPoleMasses = "", solverIncludes = "", - runEnabledSolvers = "", scanEnabledSolvers = "", defaultSolverType}, + runEnabledSolvers = "", scanEnabledSolvers = "", + runEnabledCmdLineSolvers = "", defaultSolverType}, inputPars = {First[#], #[[3]]}& /@ inputParameters; parseCmdLineOptions = WriteOut`ParseCmdLineOptions[inputPars]; printCommandLineOptions = WriteOut`PrintCmdLineOptions[inputPars]; fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[]; (solverIncludes = solverIncludes <> EnableSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; - (runEnabledSolvers = runEnabledSolvers <> RunEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; - (scanEnabledSolvers = scanEnabledSolvers <> ScanEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; + (runEnabledSolvers = runEnabledSolvers <> RunEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; + (scanEnabledSolvers = scanEnabledSolvers <> ScanEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; + (runEnabledCmdLineSolvers = runEnabledCmdLineSolvers <> RunCmdLineEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; If[Length[FlexibleSUSY`FSBVPSolvers] == 0, defaultSolverType = "-1", Which[FlexibleSUSY`FSBVPSolvers[[1]] === FlexibleSUSY`TwoScaleSolver, @@ -1442,8 +1457,9 @@ corresponding tadpole is real or imaginary (only in models with CP "@printCommandLineOptions@" -> IndentText[IndentText[printCommandLineOptions]], "@fillSMFermionPoleMasses@" -> IndentText[fillSMFermionPoleMasses], "@solverIncludes@" -> solverIncludes, - "@runEnabledSolvers@" -> runEnabledSolvers, - "@scanEnabledSolvers@" -> scanEnabledSolvers, + "@runEnabledSolvers@" -> runEnabledSolvers, + "@scanEnabledSolvers@" -> scanEnabledSolvers, + "@runEnabledCmdLineSolvers@" -> runEnabledCmdLineSolvers, "@defaultSolverType@" -> defaultSolverType, Sequence @@ GeneralReplacementRules[] } ]; diff --git a/templates/run_cmd_line.cpp.in b/templates/run_cmd_line.cpp.in index 9ce9aa5ce..14a8f3dcc 100644 --- a/templates/run_cmd_line.cpp.in +++ b/templates/run_cmd_line.cpp.in @@ -41,17 +41,23 @@ void print_usage() "Usage: run_cmd_line_@ModelName@.x [options]\n" "Options:\n" @printCommandLineOptions@ + " --solver-type= select solver type\n" " --help,-h print this help message" << std::endl; } void set_command_line_parameters(const Dynamic_array_view& args, - @ModelName@_input_parameters& input) + @ModelName@_input_parameters& input, + int& solver_type) { for (int i = 1; i < args.size(); ++i) { const auto option = args[i]; @parseCmdLineOptions@ + if (Command_line_options::get_parameter_value( + option, "--solver-type=", solver_type)) + continue; + if (strcmp(option,"--help") == 0 || strcmp(option,"-h") == 0) { print_usage(); exit(EXIT_SUCCESS); @@ -62,21 +68,13 @@ void set_command_line_parameters(const Dynamic_array_view& args, } } -} // namespace flexiblesusy - - -int main(int argc, char* argv[]) +template +int run_solver(const @ModelName@_input_parameters& input) { - using namespace flexiblesusy; - typedef Two_scale algorithm_type; - - @ModelName@_input_parameters input; - set_command_line_parameters(make_dynamic_array_view(&argv[0], argc), input); - Physical_input physical_input; softsusy::QedQcd qedqcd; - @ModelName@_spectrum_generator spectrum_generator; + @ModelName@_spectrum_generator spectrum_generator; spectrum_generator.set_precision_goal(1.0e-4); spectrum_generator.set_beta_zero_threshold(1e-11); spectrum_generator.set_max_iterations(0); // 0 == automatic @@ -89,7 +87,6 @@ int main(int argc, char* argv[]) spectrum_generator.run(qedqcd, input); - const int exit_code = spectrum_generator.get_exit_code(); const auto model = spectrum_generator.get_model_slha(); @ModelName@_scales scales; @@ -97,12 +94,46 @@ int main(int argc, char* argv[]) scales.SUSYScale = spectrum_generator.get_susy_scale(); scales.LowScale = spectrum_generator.get_low_scale(); - const auto observables = calculate_observables(model, qedqcd, physical_input); + const auto observables = calculate_observables( + model, qedqcd, physical_input); // SLHA output - SLHAea::Coll slhaea(@ModelName@_slha_io::fill_slhaea(model, qedqcd, scales, observables)); + SLHAea::Coll slhaea(@ModelName@_slha_io::fill_slhaea( + model, qedqcd, scales, observables)); std::cout << slhaea; + return spectrum_generator.get_exit_code(); +} + +int run(int solver_type, const @ModelName@_input_parameters& input) +{ + int exit_code; + + switch (solver_type) { +@runEnabledCmdLineSolvers@ + default: + ERROR("unknown solver type: " << solver_type); + exit_code = -1; + break; + } + + return exit_code; +} + +} // namespace flexiblesusy + + +int main(int argc, char* argv[]) +{ + using namespace flexiblesusy; + + @ModelName@_input_parameters input; + int solver_type = @defaultSolverType@; + set_command_line_parameters(make_dynamic_array_view(&argv[0], argc), input, + solver_type); + + const int exit_code = run(solver_type, input); + return exit_code; } From 03bd63b0588b7c95bd4c9e7ba4fc3543f450c114 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Mon, 28 Nov 2016 12:31:25 +1030 Subject: [PATCH 20/34] Allow user examples to be compiled for all solvers --- templates/module.mk | 6 +++--- templates/module.mk.in | 5 ++++- templates/two_scale.mk.in | 4 ---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/templates/module.mk b/templates/module.mk index ed45384ee..cfbf2b9ce 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -20,6 +20,9 @@ BASE_TEMPLATES := \ $(DIR)/physical.cpp.in \ $(DIR)/plot_rgflow.gnuplot.in \ $(DIR)/plot_spectrum.gnuplot.in \ + $(DIR)/run.cpp.in \ + $(DIR)/run_cmd_line.cpp.in \ + $(DIR)/scan.cpp.in \ $(DIR)/soft_beta_.cpp.in \ $(DIR)/soft_parameters.hpp.in \ $(DIR)/soft_parameters.cpp.in \ @@ -42,10 +45,7 @@ TWO_SCALE_TEMPLATES := \ $(DIR)/low_scale_constraint.hpp.in \ $(DIR)/low_scale_spectrum_generator.hpp.in \ $(DIR)/low_scale_spectrum_generator.cpp.in \ - $(DIR)/run.cpp.in \ $(DIR)/run.m.in \ - $(DIR)/run_cmd_line.cpp.in \ - $(DIR)/scan.cpp.in \ $(DIR)/slha_io.hpp.in \ $(DIR)/slha_io.cpp.in \ $(DIR)/standard_model_high_scale_spectrum_generator.hpp.in \ diff --git a/templates/module.mk.in b/templates/module.mk.in index e37f094ca..02b7b06ba 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -41,7 +41,10 @@ LIB@CLASSNAME@_SRC := \ $(DIR)/@CLASSNAME@_soft_parameters.cpp \ $(DIR)/@CLASSNAME@_utilities.cpp -EXE@CLASSNAME@_SRC := +EXE@CLASSNAME@_SRC := \ + $(DIR)/run_@CLASSNAME@.cpp \ + $(DIR)/run_cmd_line_@CLASSNAME@.cpp \ + $(DIR)/scan_@CLASSNAME@.cpp LL@CLASSNAME@_LIB := LL@CLASSNAME@_OBJ := LL@CLASSNAME@_SRC := diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in index a6ea4d2f7..fa1240b48 100644 --- a/templates/two_scale.mk.in +++ b/templates/two_scale.mk.in @@ -29,10 +29,6 @@ LIB@ModelName@_SRC += \ $(DIR)/@ModelName@_two_scale_model.cpp \ $(DIR)/@ModelName@_two_scale_spectrum_generator.cpp \ $(DIR)/@ModelName@_two_scale_susy_scale_constraint.cpp -EXE@ModelName@_SRC += \ - $(DIR)/run_@ModelName@.cpp \ - $(DIR)/run_cmd_line_@ModelName@.cpp \ - $(DIR)/scan_@ModelName@.cpp LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_convergence_tester.hpp \ $(DIR)/@ModelName@_high_scale_constraint.hpp \ From 8750fb48669e865ffe63402b286f37772f079054 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Mon, 28 Nov 2016 12:32:24 +1030 Subject: [PATCH 21/34] Adapt tests to new parametrisation of SLHA wrapper class --- test/test_CMSSMCKM_tree_level_spectrum.cpp | 4 ++-- test/test_CMSSM_slha.cpp | 10 +++++----- test/test_CMSSM_slha_input.cpp | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/test_CMSSMCKM_tree_level_spectrum.cpp b/test/test_CMSSMCKM_tree_level_spectrum.cpp index f272ce3c8..399186982 100644 --- a/test/test_CMSSMCKM_tree_level_spectrum.cpp +++ b/test/test_CMSSMCKM_tree_level_spectrum.cpp @@ -9,7 +9,7 @@ #include "conversion.hpp" #include "flavoursoft.h" #include "CMSSMCKM_two_scale_model.hpp" -#include "CMSSMCKM_two_scale_model_slha.hpp" +#include "CMSSMCKM_model_slha.hpp" #include "CMSSMCKM_two_scale_high_scale_constraint.hpp" #include "CMSSMCKM_input_parameters.hpp" @@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE( test_CMSSMCKM_tree_level_masses ) m0.calculate_DRbar_masses(); s.calcDrBarPars(); - CMSSMCKM_slha m(m0); // converts to SLHA-2 + CMSSMCKM_slha > m(m0); // converts to SLHA-2 // re-set model parameters to super-CKM basis m.set_Yu(m.get_Yu_slha().matrix().cast >().asDiagonal()); diff --git a/test/test_CMSSM_slha.cpp b/test/test_CMSSM_slha.cpp index 72275aa15..e9203e7ab 100644 --- a/test/test_CMSSM_slha.cpp +++ b/test/test_CMSSM_slha.cpp @@ -5,7 +5,7 @@ #include #include "CMSSM_two_scale_model.hpp" -#include "CMSSM_two_scale_model_slha.hpp" +#include "CMSSM_model_slha.hpp" #include "wrappers.hpp" #include "ckm.hpp" #include "utils.h" @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE( test_CMSSM_two_scale_slha_cctor ) // fill SLHA wrapper class // automatic conversion to SLHA happens here - CMSSM_slha slha_model(model); + CMSSM_slha > slha_model(model); // check that model wrapper is in SLHA convention BOOST_CHECK_GT(slha_model.get_physical_slha().MChi.maxCoeff(), 0.); @@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE( test_CMSSM_two_scale_slha_cctor ) BOOST_CHECK_EQUAL(slha_model.get_physical_slha().ZN.imag().maxCoeff(), 0.); // no automatic conversion - CMSSM_slha slha_model_not_converted(model, false); + CMSSM_slha > slha_model_not_converted(model, false); // check that model is in non-SLHA convention BOOST_CHECK_GT(slha_model_not_converted.get_physical().MChi.maxCoeff(), 0.); @@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE( test_CMSSM_two_scale_slha_calculate_spectrum ) Ye(2,2) = 1.77699 * root2 / (vev * cosBeta); mm0 = sqr(m0) * Eigen::Matrix::Identity(); - CMSSM_slha model(input); + CMSSM_slha > model(input); model.set_scale(91); model.set_loops(1); model.set_g1(g1); @@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE( test_CMSSM_two_scale_slha_diagonal_yukawas ) 0.3, 0.6, 1.77699 * root2 / (vev * sinBeta); mm0 = sqr(m0) * Eigen::Matrix::Identity(); - CMSSM_slha model(input); + CMSSM_slha > model(input); model.set_scale(91); model.set_loops(1); model.set_g1(g1); diff --git a/test/test_CMSSM_slha_input.cpp b/test/test_CMSSM_slha_input.cpp index 08f864df1..c1a88a78d 100644 --- a/test/test_CMSSM_slha_input.cpp +++ b/test/test_CMSSM_slha_input.cpp @@ -4,14 +4,15 @@ #include -#include "CMSSM_two_scale_model_slha.hpp" +#include "CMSSM_model_slha.hpp" #include "CMSSM_slha_io.hpp" +#include "CMSSM_two_scale_model.hpp" using namespace flexiblesusy; BOOST_AUTO_TEST_CASE( test_CMSSM_slha_reading ) { - CMSSM_slha model; + CMSSM_slha > model; model.do_calculate_sm_pole_masses(true); const double scale = 91.0; From a1ef6955424db1498d4509d06c4695949a717a1a Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Mon, 28 Nov 2016 14:04:23 +1030 Subject: [PATCH 22/34] Use consistent terminology, "algorithm" -> "solver" --- configure | 6 +++--- meta/FlexibleSUSY.m | 2 +- src/spectrum_generator_settings.cpp | 6 +++--- src/spectrum_generator_settings.hpp | 2 +- templates/LesHouches.in | 2 +- templates/run.cpp.in | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 1c0a59a54..a8c99aa1e 100755 --- a/configure +++ b/configure @@ -2413,9 +2413,6 @@ Package directories, compilation settings and model selection --with-addons= Comma separated list of addons to be build (default: $ADDONS) - --with-solvers= Comma separated list of RG solver algorithms - (default: $SOLVERS) - possible values: all $available_solvers --with-blas-libdir= Path to search for BLAS library --with-blas-libs= BLAS libraries to be linked --with-boost-libdir= Path to search for BOOST libraries @@ -2450,6 +2447,9 @@ cat < descriptions = { "precision goal", "max. iterations (0 = automatic)", - "algorithm (0 = two_scale)", + "solver (0 = two_scale)", "calculate SM pole masses", "pole mass loop order", "EWSB loop order", @@ -84,7 +84,7 @@ void Spectrum_generator_settings::set(Settings o, double value) * |----------------------------------|------------------------------|-----------------| * | precision | any positive double | 1.0e-4 | * | max_iterations | any positive double | 0 (= automatic) | - * | algorithm | 0 (two-scale) or 1 (lattice) | 0 (= two-scale) | + * | 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) | @@ -111,7 +111,7 @@ void Spectrum_generator_settings::reset() { values[precision] = 1.0e-4; values[max_iterations] = 0.; // 0 = automatic - values[algorithm] = 0.; // 0 = two-scale + values[solver] = 0.; // 0 = two-scale values[calculate_sm_masses] = 0.; // 0 = false values[pole_mass_loop_order] = 2.; values[ewsb_loop_order] = 2.; diff --git a/src/spectrum_generator_settings.hpp b/src/spectrum_generator_settings.hpp index ee273c99d..303f4f78a 100644 --- a/src/spectrum_generator_settings.hpp +++ b/src/spectrum_generator_settings.hpp @@ -39,7 +39,7 @@ class Spectrum_generator_settings { enum Settings : unsigned { precision, ///< [0] overall precision goal max_iterations, ///< [1] maximum number of iterations (0 = automatic) - algorithm, ///< [2] RG solver algorithm (0 = two-scale) + solver, ///< [2] RG solver algorithm (0 = two-scale) calculate_sm_masses, ///< [3] calculate Standard Model pole masses pole_mass_loop_order, ///< [4] loop-order for calculation of pole masses ewsb_loop_order, ///< [5] loop-order for solving the EWSB eqs. diff --git a/templates/LesHouches.in b/templates/LesHouches.in index 17b8539ed..66adc49c7 100644 --- a/templates/LesHouches.in +++ b/templates/LesHouches.in @@ -3,7 +3,7 @@ Block MODSEL # Select model Block FlexibleSUSY 0 1.000000000e-04 # precision goal 1 0 # max. iterations (0 = automatic) - 2 0 # algorithm (0 = two_scale, 1 = lattice) + 2 0 # solver (0 = two_scale, 1 = lattice) 3 0 # calculate SM pole masses 4 2 # pole mass loop order 5 2 # EWSB loop order diff --git a/templates/run.cpp.in b/templates/run.cpp.in index 729ffb590..86c17a1da 100644 --- a/templates/run.cpp.in +++ b/templates/run.cpp.in @@ -146,7 +146,7 @@ int run( int exit_code; const int solver_type = static_cast(spectrum_generator_settings.get( - Spectrum_generator_settings::algorithm)); + Spectrum_generator_settings::solver)); switch (solver_type) { @runEnabledSolvers@ From 43898992168ea2284c70b05ab06129c9b920fb43 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Mon, 28 Nov 2016 22:28:17 +1030 Subject: [PATCH 23/34] Build SLHA I/O class for all solver types --- templates/module.mk.in | 2 ++ templates/slha_io.cpp.in | 1 - templates/two_scale.mk.in | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/module.mk.in b/templates/module.mk.in index 02b7b06ba..bf5f8c832 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -37,6 +37,7 @@ LIB@CLASSNAME@_SRC := \ $(DIR)/@CLASSNAME@_mass_eigenstates.cpp \ $(DIR)/@CLASSNAME@_observables.cpp \ $(DIR)/@CLASSNAME@_physical.cpp \ + $(DIR)/@CLASSNAME@_slha_io.cpp \ $(DIR)/@CLASSNAME@_susy_parameters.cpp \ $(DIR)/@CLASSNAME@_soft_parameters.cpp \ $(DIR)/@CLASSNAME@_utilities.cpp @@ -60,6 +61,7 @@ LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_model_slha.hpp \ $(DIR)/@CLASSNAME@_observables.hpp \ $(DIR)/@CLASSNAME@_physical.hpp \ + $(DIR)/@CLASSNAME@_slha_io.hpp \ $(DIR)/@CLASSNAME@_spectrum_generator.hpp \ $(DIR)/@CLASSNAME@_spectrum_generator_interface.hpp \ $(DIR)/@CLASSNAME@_soft_parameters.hpp \ diff --git a/templates/slha_io.cpp.in b/templates/slha_io.cpp.in index e3987e371..0bdfebcd8 100644 --- a/templates/slha_io.cpp.in +++ b/templates/slha_io.cpp.in @@ -20,7 +20,6 @@ #include "@ModelName@_slha_io.hpp" #include "@ModelName@_input_parameters.hpp" -#include "@ModelName@_info.hpp" #include "logger.hpp" #include "wrappers.hpp" #include "numerics2.hpp" diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in index fa1240b48..500e7eee6 100644 --- a/templates/two_scale.mk.in +++ b/templates/two_scale.mk.in @@ -19,7 +19,6 @@ @ModelName@_INCLUDE_MK += $(DIR)/two_scale.mk LIB@ModelName@_SRC += \ - $(DIR)/@ModelName@_slha_io.cpp \ $(DIR)/@ModelName@_standard_model_matching.cpp \ $(DIR)/@ModelName@_standard_model_two_scale_matching.cpp \ $(DIR)/@ModelName@_two_scale_convergence_tester.cpp \ @@ -34,7 +33,6 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_high_scale_constraint.hpp \ $(DIR)/@ModelName@_initial_guesser.hpp \ $(DIR)/@ModelName@_low_scale_constraint.hpp \ - $(DIR)/@ModelName@_slha_io.hpp \ $(DIR)/@ModelName@_standard_model_matching.hpp \ $(DIR)/@ModelName@_standard_model_two_scale_matching.hpp \ $(DIR)/@ModelName@_susy_scale_constraint.hpp \ From 936027d1a0a608c01cd5511824534c6f7636c9e3 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Wed, 30 Nov 2016 11:10:59 +1030 Subject: [PATCH 24/34] Add missing header inclusion --- templates/run.cpp.in | 1 + templates/run_cmd_line.cpp.in | 1 + templates/scan.cpp.in | 1 + 3 files changed, 3 insertions(+) diff --git a/templates/run.cpp.in b/templates/run.cpp.in index 86c17a1da..7fa2f4169 100644 --- a/templates/run.cpp.in +++ b/templates/run.cpp.in @@ -23,6 +23,7 @@ #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_slha_io.hpp" +#include "@ModelName@_spectrum_generator.hpp" #include "@ModelName@_utilities.hpp" @solverIncludes@ diff --git a/templates/run_cmd_line.cpp.in b/templates/run_cmd_line.cpp.in index 14a8f3dcc..1b902403d 100644 --- a/templates/run_cmd_line.cpp.in +++ b/templates/run_cmd_line.cpp.in @@ -23,6 +23,7 @@ #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_slha_io.hpp" +#include "@ModelName@_spectrum_generator.hpp" @solverIncludes@ #include "command_line_options.hpp" diff --git a/templates/scan.cpp.in b/templates/scan.cpp.in index 9fcff735f..7820dfbb8 100644 --- a/templates/scan.cpp.in +++ b/templates/scan.cpp.in @@ -22,6 +22,7 @@ #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_model_slha.hpp" +#include "@ModelName@_spectrum_generator.hpp" @solverIncludes@ #include "command_line_options.hpp" From 8370d148a83bc9d576781402eb3b23f29308293c Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Wed, 30 Nov 2016 14:51:00 +1030 Subject: [PATCH 25/34] Fix whitespace --- meta/FlexibleSUSY.m | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 713ce8e42..904499ac4 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1716,8 +1716,8 @@ corresponding tadpole is real or imaginary (only in models with CP NeedToCalculateSelfEnergies[eigenstates_] := NeedToUpdateTarget[ - "self-energy", - GetSelfEnergyFileNames[$sarahCurrentOutputMainDir, eigenstates]]; + "self-energy", + GetSelfEnergyFileNames[$sarahCurrentOutputMainDir, eigenstates]]; GetTadpoleFileName[outputDir_String, eigenstates_] := FileNameJoin[{outputDir, ToString[eigenstates], @@ -1731,8 +1731,8 @@ corresponding tadpole is real or imaginary (only in models with CP NeedToCalculateTadpoles[eigenstates_] := NeedToUpdateTarget[ - "tadpole", - GetTadpoleFileName[$sarahCurrentOutputMainDir, eigenstates]]; + "tadpole", + GetTadpoleFileName[$sarahCurrentOutputMainDir, eigenstates]]; GetUnrotatedParticlesFileName[outputDir_String, eigenstates_] := FileNameJoin[{outputDir, ToString[eigenstates], @@ -1746,8 +1746,8 @@ corresponding tadpole is real or imaginary (only in models with CP NeedToCalculateUnrotatedParticles[eigenstates_] := NeedToUpdateTarget[ - "unrotated particle", - GetUnrotatedParticlesFileName[$sarahCurrentOutputMainDir,eigenstates]]; + "unrotated particle", + GetUnrotatedParticlesFileName[$sarahCurrentOutputMainDir,eigenstates]]; SearchSelfEnergies[outputDir_String, eigenstates_] := Module[{fileName}, @@ -1772,7 +1772,7 @@ corresponding tadpole is real or imaginary (only in models with CP GetVertexRuleFileName[outputDir_String, eigenstates_] := FileNameJoin[{outputDir, ToString[eigenstates], "Vertices", - "FSVertexRules.m"}]; + "FSVertexRules.m"}]; GetEffectiveCouplingsFileName[outputDir_String, eigenstates_] := FileNameJoin[{outputDir, ToString[eigenstates], "Vertices", @@ -1780,24 +1780,24 @@ corresponding tadpole is real or imaginary (only in models with CP NeedToCalculateVertices[eigenstates_] := NeedToUpdateTarget[ - "vertex", - { GetVertexRuleFileName[$sarahCurrentOutputMainDir, eigenstates], + "vertex", + { GetVertexRuleFileName[$sarahCurrentOutputMainDir, eigenstates], GetEffectiveCouplingsFileName[$sarahCurrentOutputMainDir, eigenstates] }]; NeedToUpdateTarget[name_String, targets_List] := Module[{ - targetsExist = FilesExist[targets], - targetTimeStamp = LatestModificationTimeInSeconds[targets], - sarahModelFileTimeStamp = SARAHModelFileModificationTimeInSeconds[], - files = If[Length[targets] === 1, "file", "files"], - them = If[Length[targets] === 1, "it", "them"] + targetsExist = FilesExist[targets], + targetTimeStamp = LatestModificationTimeInSeconds[targets], + sarahModelFileTimeStamp = SARAHModelFileModificationTimeInSeconds[], + files = If[Length[targets] === 1, "file", "files"], + them = If[Length[targets] === 1, "it", "them"] }, If[targetsExist, If[sarahModelFileTimeStamp > targetTimeStamp, - Print["SARAH model files are newer than ", name, - " ", files, ", updating ", them, " ..."]; - True, - Print["Found up-to-date ", name, " ", files, "."]; - False + Print["SARAH model files are newer than ", name, + " ", files, ", updating ", them, " ..."]; + True, + Print["Found up-to-date ", name, " ", files, "."]; + False ], Print[name, " ", files, " not found, producing ", them, " ..."]; True @@ -2033,8 +2033,8 @@ corresponding tadpole is real or imaginary (only in models with CP treeLevelEwsbSolutionOutputFile, treeLevelEwsbEqsOutputFile, lesHouchesInputParameters, lesHouchesInputParameterReplacementRules, extraSLHAOutputBlocks, effectiveCouplings ={}, extraVertices = {}, - vertexRules, vertexRuleFileName, effectiveCouplingsFileName, - Lat$massMatrices, spectrumGeneratorFiles, spectrumGeneratorInputFile}, + vertexRules, vertexRuleFileName, effectiveCouplingsFileName, + Lat$massMatrices, spectrumGeneratorFiles = {}, spectrumGeneratorInputFile}, (* check if SARAH`Start[] was called *) If[!ValueQ[Model`Name], Print["Error: Model`Name is not defined. Did you call SARAH`Start[\"Model\"]?"]; @@ -2492,13 +2492,13 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; - On[Assert]; + On[Assert]; Lat$massMatrices = ConvertSarahMassMatrices[] /. Parameters`ApplyGUTNormalization[] //. { SARAH`sum[j_, start_, end_, expr_] :> (Sum[expr, {j,start,end}]) }; massMatrices = Lat$massMatrices /. allIndexReplacementRules; - Lat$massMatrices = LatticeUtils`FixDiagonalization[Lat$massMatrices]; + Lat$massMatrices = LatticeUtils`FixDiagonalization[Lat$massMatrices]; allIntermediateOutputParametes = Parameters`GetIntermediateOutputParameterDependencies[GetMassMatrix /@ massMatrices]; From 29d3c1163f3d16e12f3693aac0dae3e37f1c262f Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Wed, 30 Nov 2016 17:41:24 +1030 Subject: [PATCH 26/34] Only generate code for solvers enabled in the model file --- meta/FlexibleSUSY.m | 385 +++++++++--------- templates/module.mk | 30 +- ...cale_high_scale_spectrum_generator.cpp.in} | 0 ...cale_high_scale_spectrum_generator.hpp.in} | 0 ...scale_low_scale_spectrum_generator.cpp.in} | 0 ...scale_low_scale_spectrum_generator.hpp.in} | 0 ...cale_high_scale_spectrum_generator.cpp.in} | 0 ...cale_high_scale_spectrum_generator.hpp.in} | 0 ...scale_low_scale_spectrum_generator.cpp.in} | 0 ...scale_low_scale_spectrum_generator.hpp.in} | 0 10 files changed, 218 insertions(+), 197 deletions(-) rename templates/{standard_model_high_scale_spectrum_generator.cpp.in => standard_model_two_scale_high_scale_spectrum_generator.cpp.in} (100%) rename templates/{standard_model_high_scale_spectrum_generator.hpp.in => standard_model_two_scale_high_scale_spectrum_generator.hpp.in} (100%) rename templates/{standard_model_low_scale_spectrum_generator.cpp.in => standard_model_two_scale_low_scale_spectrum_generator.cpp.in} (100%) rename templates/{standard_model_low_scale_spectrum_generator.hpp.in => standard_model_two_scale_low_scale_spectrum_generator.hpp.in} (100%) rename templates/{high_scale_spectrum_generator.cpp.in => two_scale_high_scale_spectrum_generator.cpp.in} (100%) rename templates/{high_scale_spectrum_generator.hpp.in => two_scale_high_scale_spectrum_generator.hpp.in} (100%) rename templates/{low_scale_spectrum_generator.cpp.in => two_scale_low_scale_spectrum_generator.cpp.in} (100%) rename templates/{low_scale_spectrum_generator.hpp.in => two_scale_low_scale_spectrum_generator.hpp.in} (100%) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 904499ac4..078cc8dc2 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1262,6 +1262,21 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; +WriteBVPSolverTemplates[files_List] := + WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; + +WriteTwoScaleModelClass[files_List] := + WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; + +WriteTwoScaleSpectrumGeneratorClass[files_List] := + Module[{fillSMFermionPoleMasses = ""}, + fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[]; + WriteOut`ReplaceInFiles[files, + { "@fillSMFermionPoleMasses@" -> IndentText[fillSMFermionPoleMasses], + Sequence @@ GeneralReplacementRules[] + } ]; + ]; + WriteEffectiveCouplings[couplings_List, settings_List, massMatrices_List, vertexRules_List, files_List] := Module[{i, partialWidthGetterPrototypes, partialWidthGetters, loopCouplingsGetters, loopCouplingsDefs, mixingMatricesDefs = "", @@ -1432,13 +1447,11 @@ corresponding tadpole is real or imaginary (only in models with CP WriteUserExample[inputParameters_List, files_List] := Module[{parseCmdLineOptions, printCommandLineOptions, inputPars, - fillSMFermionPoleMasses = "", solverIncludes = "", - runEnabledSolvers = "", scanEnabledSolvers = "", + solverIncludes = "", runEnabledSolvers = "", scanEnabledSolvers = "", runEnabledCmdLineSolvers = "", defaultSolverType}, inputPars = {First[#], #[[3]]}& /@ inputParameters; parseCmdLineOptions = WriteOut`ParseCmdLineOptions[inputPars]; printCommandLineOptions = WriteOut`PrintCmdLineOptions[inputPars]; - fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[]; (solverIncludes = solverIncludes <> EnableSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; (runEnabledSolvers = runEnabledSolvers <> RunEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; (scanEnabledSolvers = scanEnabledSolvers <> ScanEnabledSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; @@ -1455,7 +1468,6 @@ corresponding tadpole is real or imaginary (only in models with CP WriteOut`ReplaceInFiles[files, { "@parseCmdLineOptions@" -> IndentText[IndentText[parseCmdLineOptions]], "@printCommandLineOptions@" -> IndentText[IndentText[printCommandLineOptions]], - "@fillSMFermionPoleMasses@" -> IndentText[fillSMFermionPoleMasses], "@solverIncludes@" -> solverIncludes, "@runEnabledSolvers@" -> runEnabledSolvers, "@scanEnabledSolvers@" -> scanEnabledSolvers, @@ -2533,112 +2545,6 @@ corresponding tadpole is real or imaginary (only in models with CP ] ]; - PrintHeadline["Creating utilities"]; - Print["Creating class for convergence tester ..."]; - WriteConvergenceTesterClass[FlexibleSUSY`FSConvergenceCheck, - {{FileNameJoin[{$flexiblesusyTemplateDir, "convergence_tester.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_convergence_tester.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_convergence_tester.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_convergence_tester.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_convergence_tester.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_convergence_tester.cpp"}]} - } - ]; - - Print["Creating utilities class ..."]; - WriteUtilitiesClass[massMatrices, Join[susyBetaFunctions, susyBreakingBetaFunctions], - inputParameters, extraSLHAOutputBlocks, - {{FileNameJoin[{$flexiblesusyTemplateDir, "info.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_info.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "info.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_info.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "utilities.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_utilities.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "utilities.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_utilities.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "slha_io.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_slha_io.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "slha_io.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_slha_io.cpp"}]} - } - ]; - - Print["Creating plot scripts ..."]; - WritePlotScripts[{{FileNameJoin[{$flexiblesusyTemplateDir, "plot_spectrum.gnuplot.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_plot_spectrum.gnuplot"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "plot_rgflow.gnuplot.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_plot_rgflow.gnuplot"}]}} - ]; - - Print["Creating example SLHA input file ..."]; - WriteSLHAInputFile[inputParameters, - {{FileNameJoin[{$flexiblesusyTemplateDir, "LesHouches.in"}], - FileNameJoin[{FSOutputDir, "LesHouches.in." <> FlexibleSUSY`FSModelName <> "_generated"}]}} - ]; - - PrintHeadline["Creating constraints"]; - Print["Creating class for high-scale constraint ..."]; - WriteConstraintClass[FlexibleSUSY`HighScale, - FlexibleSUSY`HighScaleInput, - FlexibleSUSY`HighScaleFirstGuess, - {FlexibleSUSY`HighScaleMinimum, FlexibleSUSY`HighScaleMaximum}, - {{FileNameJoin[{$flexiblesusyTemplateDir, "high_scale_constraint.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_high_scale_constraint.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_high_scale_constraint.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_high_scale_constraint.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_high_scale_constraint.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_high_scale_constraint.cpp"}]} - } - ]; - - Print["Creating class for susy-scale constraint ..."]; - WriteConstraintClass[FlexibleSUSY`SUSYScale, - FlexibleSUSY`SUSYScaleInput, - FlexibleSUSY`SUSYScaleFirstGuess, - {FlexibleSUSY`SUSYScaleMinimum, FlexibleSUSY`SUSYScaleMaximum}, - {{FileNameJoin[{$flexiblesusyTemplateDir, "susy_scale_constraint.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_scale_constraint.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_scale_constraint.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_scale_constraint.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_scale_constraint.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_scale_constraint.cpp"}]} - } - ]; - - Print["Creating class for low-scale constraint ..."]; - WriteConstraintClass[FlexibleSUSY`LowScale, - FlexibleSUSY`LowScaleInput, - FlexibleSUSY`LowScaleFirstGuess, - {FlexibleSUSY`LowScaleMinimum, FlexibleSUSY`LowScaleMaximum}, - {{FileNameJoin[{$flexiblesusyTemplateDir, "low_scale_constraint.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_low_scale_constraint.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_low_scale_constraint.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_low_scale_constraint.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_low_scale_constraint.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_low_scale_constraint.cpp"}]} - } - ]; - - Print["Creating class for initial guesser ..."]; - If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, - initialGuesserInputFile = "two_scale_low_scale_initial_guesser";, - initialGuesserInputFile = "two_scale_high_scale_initial_guesser"; - ]; - If[FlexibleSUSY`FlexibleEFTHiggs === True, - initialGuesserInputFile = "standard_model_" <> initialGuesserInputFile; - ]; - WriteInitialGuesserClass[FlexibleSUSY`InitialGuessAtLowScale, - FlexibleSUSY`InitialGuessAtSUSYScale, - FlexibleSUSY`InitialGuessAtHighScale, - {{FileNameJoin[{$flexiblesusyTemplateDir, "initial_guesser.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_initial_guesser.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, initialGuesserInputFile <> ".hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_initial_guesser.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, initialGuesserInputFile <> ".cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_initial_guesser.cpp"}]} - } - ]; - (* determine diagonalization precision for each particle *) diagonalizationPrecision = ReadPoleMassPrecisions[ DefaultPoleMassPrecision, @@ -2647,45 +2553,32 @@ corresponding tadpole is real or imaginary (only in models with CP Flatten[{LowPoleMassPrecision}], FSEigenstates]; - vertexRuleFileName = - GetVertexRuleFileName[$sarahCurrentOutputMainDir, FSEigenstates]; + vertexRuleFileName = + GetVertexRuleFileName[$sarahCurrentOutputMainDir, FSEigenstates]; effectiveCouplingsFileName = GetEffectiveCouplingsFileName[$sarahCurrentOutputMainDir, FSEigenstates]; - If[NeedToCalculateVertices[FSEigenstates], + If[NeedToCalculateVertices[FSEigenstates], (* effectiveCouplings = {{coupling, {needed couplings}}, ...} *) Put[effectiveCouplings = EffectiveCouplings`InitializeEffectiveCouplings[], effectiveCouplingsFileName]; extraVertices = EffectiveCouplings`GetNeededVerticesList[effectiveCouplings]; - Put[vertexRules = - Vertices`VertexRules[Join[nPointFunctions, gmm2Vertices, extraVertices], Lat$massMatrices], - vertexRuleFileName], - vertexRules = Get[vertexRuleFileName]; + Put[vertexRules = + Vertices`VertexRules[Join[nPointFunctions, gmm2Vertices, extraVertices], Lat$massMatrices], + vertexRuleFileName], + vertexRules = Get[vertexRuleFileName]; effectiveCouplings = Get[effectiveCouplingsFileName]; ]; - PrintHeadline["Creating SLHA model"]; - Print["Creating class for SLHA model ..."]; - WriteModelSLHAClass[massMatrices, - {{FileNameJoin[{$flexiblesusyTemplateDir, "model_slha.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_model_slha.hpp"}]} - }]; - PrintHeadline["Creating model"]; Print["Creating class for model ..."]; WriteModelClass[massMatrices, ewsbEquations, FlexibleSUSY`EWSBOutputParameters, ewsbSolution, freePhases, nPointFunctions, vertexRules, Parameters`GetPhases[], - {{FileNameJoin[{$flexiblesusyTemplateDir, "model.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_model.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "mass_eigenstates.hpp.in"}], + {{FileNameJoin[{$flexiblesusyTemplateDir, "mass_eigenstates.hpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_mass_eigenstates.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "mass_eigenstates.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_mass_eigenstates.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model.cpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "physical.hpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_physical.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "physical.cpp.in"}], @@ -2693,23 +2586,173 @@ corresponding tadpole is real or imaginary (only in models with CP }, diagonalizationPrecision]; - Print["Creating matching class ..."]; - WriteMatchingClass[FlexibleSUSY`SUSYScaleMatching, - {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]} + PrintHeadline["Creating SLHA model"]; + Print["Creating class for SLHA model ..."]; + WriteModelSLHAClass[massMatrices, + {{FileNameJoin[{$flexiblesusyTemplateDir, "model_slha.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_model_slha.hpp"}]} }]; - Print["Creating makefile module for two-scale method ..."]; - WriteBVPSolverMakefile[{{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale.mk.in"}], - FileNameJoin[{FSOutputDir, "two_scale.mk"}]}}]; + PrintHeadline["Creating utilities"]; + Print["Creating utilities class ..."]; + WriteUtilitiesClass[massMatrices, Join[susyBetaFunctions, susyBreakingBetaFunctions], + inputParameters, extraSLHAOutputBlocks, + {{FileNameJoin[{$flexiblesusyTemplateDir, "info.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_info.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "info.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_info.cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "utilities.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_utilities.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "utilities.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_utilities.cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "slha_io.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_slha_io.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "slha_io.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_slha_io.cpp"}]} + } + ]; - Print["Creating observables"]; + Print["Creating plot scripts ..."]; + WritePlotScripts[{{FileNameJoin[{$flexiblesusyTemplateDir, "plot_spectrum.gnuplot.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_plot_spectrum.gnuplot"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "plot_rgflow.gnuplot.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_plot_rgflow.gnuplot"}]}} + ]; + + PrintHeadline["Creating solver framework"]; + Print["Creating generic solver class templates ..."]; + WriteBVPSolverTemplates[{{FileNameJoin[{$flexiblesusyTemplateDir, "convergence_tester.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_convergence_tester.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "high_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_high_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "initial_guesser.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_initial_guesser.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "low_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_low_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "model.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_model.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator_interface.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator_interface.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "susy_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_susy_scale_constraint.hpp"}]} + }]; + + If[HaveBVPSolver[FlexibleSUSY`TwoScaleSolver], + PrintHeadline["Creating two-scale solver"]; + Print["Creating class for convergence tester ..."]; + WriteConvergenceTesterClass[FlexibleSUSY`FSConvergenceCheck, + {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_convergence_tester.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_convergence_tester.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_convergence_tester.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_convergence_tester.cpp"}]} + } + ]; + + Print["Creating class for high-scale constraint ..."]; + WriteConstraintClass[FlexibleSUSY`HighScale, + FlexibleSUSY`HighScaleInput, + FlexibleSUSY`HighScaleFirstGuess, + {FlexibleSUSY`HighScaleMinimum, FlexibleSUSY`HighScaleMaximum}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_high_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_high_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_high_scale_constraint.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_high_scale_constraint.cpp"}]} + } + ]; + + Print["Creating class for susy-scale constraint ..."]; + WriteConstraintClass[FlexibleSUSY`SUSYScale, + FlexibleSUSY`SUSYScaleInput, + FlexibleSUSY`SUSYScaleFirstGuess, + {FlexibleSUSY`SUSYScaleMinimum, FlexibleSUSY`SUSYScaleMaximum}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_susy_scale_constraint.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_susy_scale_constraint.cpp"}]} + } + ]; + + Print["Creating class for low-scale constraint ..."]; + WriteConstraintClass[FlexibleSUSY`LowScale, + FlexibleSUSY`LowScaleInput, + FlexibleSUSY`LowScaleFirstGuess, + {FlexibleSUSY`LowScaleMinimum, FlexibleSUSY`LowScaleMaximum}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_low_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_low_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_low_scale_constraint.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_low_scale_constraint.cpp"}]} + } + ]; + + Print["Creating class for initial guesser ..."]; + If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, + initialGuesserInputFile = "two_scale_low_scale_initial_guesser";, + initialGuesserInputFile = "two_scale_high_scale_initial_guesser"; + ]; + If[FlexibleSUSY`FlexibleEFTHiggs === True, + initialGuesserInputFile = "standard_model_" <> initialGuesserInputFile; + ]; + WriteInitialGuesserClass[FlexibleSUSY`InitialGuessAtLowScale, + FlexibleSUSY`InitialGuessAtSUSYScale, + FlexibleSUSY`InitialGuessAtHighScale, + {{FileNameJoin[{$flexiblesusyTemplateDir, initialGuesserInputFile <> ".hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_initial_guesser.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, initialGuesserInputFile <> ".cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_initial_guesser.cpp"}]} + } + ]; + + Print["Creating class for two-scale model ..."]; + WriteTwoScaleModelClass[{{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model.cpp"}]}}]; + + Print["Creating matching class ..."]; + WriteMatchingClass[FlexibleSUSY`SUSYScaleMatching, + {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]} + }]; + + spectrumGeneratorInputFile = "two_scale_high_scale_spectrum_generator"; + If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, + spectrumGeneratorInputFile = "two_scale_low_scale_spectrum_generator";]; + If[FlexibleSUSY`FlexibleEFTHiggs === True, + spectrumGeneratorInputFile = "standard_model_" <> spectrumGeneratorInputFile; + ]; + Print["Creating class for two-scale spectrum generator ..."]; + WriteTwoScaleSpectrumGeneratorClass[{{FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_spectrum_generator.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_spectrum_generator.cpp"}]} + }]; + + Print["Creating LibraryLink ", FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> ".mx"}], " ..."]; + WriteMathLink[inputParameters, extraSLHAOutputBlocks, + {{FileNameJoin[{$flexiblesusyTemplateDir, "librarylink.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_librarylink.cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "librarylink.m.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_librarylink.m"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "run.m.in"}], + FileNameJoin[{FSOutputDir, "run_" <> FlexibleSUSY`FSModelName <> ".m"}]} + }]; + + Print["Creating makefile module for two-scale solver ..."]; + WriteBVPSolverMakefile[{{FileNameJoin[{$flexiblesusyTemplateDir, "two_scale.mk.in"}], + FileNameJoin[{FSOutputDir, "two_scale.mk"}]}}]; + + ]; (* If[HaveBVPSolver[FlexibleSUSY`TwoScaleSolver] *) + + PrintHeadline["Creating observables"]; + Print["Creating class for effective couplings ..."]; (* @note separating this out for now for simplicity *) (* @todo maybe implement a flag (like for addons) to turn on/off? *) WriteEffectiveCouplings[effectiveCouplings, FlexibleSUSY`LowScaleInput, massMatrices, vertexRules, @@ -2719,59 +2762,37 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_effective_couplings.cpp"}]} }]; + Print["Creating class for observables ..."]; WriteObservables[extraSLHAOutputBlocks, {{FileNameJoin[{$flexiblesusyTemplateDir, "observables.hpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_observables.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "observables.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_observables.cpp"}]}}]; - Print["Creating class GMuonMinus2"]; + Print["Creating class GMuonMinus2 ..."]; WriteGMuonMinus2Class[vertexRules, {{FileNameJoin[{$flexiblesusyTemplateDir, "a_muon.hpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "a_muon.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.cpp"}]}}]; + PrintHeadline["Creating user examples"]; Print["Creating user example spectrum generator program ..."]; - spectrumGeneratorFiles = {}; - If[HaveBVPSolver[FlexibleSUSY`TwoScaleSolver], - spectrumGeneratorInputFile = "high_scale_spectrum_generator"; - If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, - spectrumGeneratorInputFile = "low_scale_spectrum_generator";]; - If[FlexibleSUSY`FlexibleEFTHiggs === True, - spectrumGeneratorInputFile = "standard_model_" <> spectrumGeneratorInputFile; - ]; - spectrumGeneratorFiles = Join[spectrumGeneratorFiles, - {{FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_spectrum_generator.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_spectrum_generator.cpp"}]} - }]; - ]; - WriteUserExample[inputParameters, - Join[{{FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "spectrum_generator_interface.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_spectrum_generator_interface.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "run.cpp.in"}], - FileNameJoin[{FSOutputDir, "run_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "run_cmd_line.cpp.in"}], - FileNameJoin[{FSOutputDir, "run_cmd_line_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "scan.cpp.in"}], - FileNameJoin[{FSOutputDir, "scan_" <> FlexibleSUSY`FSModelName <> ".cpp"}]} - }, spectrumGeneratorFiles] + {{FileNameJoin[{$flexiblesusyTemplateDir, "run.cpp.in"}], + FileNameJoin[{FSOutputDir, "run_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "run_cmd_line.cpp.in"}], + FileNameJoin[{FSOutputDir, "run_cmd_line_" <> FlexibleSUSY`FSModelName <> ".cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "scan.cpp.in"}], + FileNameJoin[{FSOutputDir, "scan_" <> FlexibleSUSY`FSModelName <> ".cpp"}]} + } ]; - Print["Creating LibraryLink ", FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> ".mx"}], " ..."]; - WriteMathLink[inputParameters, extraSLHAOutputBlocks, - {{FileNameJoin[{$flexiblesusyTemplateDir, "librarylink.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_librarylink.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "librarylink.m.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_librarylink.m"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "run.m.in"}], - FileNameJoin[{FSOutputDir, "run_" <> FlexibleSUSY`FSModelName <> ".m"}]} - }]; + Print["Creating example SLHA input file ..."]; + WriteSLHAInputFile[inputParameters, + {{FileNameJoin[{$flexiblesusyTemplateDir, "LesHouches.in"}], + FileNameJoin[{FSOutputDir, "LesHouches.in." <> FlexibleSUSY`FSModelName <> "_generated"}]}} + ]; PrintHeadline["FlexibleSUSY has finished"]; ]; diff --git a/templates/module.mk b/templates/module.mk index cfbf2b9ce..c42c935af 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -4,12 +4,16 @@ MODNAME := templates BASE_TEMPLATES := \ $(DIR)/a_muon.hpp.in \ $(DIR)/a_muon.cpp.in \ + $(DIR)/convergence_tester.hpp.in \ $(DIR)/effective_couplings.hpp.in \ $(DIR)/effective_couplings.cpp.in \ + $(DIR)/high_scale_constraint.hpp.in \ $(DIR)/info.hpp.in \ $(DIR)/info.cpp.in \ + $(DIR)/initial_guesser.hpp.in \ $(DIR)/input_parameters.hpp.in \ $(DIR)/input_parameters.cpp.in \ + $(DIR)/low_scale_constraint.hpp.in \ $(DIR)/mass_eigenstates.hpp.in \ $(DIR)/mass_eigenstates.cpp.in \ $(DIR)/model.hpp.in \ @@ -23,6 +27,8 @@ BASE_TEMPLATES := \ $(DIR)/run.cpp.in \ $(DIR)/run_cmd_line.cpp.in \ $(DIR)/scan.cpp.in \ + $(DIR)/slha_io.hpp.in \ + $(DIR)/slha_io.cpp.in \ $(DIR)/soft_beta_.cpp.in \ $(DIR)/soft_parameters.hpp.in \ $(DIR)/soft_parameters.cpp.in \ @@ -31,46 +37,40 @@ BASE_TEMPLATES := \ $(DIR)/susy_beta_.cpp.in \ $(DIR)/susy_parameters.hpp.in \ $(DIR)/susy_parameters.cpp.in \ + $(DIR)/susy_scale_constraint.hpp.in \ $(DIR)/utilities.hpp.in \ $(DIR)/utilities.cpp.in TWO_SCALE_TEMPLATES := \ - $(DIR)/convergence_tester.hpp.in \ - $(DIR)/high_scale_constraint.hpp.in \ - $(DIR)/high_scale_spectrum_generator.hpp.in \ - $(DIR)/high_scale_spectrum_generator.cpp.in \ - $(DIR)/initial_guesser.hpp.in \ $(DIR)/librarylink.cpp.in \ $(DIR)/librarylink.m.in \ - $(DIR)/low_scale_constraint.hpp.in \ - $(DIR)/low_scale_spectrum_generator.hpp.in \ - $(DIR)/low_scale_spectrum_generator.cpp.in \ $(DIR)/run.m.in \ - $(DIR)/slha_io.hpp.in \ - $(DIR)/slha_io.cpp.in \ - $(DIR)/standard_model_high_scale_spectrum_generator.hpp.in \ - $(DIR)/standard_model_high_scale_spectrum_generator.cpp.in \ - $(DIR)/standard_model_low_scale_spectrum_generator.hpp.in \ - $(DIR)/standard_model_low_scale_spectrum_generator.cpp.in \ $(DIR)/standard_model_matching.hpp.in \ $(DIR)/standard_model_matching.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.hpp.in \ + $(DIR)/standard_model_two_scale_high_scale_spectrum_generator.hpp.in \ + $(DIR)/standard_model_two_scale_high_scale_spectrum_generator.cpp.in \ $(DIR)/standard_model_two_scale_low_scale_initial_guesser.cpp.in \ $(DIR)/standard_model_two_scale_low_scale_initial_guesser.hpp.in \ + $(DIR)/standard_model_two_scale_low_scale_spectrum_generator.hpp.in \ + $(DIR)/standard_model_two_scale_low_scale_spectrum_generator.cpp.in \ $(DIR)/standard_model_two_scale_matching.hpp.in \ $(DIR)/standard_model_two_scale_matching.cpp.in \ - $(DIR)/susy_scale_constraint.hpp.in \ $(DIR)/two_scale_convergence_tester.hpp.in \ $(DIR)/two_scale_convergence_tester.cpp.in \ $(DIR)/two_scale_high_scale_constraint.hpp.in \ $(DIR)/two_scale_high_scale_constraint.cpp.in \ $(DIR)/two_scale_high_scale_initial_guesser.hpp.in \ $(DIR)/two_scale_high_scale_initial_guesser.cpp.in \ + $(DIR)/two_scale_high_scale_spectrum_generator.hpp.in \ + $(DIR)/two_scale_high_scale_spectrum_generator.cpp.in \ $(DIR)/two_scale_low_scale_constraint.hpp.in \ $(DIR)/two_scale_low_scale_constraint.cpp.in \ $(DIR)/two_scale_low_scale_initial_guesser.hpp.in \ $(DIR)/two_scale_low_scale_initial_guesser.cpp.in \ + $(DIR)/two_scale_low_scale_spectrum_generator.hpp.in \ + $(DIR)/two_scale_low_scale_spectrum_generator.cpp.in \ $(DIR)/two_scale_model.hpp.in \ $(DIR)/two_scale_model.cpp.in \ $(DIR)/two_scale_susy_scale_constraint.hpp.in \ diff --git a/templates/standard_model_high_scale_spectrum_generator.cpp.in b/templates/standard_model_two_scale_high_scale_spectrum_generator.cpp.in similarity index 100% rename from templates/standard_model_high_scale_spectrum_generator.cpp.in rename to templates/standard_model_two_scale_high_scale_spectrum_generator.cpp.in diff --git a/templates/standard_model_high_scale_spectrum_generator.hpp.in b/templates/standard_model_two_scale_high_scale_spectrum_generator.hpp.in similarity index 100% rename from templates/standard_model_high_scale_spectrum_generator.hpp.in rename to templates/standard_model_two_scale_high_scale_spectrum_generator.hpp.in diff --git a/templates/standard_model_low_scale_spectrum_generator.cpp.in b/templates/standard_model_two_scale_low_scale_spectrum_generator.cpp.in similarity index 100% rename from templates/standard_model_low_scale_spectrum_generator.cpp.in rename to templates/standard_model_two_scale_low_scale_spectrum_generator.cpp.in diff --git a/templates/standard_model_low_scale_spectrum_generator.hpp.in b/templates/standard_model_two_scale_low_scale_spectrum_generator.hpp.in similarity index 100% rename from templates/standard_model_low_scale_spectrum_generator.hpp.in rename to templates/standard_model_two_scale_low_scale_spectrum_generator.hpp.in diff --git a/templates/high_scale_spectrum_generator.cpp.in b/templates/two_scale_high_scale_spectrum_generator.cpp.in similarity index 100% rename from templates/high_scale_spectrum_generator.cpp.in rename to templates/two_scale_high_scale_spectrum_generator.cpp.in diff --git a/templates/high_scale_spectrum_generator.hpp.in b/templates/two_scale_high_scale_spectrum_generator.hpp.in similarity index 100% rename from templates/high_scale_spectrum_generator.hpp.in rename to templates/two_scale_high_scale_spectrum_generator.hpp.in diff --git a/templates/low_scale_spectrum_generator.cpp.in b/templates/two_scale_low_scale_spectrum_generator.cpp.in similarity index 100% rename from templates/low_scale_spectrum_generator.cpp.in rename to templates/two_scale_low_scale_spectrum_generator.cpp.in diff --git a/templates/low_scale_spectrum_generator.hpp.in b/templates/two_scale_low_scale_spectrum_generator.hpp.in similarity index 100% rename from templates/low_scale_spectrum_generator.hpp.in rename to templates/two_scale_low_scale_spectrum_generator.hpp.in From 4e4a53cf9ac4533c4b74f11c4956dd93d606dcde Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 1 Dec 2016 15:32:38 +1030 Subject: [PATCH 27/34] Add missing macros --- meta/WriteOut.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meta/WriteOut.m b/meta/WriteOut.m index c53350968..9e51ca54c 100644 --- a/meta/WriteOut.m +++ b/meta/WriteOut.m @@ -930,8 +930,8 @@ " to SLHA, because ", {vL,vR}, " are not defined", " or have incompatible dimension."]; result = result <> - CreateSLHAYukawaName[#] <> " = " <> - CConversion`ToValidCSymbolString[#] <> ".diagonal().real();\n"; + CreateSLHAYukawaName[#] <> " = MODELPARAMETER(" <> + CConversion`ToValidCSymbolString[#] <> ").diagonal().real();\n"; ]; ]& /@ yuks; result @@ -995,8 +995,8 @@ " to SLHA, because ", {vL,vR}, " are not defined", " or have incompatible dimension."]; result = result <> - CreateSLHATrilinearCouplingName[#] <> " = " <> - CConversion`ToValidCSymbolString[#] <> ".real();\n"; + CreateSLHATrilinearCouplingName[#] <> " = MODELPARAMETER(" <> + CConversion`ToValidCSymbolString[#] <> ").real();\n"; ]; ]& /@ tril; result @@ -1072,8 +1072,8 @@ " to SLHA, because ", {vL,vR}, " are not defined", " or have incompatible dimension."]; result = result <> - CreateSLHASoftSquaredMassName[#] <> " = " <> - CConversion`ToValidCSymbolString[#] <> ".real();\n"; + CreateSLHASoftSquaredMassName[#] <> " = MODELPARAMETER(" <> + CConversion`ToValidCSymbolString[#] <> ").real();\n"; ]; ]& /@ massSq; result From 8ba6f7eb9cc6d0444b9c46308b30184480163961 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Thu, 1 Dec 2016 15:42:14 +1030 Subject: [PATCH 28/34] Make Standard Model matching independent of solver type --- meta/FlexibleSUSY.m | 28 ++++++++++++++---------- templates/module.mk | 4 ++-- templates/module.mk.in | 4 +++- templates/standard_model_matching.hpp.in | 4 ++-- templates/two_scale.mk.in | 2 -- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 078cc8dc2..501cb0b32 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1265,6 +1265,9 @@ corresponding tadpole is real or imaginary (only in models with CP WriteBVPSolverTemplates[files_List] := WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; +WriteTwoScaleMatchingClass[files_List] := + WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; + WriteTwoScaleModelClass[files_List] := WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; @@ -2612,6 +2615,14 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; + Print["Creating matching class ..."]; + WriteMatchingClass[FlexibleSUSY`SUSYScaleMatching, + {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]} + }]; + Print["Creating plot scripts ..."]; WritePlotScripts[{{FileNameJoin[{$flexiblesusyTemplateDir, "plot_spectrum.gnuplot.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_plot_spectrum.gnuplot"}]}, @@ -2710,17 +2721,12 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "two_scale_model.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model.cpp"}]}}]; - Print["Creating matching class ..."]; - WriteMatchingClass[FlexibleSUSY`SUSYScaleMatching, - {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]} - }]; + Print["Creating two-scale matching class ..."]; + WriteTwoScaleMatchingClass[{{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]} + }]; spectrumGeneratorInputFile = "two_scale_high_scale_spectrum_generator"; If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, diff --git a/templates/module.mk b/templates/module.mk index c42c935af..0aa791568 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -34,6 +34,8 @@ BASE_TEMPLATES := \ $(DIR)/soft_parameters.cpp.in \ $(DIR)/spectrum_generator.hpp.in \ $(DIR)/spectrum_generator_interface.hpp.in \ + $(DIR)/standard_model_matching.hpp.in \ + $(DIR)/standard_model_matching.cpp.in \ $(DIR)/susy_beta_.cpp.in \ $(DIR)/susy_parameters.hpp.in \ $(DIR)/susy_parameters.cpp.in \ @@ -45,8 +47,6 @@ TWO_SCALE_TEMPLATES := \ $(DIR)/librarylink.cpp.in \ $(DIR)/librarylink.m.in \ $(DIR)/run.m.in \ - $(DIR)/standard_model_matching.hpp.in \ - $(DIR)/standard_model_matching.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.hpp.in \ $(DIR)/standard_model_two_scale_high_scale_spectrum_generator.hpp.in \ diff --git a/templates/module.mk.in b/templates/module.mk.in index bf5f8c832..9e384e6fa 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -38,8 +38,9 @@ LIB@CLASSNAME@_SRC := \ $(DIR)/@CLASSNAME@_observables.cpp \ $(DIR)/@CLASSNAME@_physical.cpp \ $(DIR)/@CLASSNAME@_slha_io.cpp \ - $(DIR)/@CLASSNAME@_susy_parameters.cpp \ $(DIR)/@CLASSNAME@_soft_parameters.cpp \ + $(DIR)/@CLASSNAME@_standard_model_matching.cpp \ + $(DIR)/@CLASSNAME@_susy_parameters.cpp \ $(DIR)/@CLASSNAME@_utilities.cpp EXE@CLASSNAME@_SRC := \ @@ -65,6 +66,7 @@ LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_spectrum_generator.hpp \ $(DIR)/@CLASSNAME@_spectrum_generator_interface.hpp \ $(DIR)/@CLASSNAME@_soft_parameters.hpp \ + $(DIR)/@CLASSNAME@_standard_model_matching.hpp \ $(DIR)/@CLASSNAME@_susy_parameters.hpp \ $(DIR)/@CLASSNAME@_utilities.hpp diff --git a/templates/standard_model_matching.hpp.in b/templates/standard_model_matching.hpp.in index d7b78fc4e..f0e256c9c 100644 --- a/templates/standard_model_matching.hpp.in +++ b/templates/standard_model_matching.hpp.in @@ -18,8 +18,8 @@ // File generated at @DateAndTime@ -#ifndef @ModelName@_STANDRD_MODEL_TWO_SCALE_MATCHING_H -#define @ModelName@_STANDRD_MODEL_TWO_SCALE_MATCHING_H +#ifndef @ModelName@_STANDARD_MODEL_MATCHING_H +#define @ModelName@_STANDARD_MODEL_MATCHING_H #include "@ModelName@_mass_eigenstates.hpp" #include "standard_model.hpp" diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in index 500e7eee6..4095eee46 100644 --- a/templates/two_scale.mk.in +++ b/templates/two_scale.mk.in @@ -19,7 +19,6 @@ @ModelName@_INCLUDE_MK += $(DIR)/two_scale.mk LIB@ModelName@_SRC += \ - $(DIR)/@ModelName@_standard_model_matching.cpp \ $(DIR)/@ModelName@_standard_model_two_scale_matching.cpp \ $(DIR)/@ModelName@_two_scale_convergence_tester.cpp \ $(DIR)/@ModelName@_two_scale_high_scale_constraint.cpp \ @@ -33,7 +32,6 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_high_scale_constraint.hpp \ $(DIR)/@ModelName@_initial_guesser.hpp \ $(DIR)/@ModelName@_low_scale_constraint.hpp \ - $(DIR)/@ModelName@_standard_model_matching.hpp \ $(DIR)/@ModelName@_standard_model_two_scale_matching.hpp \ $(DIR)/@ModelName@_susy_scale_constraint.hpp \ $(DIR)/@ModelName@_two_scale_convergence_tester.hpp \ From 7ed22a920b33090c930c4d011359adbaeac65cb9 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 2 Dec 2016 10:54:37 +1030 Subject: [PATCH 29/34] Fix header inclusion in example --- examples/standalone-rge/standalone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/standalone-rge/standalone.cpp b/examples/standalone-rge/standalone.cpp index 4969c47ae..7b64eaaa6 100644 --- a/examples/standalone-rge/standalone.cpp +++ b/examples/standalone-rge/standalone.cpp @@ -1,6 +1,6 @@ -#include "MSSM_two_scale_susy_parameters.hpp" -#include "MSSM_two_scale_soft_parameters.hpp" +#include "MSSM_susy_parameters.hpp" +#include "MSSM_soft_parameters.hpp" #include "ew_input.hpp" #include "logger.hpp" #include "wrappers.hpp" From 7cbeb548db98bf2930b5cfdda5f58b9c570f54c7 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 2 Dec 2016 10:54:48 +1030 Subject: [PATCH 30/34] Fix typo --- test/test_NUTNMSSM_spectrum.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_NUTNMSSM_spectrum.cpp b/test/test_NUTNMSSM_spectrum.cpp index 44dd094c9..26ecf9cce 100644 --- a/test/test_NUTNMSSM_spectrum.cpp +++ b/test/test_NUTNMSSM_spectrum.cpp @@ -789,7 +789,7 @@ void test_NUTNMSSM_spectrum_with_fermi_constant_input_for_point( BOOST_CHECK_CLOSE_FRACTION(fs.get_vS() , ss.displaySvev(), 5.0e-8); BOOST_CHECK_CLOSE_FRACTION(fs.get_mHd2(), ss.displayMh1Squared(), 1.76e-2); BOOST_CHECK_CLOSE_FRACTION(fs.get_mHu2(), ss.displayMh2Squared(), 5.0e-05); - BOOST_CHECK_CLOSE_FRACTION(fs.get_ms2(), ss.displayMsSquared(), 3.5-06); + BOOST_CHECK_CLOSE_FRACTION(fs.get_ms2(), ss.displayMsSquared(), 3.5e-06); const double vu = fs.get_vu(); const double vd = fs.get_vd(); From edc91a1b7e90ad6731b5ca524f7522c0a3a37b2d Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 2 Dec 2016 18:03:39 +1030 Subject: [PATCH 31/34] Initial generalisation of LibraryLink to multiple solvers --- meta/FlexibleSUSY.m | 43 +++- meta/FlexibleTower.m | 6 +- templates/librarylink.cpp.in | 418 +++++++++++++++++++++-------------- templates/librarylink.m.in | 2 + 4 files changed, 296 insertions(+), 173 deletions(-) diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index 501cb0b32..2b26ac523 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -1480,6 +1480,32 @@ 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]; + ]; + 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]; + ]; + body = "data.reset(new " <> FlexibleSUSY`FSModelName <> "_model_data<" <> class <> ">());\nbreak;\n"; + result = "case " <> key <> ":\n" <> IndentText[body]; + EnableForBVPSolver[solver, IndentText[result]] <> "\n" + ]; + WriteMathLink[inputParameters_List, extraSLHAOutputBlocks_List, files_List] := Module[{numberOfInputParameters, numberOfInputParameterRules, putInputParameters, @@ -1488,7 +1514,8 @@ corresponding tadpole is real or imaginary (only in models with CP numberOfSpectrumEntries, putSpectrum, setInputParameters, numberOfObservables, putObservables, listOfInputParameters, listOfModelParameters, listOfOutputParameters, - inputPars, outPars, requestedObservables}, + inputPars, outPars, requestedObservables, defaultSolverType, + solverIncludes = "", initialiseDataPointer = ""}, inputPars = {#[[1]], #[[3]]}& /@ inputParameters; numberOfInputParameters = Total[CConversion`CountNumberOfEntries[#[[2]]]& /@ inputPars]; numberOfInputParameterRules = FSMathLink`GetNumberOfInputParameterRules[inputPars]; @@ -1507,6 +1534,17 @@ corresponding tadpole is real or imaginary (only in models with CP requestedObservables = Observables`GetRequestedObservables[extraSLHAOutputBlocks]; numberOfObservables = Length[requestedObservables]; putObservables = FSMathLink`PutObservables[requestedObservables, "link"]; + (solverIncludes = solverIncludes <> EnableMathlinkSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; + (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] + ]; + ]; WriteOut`ReplaceInFiles[files, { "@numberOfInputParameters@" -> ToString[numberOfInputParameters], "@numberOfInputParameterRules@" -> ToString[numberOfInputParameterRules], @@ -1522,6 +1560,9 @@ corresponding tadpole is real or imaginary (only in models with CP "@listOfInputParameters@" -> listOfInputParameters, "@listOfModelParameters@" -> listOfModelParameters, "@listOfOutputParameters@" -> listOfOutputParameters, + "@solverIncludes@" -> solverIncludes, + "@initialiseDataPointer@" -> initialiseDataPointer, + "@defaultSolverType@" -> defaultSolverType, Sequence @@ GeneralReplacementRules[] } ]; ]; diff --git a/meta/FlexibleTower.m b/meta/FlexibleTower.m index 5d2b8278f..7fbb27f6d 100644 --- a/meta/FlexibleTower.m +++ b/meta/FlexibleTower.m @@ -13,10 +13,10 @@ GetModelTypes[] := Utils`StringJoinWithSeparator[ Which[FlexibleSUSY`FlexibleEFTHiggs === True, - { GetSLHAModelType[FlexibleSUSY`FSModelName, "algorithm_type"], - GetModelType["standard_model::StandardModel", "algorithm_type"] }, + { GetSLHAModelType[FlexibleSUSY`FSModelName, "Solver_type"], + GetModelType["standard_model::StandardModel", "Solver_type"] }, True, - { GetSLHAModelType[FlexibleSUSY`FSModelName, "algorithm_type"] } + { GetSLHAModelType[FlexibleSUSY`FSModelName, "Solver_type"] } ], ", " ]; diff --git a/templates/librarylink.cpp.in b/templates/librarylink.cpp.in index dbc3dc157..7db081929 100644 --- a/templates/librarylink.cpp.in +++ b/templates/librarylink.cpp.in @@ -18,21 +18,22 @@ // File generated at @DateAndTime@ +#include "config.h" + #include "@ModelName@_info.hpp" #include "@ModelName@_input_parameters.hpp" #include "@ModelName@_observables.hpp" #include "@ModelName@_physical.hpp" #include "@ModelName@_slha_io.hpp" -#include "@ModelName@_two_scale_spectrum_generator.hpp" -#include "@ModelName@_two_scale_model.hpp" #include "@ModelName@_model_slha.hpp" -#include "standard_model_two_scale_model.hpp" +@solverIncludes@ #include "array_view.hpp" #include "error.hpp" #include "physical_input.hpp" #include "slha_io.hpp" #include "spectrum_generator_settings.hpp" +#include "standard_model_two_scale_model.hpp" #include "lowe.h" #include "mathlink.h" @@ -43,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -51,14 +53,13 @@ #include #include -#define INPUTPARAMETER(p) data.input.p +#define INPUTPARAMETER(p) input.p #define MODELPARAMETER(p) model.get_##p() #define PHYSICALPARAMETER(p) model.get_physical().p #define OBSERVABLE(o) observables.o using namespace flexiblesusy; -typedef Two_scale algorithm_type; typedef mint Handle; class Redirect_output { @@ -136,19 +137,61 @@ public: } // namespace flexiblesusy -struct @ModelName@_data { +class @ModelName@_data { +public: + virtual ~@ModelName@_data() {}; + + void set_input_parameters(const @ModelName@_input_parameters& input_) { input = input_; } + void set_physical_input(const Physical_input& p) { physical_input = p; } + void set_sm_input_parameters(const softsusy::QedQcd& qedqcd_) { qedqcd = qedqcd_; } + void set_settings(const Spectrum_generator_settings& s) { settings = s; } + void set_modsel(const SLHA_io::Modsel& m) { modsel = m; } + + void put_settings(MLINK link) const; + void put_sm_input_parameters(MLINK link) const; + void put_input_parameters(MLINK link) const; + void put_observables(MLINK link) const; + void put_slha(MLINK link) const; + + virtual void put_problems(MLINK link) const = 0; + virtual void put_warnings(MLINK link) const = 0; + virtual void put_model_spectra(MLINK link) const = 0; + virtual void calculate_spectrum() = 0; + virtual void check_spectrum(MLINK link) const = 0; + virtual void calculate_model_observables() = 0; + + virtual double get_model_scale() const = 0; +protected: @ModelName@_input_parameters input{}; ///< model input parameters Physical_input physical_input{}; ///< extra non-SLHA physical input softsusy::QedQcd qedqcd{}; ///< SLHA physical input Spectrum_generator_settings settings{}; ///< spectrum generator settings SLHA_io::Modsel modsel{}; ///< MODSEL input - std::tuple<@ModelTypes@> models{}; ///< running parameters and pole masses @ModelName@_observables observables{}; ///< observables - @ModelName@_scales scales; ///< scale information + @ModelName@_scales scales{}; ///< scale information + + virtual @ModelName@_slha_io get_slha_io() const = 0; +}; + +template +class @ModelName@_model_data : public @ModelName@_data { +public: + virtual void put_problems(MLINK link) const override; + virtual void put_warnings(MLINK link) const override; + virtual void put_model_spectra(MLINK link) const override; + virtual void calculate_spectrum() override; + virtual void check_spectrum(MLINK link) const override; + virtual void calculate_model_observables() override; + + virtual double get_model_scale() const override { return std::get<0>(models).get_scale(); } +protected: + virtual @ModelName@_slha_io get_slha_io() const override; +private: + std::tuple<@ModelTypes@> models{}; ///< running parameters and pole masses }; /// current handles -typedef std::map Handle_map; +typedef std::map > Handle_map; Handle_map handles_@ModelName@; /******************************************************************/ @@ -183,7 +226,7 @@ auto find_@ModelName@_handle(Handle hid) -> decltype(handles_@ModelName@.find(hi /******************************************************************/ -@ModelName@_data& find_@ModelName@_data(Handle hid) +std::unique_ptr<@ModelName@_data>& find_@ModelName@_data(Handle hid) { return find_@ModelName@_handle(hid)->second; } @@ -258,68 +301,69 @@ void put_message(MLINK link, /******************************************************************/ -void put_settings(const @ModelName@_data& data, MLINK link) -{ - MLPutFunction(link, "List", 23); - - MLPutRuleTo(link, data.settings.get(Spectrum_generator_settings::precision), "precisionGoal"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::max_iterations)), "maxIterations"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::calculate_sm_masses)), "calculateStandardModelMasses"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::pole_mass_loop_order)), "poleMassLoopOrder"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::ewsb_loop_order)), "ewsbLoopOrder"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::beta_loop_order)), "betaFunctionLoopOrder"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)), "thresholdCorrectionsLoopOrder"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::higgs_2loop_correction_at_as)), "higgs2loopCorrectionAtAs"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::higgs_2loop_correction_ab_as)), "higgs2loopCorrectionAbAs"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::higgs_2loop_correction_at_at)), "higgs2loopCorrectionAtAt"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::higgs_2loop_correction_atau_atau)), "higgs2loopCorrectionAtauAtau"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::force_output)), "forceOutput"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::top_pole_qcd_corrections)), "topPoleQCDCorrections"); - MLPutRuleTo(link, data.settings.get(Spectrum_generator_settings::beta_zero_threshold), "betaZeroThreshold"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::force_positive_masses)), "forcePositiveMasses"); - MLPutRuleTo(link, data.settings.get(Spectrum_generator_settings::pole_mass_scale), "poleMassScale"); - MLPutRuleTo(link, data.settings.get(Spectrum_generator_settings::eft_pole_mass_scale), "eftPoleMassScale"); - MLPutRuleTo(link, data.settings.get(Spectrum_generator_settings::eft_matching_scale), "eftMatchingScale"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::eft_matching_loop_order_up)), "eftMatchingLoopOrderUp"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::eft_matching_loop_order_down)), "eftMatchingLoopOrderDown"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::eft_higgs_index)), "eftHiggsIndex"); - MLPutRuleTo(link, static_cast(data.settings.get(Spectrum_generator_settings::calculate_bsm_masses)), "calculateBSMMasses"); - MLPutRuleTo(link, data.modsel.parameter_output_scale, "parameterOutputScale"); +void @ModelName@_data::put_settings(MLINK link) const +{ + MLPutFunction(link, "List", 24); + + MLPutRuleTo(link, settings.get(Spectrum_generator_settings::precision), "precisionGoal"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::max_iterations)), "maxIterations"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::solver)), "solver"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::calculate_sm_masses)), "calculateStandardModelMasses"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::pole_mass_loop_order)), "poleMassLoopOrder"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::ewsb_loop_order)), "ewsbLoopOrder"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::beta_loop_order)), "betaFunctionLoopOrder"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::threshold_corrections_loop_order)), "thresholdCorrectionsLoopOrder"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::higgs_2loop_correction_at_as)), "higgs2loopCorrectionAtAs"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::higgs_2loop_correction_ab_as)), "higgs2loopCorrectionAbAs"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::higgs_2loop_correction_at_at)), "higgs2loopCorrectionAtAt"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::higgs_2loop_correction_atau_atau)), "higgs2loopCorrectionAtauAtau"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::force_output)), "forceOutput"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::top_pole_qcd_corrections)), "topPoleQCDCorrections"); + MLPutRuleTo(link, settings.get(Spectrum_generator_settings::beta_zero_threshold), "betaZeroThreshold"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::force_positive_masses)), "forcePositiveMasses"); + MLPutRuleTo(link, settings.get(Spectrum_generator_settings::pole_mass_scale), "poleMassScale"); + MLPutRuleTo(link, settings.get(Spectrum_generator_settings::eft_pole_mass_scale), "eftPoleMassScale"); + MLPutRuleTo(link, settings.get(Spectrum_generator_settings::eft_matching_scale), "eftMatchingScale"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::eft_matching_loop_order_up)), "eftMatchingLoopOrderUp"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::eft_matching_loop_order_down)), "eftMatchingLoopOrderDown"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::eft_higgs_index)), "eftHiggsIndex"); + MLPutRuleTo(link, static_cast(settings.get(Spectrum_generator_settings::calculate_bsm_masses)), "calculateBSMMasses"); + MLPutRuleTo(link, modsel.parameter_output_scale, "parameterOutputScale"); MLEndPacket(link); } /******************************************************************/ -void put_sm_input_parameters(const @ModelName@_data& data, MLINK link) +void @ModelName@_data::put_sm_input_parameters(MLINK link) const { MLPutFunction(link, "List", 29); - MLPutRuleTo(link, data.qedqcd.displayAlphaEmInput(), "alphaEmMZ"); - MLPutRuleTo(link, data.qedqcd.displayFermiConstant(), "GF"); - MLPutRuleTo(link, data.qedqcd.displayAlphaSInput(), "alphaSMZ"); - MLPutRuleTo(link, data.qedqcd.displayPoleMZ(), "MZ"); - MLPutRuleTo(link, data.qedqcd.displayMbMb(), "mbmb"); - MLPutRuleTo(link, data.qedqcd.displayPoleMt(), "Mt"); - MLPutRuleTo(link, data.qedqcd.displayPoleMtau(), "Mtau"); - MLPutRuleTo(link, data.qedqcd.displayNeutrinoPoleMass(3), "Mv3"); - MLPutRuleTo(link, data.qedqcd.displayPoleMW(), "MW"); - MLPutRuleTo(link, data.qedqcd.displayPoleMel(), "Me"); - MLPutRuleTo(link, data.qedqcd.displayNeutrinoPoleMass(1), "Mv1"); - MLPutRuleTo(link, data.qedqcd.displayPoleMmuon(), "Mm"); - MLPutRuleTo(link, data.qedqcd.displayNeutrinoPoleMass(2), "Mv2"); - MLPutRuleTo(link, data.qedqcd.displayMd2GeV(), "md2GeV"); - MLPutRuleTo(link, data.qedqcd.displayMu2GeV(), "mu2GeV"); - MLPutRuleTo(link, data.qedqcd.displayMs2GeV(), "ms2GeV"); - MLPutRuleTo(link, data.qedqcd.displayMcMc(), "mcmc"); - - const flexiblesusy::CKM_parameters ckm(data.qedqcd.displayCKM()); + MLPutRuleTo(link, qedqcd.displayAlphaEmInput(), "alphaEmMZ"); + MLPutRuleTo(link, qedqcd.displayFermiConstant(), "GF"); + MLPutRuleTo(link, qedqcd.displayAlphaSInput(), "alphaSMZ"); + MLPutRuleTo(link, qedqcd.displayPoleMZ(), "MZ"); + MLPutRuleTo(link, qedqcd.displayMbMb(), "mbmb"); + MLPutRuleTo(link, qedqcd.displayPoleMt(), "Mt"); + MLPutRuleTo(link, qedqcd.displayPoleMtau(), "Mtau"); + MLPutRuleTo(link, qedqcd.displayNeutrinoPoleMass(3), "Mv3"); + MLPutRuleTo(link, qedqcd.displayPoleMW(), "MW"); + MLPutRuleTo(link, qedqcd.displayPoleMel(), "Me"); + MLPutRuleTo(link, qedqcd.displayNeutrinoPoleMass(1), "Mv1"); + MLPutRuleTo(link, qedqcd.displayPoleMmuon(), "Mm"); + MLPutRuleTo(link, qedqcd.displayNeutrinoPoleMass(2), "Mv2"); + MLPutRuleTo(link, qedqcd.displayMd2GeV(), "md2GeV"); + MLPutRuleTo(link, qedqcd.displayMu2GeV(), "mu2GeV"); + MLPutRuleTo(link, qedqcd.displayMs2GeV(), "ms2GeV"); + MLPutRuleTo(link, qedqcd.displayMcMc(), "mcmc"); + + const flexiblesusy::CKM_parameters ckm(qedqcd.displayCKM()); MLPutRuleTo(link, ckm.theta_12, "CKMTheta12"); MLPutRuleTo(link, ckm.theta_13, "CKMTheta13"); MLPutRuleTo(link, ckm.theta_23, "CKMTheta23"); MLPutRuleTo(link, ckm.delta , "CKMDelta"); - const flexiblesusy::PMNS_parameters pmns(data.qedqcd.displayPMNS()); + const flexiblesusy::PMNS_parameters pmns(qedqcd.displayPMNS()); MLPutRuleTo(link, pmns.theta_12, "PMNSTheta12"); MLPutRuleTo(link, pmns.theta_13, "PMNSTheta13"); MLPutRuleTo(link, pmns.theta_23, "PMNSTheta23"); @@ -327,15 +371,15 @@ void put_sm_input_parameters(const @ModelName@_data& data, MLINK link) MLPutRuleTo(link, pmns.alpha_1 , "PMNSAlpha1"); MLPutRuleTo(link, pmns.alpha_2 , "PMNSAlpha2"); - MLPutRuleTo(link, data.physical_input.get(Physical_input::alpha_em_0), "alphaEm0"); - MLPutRuleTo(link, data.physical_input.get(Physical_input::mh_pole), "Mh"); + MLPutRuleTo(link, physical_input.get(Physical_input::alpha_em_0), "alphaEm0"); + MLPutRuleTo(link, physical_input.get(Physical_input::mh_pole), "Mh"); MLEndPacket(link); } /******************************************************************/ -void put_input_parameters(const @ModelName@_data& data, MLINK link) +void @ModelName@_data::put_input_parameters(MLINK link) const { MLPutFunction(link, "List", @numberOfInputParameterRules@); @@ -411,9 +455,10 @@ void put_masses(MLINK link, const std::string& rule, /******************************************************************/ -void put_problems(const @ModelName@_data& data, MLINK link) +template +void @ModelName@_model_data::put_problems(MLINK link) const { - const auto& problems = std::get<0>(data.models).get_problems(); + const auto& problems = std::get<0>(models).get_problems(); const auto n_problems = number_of_problems(problems); MLPutFunction(link, "List", n_problems); @@ -440,9 +485,10 @@ void put_problems(const @ModelName@_data& data, MLINK link) /******************************************************************/ -void put_warnings(const @ModelName@_data& data, MLINK link) +template +void @ModelName@_model_data::put_warnings(MLINK link) const { - const auto& problems = std::get<0>(data.models).get_problems(); + const auto& problems = std::get<0>(models).get_problems(); const auto n_warnings = number_of_warnings(problems); MLPutFunction(link, "List", n_warnings); @@ -455,24 +501,24 @@ void put_warnings(const @ModelName@_data& data, MLINK link) /******************************************************************/ -@ModelName@_slha_io get_slha_io(const @ModelName@_data& data) +template +@ModelName@_slha_io @ModelName@_model_data::get_slha_io() const { - const auto& models = data.models; const auto& problems = std::get<0>(models).get_problems(); const auto force_output = std::get<0>(models).do_force_output(); @ModelName@_slha_io slha_io; slha_io.set_spinfo(problems); - slha_io.set_settings(data.settings); - slha_io.set_sminputs(data.qedqcd); - slha_io.set_physical_input(data.physical_input); - slha_io.set_modsel(data.modsel); - slha_io.set_input(data.input); + slha_io.set_settings(settings); + slha_io.set_sminputs(qedqcd); + slha_io.set_physical_input(physical_input); + slha_io.set_modsel(modsel); + slha_io.set_input(input); if (!problems.have_problem() || force_output) { slha_io.set_print_imaginary_parts_of_majorana_mixings( - data.settings.get(Spectrum_generator_settings::force_positive_masses)); + settings.get(Spectrum_generator_settings::force_positive_masses)); slha_io.set_spectrum(models); - slha_io.set_extra(std::get<0>(models), data.scales, data.observables); + slha_io.set_extra(std::get<0>(models), scales, observables); } return slha_io; @@ -480,9 +526,9 @@ void put_warnings(const @ModelName@_data& data, MLINK link) /******************************************************************/ -void put_slha(const @ModelName@_data& data, MLINK link) +void @ModelName@_data::put_slha(MLINK link) const { - const auto slha_io = get_slha_io(data); + const auto slha_io = get_slha_io(); std::ostringstream ostr; slha_io.write_to_stream(ostr); @@ -493,7 +539,8 @@ void put_slha(const @ModelName@_data& data, MLINK link) /******************************************************************/ -void put_spectrum(const standard_model::StandardModel& model, MLINK link) +template +void put_spectrum(const standard_model::StandardModel& model, MLINK link) { MLPutRule(link, standard_model_info::model_name); MLPutFunction(link, "List", 46); @@ -548,7 +595,8 @@ void put_spectrum(const standard_model::StandardModel& model, ML /******************************************************************/ -void put_spectrum(const @ModelName@_slha<@ModelName@ >& model, MLINK link) +template +void put_spectrum(const @ModelName@_slha& model, MLINK link) { MLPutRule(link, @ModelName@_info::model_name); MLPutFunction(link, "List", @numberOfSpectrumEntries@); @@ -579,7 +627,15 @@ void put_spectra(const std::tuple& models, MLINK link) /******************************************************************/ -void put_observables(const @ModelName@_observables& observables, MLINK link) +template +void @ModelName@_model_data::put_model_spectra(MLINK link) const +{ + put_spectra(models, link); +} + +/******************************************************************/ + +void @ModelName@_data::put_observables(MLINK link) const { MLPutFunction(link, "List", @numberOfObservables@); @@ -590,9 +646,10 @@ void put_observables(const @ModelName@_observables& observables, MLINK link) /******************************************************************/ -void check_spectrum(const @ModelName@_data& data, MLINK link) +template +void @ModelName@_model_data::check_spectrum(MLINK link) const { - const auto& problems = std::get<0>(data.models).get_problems(); + const auto& problems = std::get<0>(models).get_problems(); for (const auto& s: problems.get_problem_strings()) put_message(link, "FS@ModelName@CalculateSpectrum", "error", s); @@ -601,93 +658,106 @@ void check_spectrum(const @ModelName@_data& data, MLINK link) put_message(link, "FS@ModelName@CalculateSpectrum", "warning", s); if (problems.have_problem() && - !data.settings.get(Spectrum_generator_settings::force_output)) + settings.get(Spectrum_generator_settings::force_output)) throw EInvalidSpectrum(); } /******************************************************************/ -void calculate_spectrum(@ModelName@_data& data) +template +void @ModelName@_model_data::calculate_spectrum() { - @ModelName@_spectrum_generator spectrum_generator; - spectrum_generator.set_settings(data.settings); - spectrum_generator.set_parameter_output_scale(data.modsel.parameter_output_scale); - spectrum_generator.run(data.qedqcd, data.input); + @ModelName@_spectrum_generator spectrum_generator; + spectrum_generator.set_settings(settings); + spectrum_generator.set_parameter_output_scale(modsel.parameter_output_scale); + spectrum_generator.run(qedqcd, input); + + models = spectrum_generator.get_models_slha(); + scales.HighScale = spectrum_generator.get_high_scale(); + scales.SUSYScale = spectrum_generator.get_susy_scale(); + scales.LowScale = spectrum_generator.get_low_scale(); +} + +/******************************************************************/ - data.models = spectrum_generator.get_models_slha(); - data.scales.HighScale = spectrum_generator.get_high_scale(); - data.scales.SUSYScale = spectrum_generator.get_susy_scale(); - data.scales.LowScale = spectrum_generator.get_low_scale(); +template +void @ModelName@_model_data::calculate_model_observables() +{ + observables = calculate_observables(std::get<0>(models), qedqcd, physical_input); } /******************************************************************/ template -@ModelName@_data make_@ModelName@_data(const Dynamic_array_view& pars) +std::unique_ptr<@ModelName@_data> make_@ModelName@_data(const Dynamic_array_view& pars) { using Index_t = typename Dynamic_array_view::Index_t; - const Index_t n_settings = 23, n_sm_parameters = 29, n_input_pars = @numberOfInputParameters@; + const Index_t n_settings = 24, n_sm_parameters = 29, n_input_pars = @numberOfInputParameters@; const Index_t n_total = n_settings + n_sm_parameters + n_input_pars; if (pars.size() != n_total) throw EWrongNumberOfParameters(pars.size(), n_total); - @ModelName@_data data; Index_t c = 0; // counter - data.settings.set(Spectrum_generator_settings::precision, pars[c++]); - data.settings.set(Spectrum_generator_settings::max_iterations, pars[c++]); - data.settings.set(Spectrum_generator_settings::calculate_sm_masses, pars[c++]); - data.settings.set(Spectrum_generator_settings::pole_mass_loop_order, pars[c++]); - data.settings.set(Spectrum_generator_settings::ewsb_loop_order, pars[c++]); - data.settings.set(Spectrum_generator_settings::beta_loop_order, pars[c++]); - data.settings.set(Spectrum_generator_settings::threshold_corrections_loop_order, pars[c++]); - data.settings.set(Spectrum_generator_settings::higgs_2loop_correction_at_as, pars[c++]); - data.settings.set(Spectrum_generator_settings::higgs_2loop_correction_ab_as, pars[c++]); - data.settings.set(Spectrum_generator_settings::higgs_2loop_correction_at_at, pars[c++]); - data.settings.set(Spectrum_generator_settings::higgs_2loop_correction_atau_atau, pars[c++]); - data.settings.set(Spectrum_generator_settings::force_output, pars[c++]); - data.settings.set(Spectrum_generator_settings::top_pole_qcd_corrections, pars[c++]); - data.settings.set(Spectrum_generator_settings::beta_zero_threshold, pars[c++]); - data.settings.set(Spectrum_generator_settings::force_positive_masses, pars[c++]); - data.settings.set(Spectrum_generator_settings::pole_mass_scale, pars[c++]); - data.settings.set(Spectrum_generator_settings::eft_pole_mass_scale, pars[c++]); - data.settings.set(Spectrum_generator_settings::eft_matching_scale, pars[c++]); - data.settings.set(Spectrum_generator_settings::eft_matching_loop_order_up, pars[c++]); - data.settings.set(Spectrum_generator_settings::eft_matching_loop_order_down, pars[c++]); - data.settings.set(Spectrum_generator_settings::eft_higgs_index, pars[c++]); - data.settings.set(Spectrum_generator_settings::calculate_bsm_masses, pars[c++]); - data.modsel.parameter_output_scale = pars[c++]; - - data.qedqcd.setAlpha(softsusy::ALPHA, pars[c]); - data.qedqcd.setAlphaEmInput(pars[c++]); - data.qedqcd.setFermiConstant(pars[c++]); - data.qedqcd.setAlpha(softsusy::ALPHAS, pars[c]); - data.qedqcd.setAlphaSInput(pars[c++]); - data.qedqcd.setPoleMZ(pars[c]); - data.qedqcd.setMu(pars[c++]); - data.qedqcd.setMass(softsusy::mBottom, pars[c]); - data.qedqcd.setMbMb(pars[c++]); - data.qedqcd.setPoleMt(pars[c++]); - data.qedqcd.setMass(softsusy::mTau, pars[c]); - data.qedqcd.setPoleMtau(pars[c++]); - data.qedqcd.setNeutrinoPoleMass(3, pars[c++]); - data.qedqcd.setPoleMW(pars[c++]); - data.qedqcd.setMass(softsusy::mElectron, pars[c]); - data.qedqcd.setPoleMel(pars[c++]); - data.qedqcd.setNeutrinoPoleMass(1, pars[c++]); - data.qedqcd.setMass(softsusy::mMuon, pars[c]); - data.qedqcd.setPoleMmuon(pars[c++]); - data.qedqcd.setNeutrinoPoleMass(2, pars[c++]); - data.qedqcd.setMass(softsusy::mDown, pars[c]); - data.qedqcd.setMd2GeV(pars[c++]); - data.qedqcd.setMass(softsusy::mUp, pars[c]); - data.qedqcd.setMu2GeV(pars[c++]); - data.qedqcd.setMass(softsusy::mStrange, pars[c]); - data.qedqcd.setMs2GeV(pars[c++]); - data.qedqcd.setMass(softsusy::mCharm, pars[c]); - data.qedqcd.setMcMc(pars[c++]); + Spectrum_generator_settings settings; + settings.set(Spectrum_generator_settings::precision, pars[c++]); + settings.set(Spectrum_generator_settings::max_iterations, pars[c++]); + settings.set(Spectrum_generator_settings::solver, pars[c++]); + settings.set(Spectrum_generator_settings::calculate_sm_masses, pars[c++]); + settings.set(Spectrum_generator_settings::pole_mass_loop_order, pars[c++]); + settings.set(Spectrum_generator_settings::ewsb_loop_order, pars[c++]); + settings.set(Spectrum_generator_settings::beta_loop_order, pars[c++]); + settings.set(Spectrum_generator_settings::threshold_corrections_loop_order, pars[c++]); + settings.set(Spectrum_generator_settings::higgs_2loop_correction_at_as, pars[c++]); + settings.set(Spectrum_generator_settings::higgs_2loop_correction_ab_as, pars[c++]); + settings.set(Spectrum_generator_settings::higgs_2loop_correction_at_at, pars[c++]); + settings.set(Spectrum_generator_settings::higgs_2loop_correction_atau_atau, pars[c++]); + settings.set(Spectrum_generator_settings::force_output, pars[c++]); + settings.set(Spectrum_generator_settings::top_pole_qcd_corrections, pars[c++]); + settings.set(Spectrum_generator_settings::beta_zero_threshold, pars[c++]); + settings.set(Spectrum_generator_settings::force_positive_masses, pars[c++]); + settings.set(Spectrum_generator_settings::pole_mass_scale, pars[c++]); + settings.set(Spectrum_generator_settings::eft_pole_mass_scale, pars[c++]); + settings.set(Spectrum_generator_settings::eft_matching_scale, pars[c++]); + settings.set(Spectrum_generator_settings::eft_matching_loop_order_up, pars[c++]); + settings.set(Spectrum_generator_settings::eft_matching_loop_order_down, pars[c++]); + settings.set(Spectrum_generator_settings::eft_higgs_index, pars[c++]); + settings.set(Spectrum_generator_settings::calculate_bsm_masses, pars[c++]); + + SLHA_io::Modsel modsel; + modsel.parameter_output_scale = pars[c++]; + + softsusy::QedQcd qedqcd; + qedqcd.setAlpha(softsusy::ALPHA, pars[c]); + qedqcd.setAlphaEmInput(pars[c++]); + qedqcd.setFermiConstant(pars[c++]); + qedqcd.setAlpha(softsusy::ALPHAS, pars[c]); + qedqcd.setAlphaSInput(pars[c++]); + qedqcd.setPoleMZ(pars[c]); + qedqcd.setMu(pars[c++]); + qedqcd.setMass(softsusy::mBottom, pars[c]); + qedqcd.setMbMb(pars[c++]); + qedqcd.setPoleMt(pars[c++]); + qedqcd.setMass(softsusy::mTau, pars[c]); + qedqcd.setPoleMtau(pars[c++]); + qedqcd.setNeutrinoPoleMass(3, pars[c++]); + qedqcd.setPoleMW(pars[c++]); + qedqcd.setMass(softsusy::mElectron, pars[c]); + qedqcd.setPoleMel(pars[c++]); + qedqcd.setNeutrinoPoleMass(1, pars[c++]); + qedqcd.setMass(softsusy::mMuon, pars[c]); + qedqcd.setPoleMmuon(pars[c++]); + qedqcd.setNeutrinoPoleMass(2, pars[c++]); + qedqcd.setMass(softsusy::mDown, pars[c]); + qedqcd.setMd2GeV(pars[c++]); + qedqcd.setMass(softsusy::mUp, pars[c]); + qedqcd.setMu2GeV(pars[c++]); + qedqcd.setMass(softsusy::mStrange, pars[c]); + qedqcd.setMs2GeV(pars[c++]); + qedqcd.setMass(softsusy::mCharm, pars[c]); + qedqcd.setMcMc(pars[c++]); { flexiblesusy::CKM_parameters ckm; @@ -695,7 +765,7 @@ template ckm.theta_13 = pars[c++]; ckm.theta_23 = pars[c++]; ckm.delta = pars[c++]; - data.qedqcd.setCKM(ckm); + qedqcd.setCKM(ckm); } { @@ -706,14 +776,29 @@ template pmns.delta = pars[c++]; pmns.alpha_1 = pars[c++]; pmns.alpha_2 = pars[c++]; - data.qedqcd.setPMNS(pmns); + qedqcd.setPMNS(pmns); } - data.physical_input.set(Physical_input::alpha_em_0, pars[c++]); - data.physical_input.set(Physical_input::mh_pole, pars[c++]); + Physical_input physical_input; + physical_input.set(Physical_input::alpha_em_0, pars[c++]); + physical_input.set(Physical_input::mh_pole, pars[c++]); + @ModelName@_input_parameters input; @setInputParameters@ + std::unique_ptr<@ModelName@_data> data; + switch (static_cast(settings.get(Spectrum_generator_settings::solver))) { +@initialiseDataPointer@ + default: + throw SetupError("invalid solver type"); + } + + data->set_settings(settings); + data->set_modsel(modsel); + data->set_sm_input_parameters(qedqcd); + data->set_physical_input(physical_input); + data->set_input_parameters(input); + return data; } @@ -743,7 +828,7 @@ DLLEXPORT int FS@ModelName@GetSettings(WolframLibraryData /* libData */, MLINK l const auto hid = get_handle_from(link); try { - put_settings(find_@ModelName@_data(hid), link); + find_@ModelName@_data(hid)->put_settings(link); } catch (const flexiblesusy::Error& e) { std::cerr << e.what() << std::endl; put_error_output(link); @@ -762,7 +847,7 @@ DLLEXPORT int FS@ModelName@GetSMInputParameters(WolframLibraryData /* libData */ const auto hid = get_handle_from(link); try { - put_sm_input_parameters(find_@ModelName@_data(hid), link); + find_@ModelName@_data(hid)->put_sm_input_parameters(link); } catch (const flexiblesusy::Error& e) { std::cerr << e.what() << std::endl; put_error_output(link); @@ -781,7 +866,7 @@ DLLEXPORT int FS@ModelName@GetInputParameters(WolframLibraryData /* libData */, const auto hid = get_handle_from(link); try { - put_input_parameters(find_@ModelName@_data(hid), link); + find_@ModelName@_data(hid)->put_input_parameters(link); } catch (const flexiblesusy::Error& e) { std::cerr << e.what() << std::endl; put_error_output(link); @@ -878,7 +963,7 @@ DLLEXPORT int FS@ModelName@GetProblems( const auto hid = get_handle_from(link); try { - put_problems(find_@ModelName@_data(hid), link); + find_@ModelName@_data(hid)->put_problems(link); } catch (const flexiblesusy::Error& e) { std::cerr << e.what() << std::endl; put_error_output(link); @@ -897,7 +982,7 @@ DLLEXPORT int FS@ModelName@ToSLHA(WolframLibraryData /* libData */, MLINK link) const auto hid = get_handle_from(link); try { - put_slha(find_@ModelName@_data(hid), link); + find_@ModelName@_data(hid)->put_slha(link); } catch (const flexiblesusy::Error& e) { std::cerr << e.what() << std::endl; put_error_output(link); @@ -917,7 +1002,7 @@ DLLEXPORT int FS@ModelName@GetWarnings( const auto hid = get_handle_from(link); try { - put_warnings(find_@ModelName@_data(hid), link); + find_@ModelName@_data(hid)->put_warnings(link); } catch (const flexiblesusy::Error& e) { std::cerr << e.what() << std::endl; put_error_output(link); @@ -937,17 +1022,15 @@ DLLEXPORT int FS@ModelName@CalculateSpectrum( const auto hid = get_handle_from(link); try { - auto data = find_@ModelName@_data(hid); + auto& data = find_@ModelName@_data(hid); { Redirect_output crd(link); - calculate_spectrum(data); + data->calculate_spectrum(); } - handles_@ModelName@[hid] = data; - - check_spectrum(data, link); - put_spectra(data.models, link); + data->check_spectrum(link); + data->put_model_spectra(link); } catch (const flexiblesusy::Error&) { put_error_output(link); } @@ -966,9 +1049,9 @@ DLLEXPORT int FS@ModelName@CalculateObservables( const auto hid = get_handle_from(link); try { - auto data = find_@ModelName@_data(hid); + auto& data = find_@ModelName@_data(hid); - if (std::get<0>(data.models).get_scale() == 0.) { + if (data->get_model_scale() == 0.) { put_message(link, "FS@ModelName@CalculateObservables", "warning", "Renormalization scale is 0. Did you run " @@ -977,13 +1060,10 @@ DLLEXPORT int FS@ModelName@CalculateObservables( { Redirect_output crd(link); - data.observables = - calculate_observables(std::get<0>(data.models), data.qedqcd, data.physical_input); + data->calculate_model_observables(); } - handles_@ModelName@[hid] = data; - - put_observables(data.observables, link); + data->put_observables(link); } catch (const flexiblesusy::Error& e) { put_message(link, "FS@ModelName@CalculateObservables", "error", e.what()); put_error_output(link); diff --git a/templates/librarylink.m.in b/templates/librarylink.m.in index 6206c018a..218bc9d0a 100644 --- a/templates/librarylink.m.in +++ b/templates/librarylink.m.in @@ -27,6 +27,7 @@ FS@ModelName@Message[s_] := Message[FS@ModelName@::info, s]; fsDefaultSettings = { precisionGoal -> 1.*^-4, (* FlexibleSUSY[0] *) maxIterations -> 0, (* FlexibleSUSY[1] *) + solver -> @defaultSolverType@, (* FlexibleSUSY[2] *) calculateStandardModelMasses -> 0, (* FlexibleSUSY[3] *) poleMassLoopOrder -> 2, (* FlexibleSUSY[4] *) ewsbLoopOrder -> 2, (* FlexibleSUSY[5] *) @@ -101,6 +102,7 @@ FS@ModelName@OpenHandle[OptionsPattern[]] := (* spectrum generator settings *) OptionValue[precisionGoal], OptionValue[maxIterations], + OptionValue[solver], OptionValue[calculateStandardModelMasses], OptionValue[poleMassLoopOrder], OptionValue[ewsbLoopOrder], From 76423539bf45052c9d5c37fcb3a7521fae51d825 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 2 Dec 2016 22:04:24 +1030 Subject: [PATCH 32/34] Fix bug in testing for valid spectrum and ensure default operations are available for all classes. Thanks to Alex Voigt for spotting these! --- templates/librarylink.cpp.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/librarylink.cpp.in b/templates/librarylink.cpp.in index 7db081929..83281145c 100644 --- a/templates/librarylink.cpp.in +++ b/templates/librarylink.cpp.in @@ -139,7 +139,12 @@ public: class @ModelName@_data { public: + @ModelName@_data() = default; + @ModelName@_data(const @ModelName@_data&) = default; + @ModelName@_data(@ModelName@_data&&) = default; virtual ~@ModelName@_data() {}; + @ModelName@_data& operator=(const @ModelName@_data&) = default; + @ModelName@_data& operator=(@ModelName@_data&&) = default; void set_input_parameters(const @ModelName@_input_parameters& input_) { input = input_; } void set_physical_input(const Physical_input& p) { physical_input = p; } @@ -176,6 +181,13 @@ protected: template class @ModelName@_model_data : public @ModelName@_data { public: + @ModelName@_model_data() = default; + @ModelName@_model_data(const @ModelName@_model_data&) = default; + @ModelName@_model_data(@ModelName@_model_data&&) = default; + virtual ~@ModelName@_model_data() {}; + @ModelName@_model_data& operator=(const @ModelName@_model_data&) = default; + @ModelName@_model_data& operator=(@ModelName@_model_data&&) = default; + virtual void put_problems(MLINK link) const override; virtual void put_warnings(MLINK link) const override; virtual void put_model_spectra(MLINK link) const override; @@ -658,7 +670,7 @@ void @ModelName@_model_data::check_spectrum(MLINK link) const put_message(link, "FS@ModelName@CalculateSpectrum", "warning", s); if (problems.have_problem() && - settings.get(Spectrum_generator_settings::force_output)) + !settings.get(Spectrum_generator_settings::force_output)) throw EInvalidSpectrum(); } From 3736557e594527d8e91892c33c1b14d831b9e645 Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 2 Dec 2016 22:08:10 +1030 Subject: [PATCH 33/34] Build Mathematica interface for all solvers --- templates/module.mk | 6 +++--- templates/module.mk.in | 8 ++++++-- templates/two_scale.mk.in | 6 ------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/templates/module.mk b/templates/module.mk index 0aa791568..c28d91ddc 100644 --- a/templates/module.mk +++ b/templates/module.mk @@ -13,6 +13,8 @@ BASE_TEMPLATES := \ $(DIR)/initial_guesser.hpp.in \ $(DIR)/input_parameters.hpp.in \ $(DIR)/input_parameters.cpp.in \ + $(DIR)/librarylink.cpp.in \ + $(DIR)/librarylink.m.in \ $(DIR)/low_scale_constraint.hpp.in \ $(DIR)/mass_eigenstates.hpp.in \ $(DIR)/mass_eigenstates.cpp.in \ @@ -25,6 +27,7 @@ BASE_TEMPLATES := \ $(DIR)/plot_rgflow.gnuplot.in \ $(DIR)/plot_spectrum.gnuplot.in \ $(DIR)/run.cpp.in \ + $(DIR)/run.m.in \ $(DIR)/run_cmd_line.cpp.in \ $(DIR)/scan.cpp.in \ $(DIR)/slha_io.hpp.in \ @@ -44,9 +47,6 @@ BASE_TEMPLATES := \ $(DIR)/utilities.cpp.in TWO_SCALE_TEMPLATES := \ - $(DIR)/librarylink.cpp.in \ - $(DIR)/librarylink.m.in \ - $(DIR)/run.m.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.cpp.in \ $(DIR)/standard_model_two_scale_high_scale_initial_guesser.hpp.in \ $(DIR)/standard_model_two_scale_high_scale_spectrum_generator.hpp.in \ diff --git a/templates/module.mk.in b/templates/module.mk.in index 9e384e6fa..6573b361d 100644 --- a/templates/module.mk.in +++ b/templates/module.mk.in @@ -49,8 +49,12 @@ EXE@CLASSNAME@_SRC := \ $(DIR)/scan_@CLASSNAME@.cpp LL@CLASSNAME@_LIB := LL@CLASSNAME@_OBJ := -LL@CLASSNAME@_SRC := -LL@CLASSNAME@_MMA := +LL@CLASSNAME@_SRC := \ + $(DIR)/@CLASSNAME@_librarylink.cpp + +LL@CLASSNAME@_MMA := \ + $(DIR)/@CLASSNAME@_librarylink.m \ + $(DIR)/run_@CLASSNAME@.m LIB@CLASSNAME@_HDR := \ $(DIR)/@CLASSNAME@_a_muon.hpp \ diff --git a/templates/two_scale.mk.in b/templates/two_scale.mk.in index 4095eee46..29b227caa 100644 --- a/templates/two_scale.mk.in +++ b/templates/two_scale.mk.in @@ -41,10 +41,4 @@ LIB@ModelName@_HDR += \ $(DIR)/@ModelName@_two_scale_model.hpp \ $(DIR)/@ModelName@_two_scale_spectrum_generator.hpp \ $(DIR)/@ModelName@_two_scale_susy_scale_constraint.hpp -LL@ModelName@_SRC += \ - $(DIR)/@ModelName@_librarylink.cpp - -LL@ModelName@_MMA += \ - $(DIR)/@ModelName@_librarylink.m \ - $(DIR)/run_@ModelName@.m From 1894362c1156d53d5a88936f051171c494c861cc Mon Sep 17 00:00:00 2001 From: Dylan Harries Date: Fri, 2 Dec 2016 22:10:12 +1030 Subject: [PATCH 34/34] Provide default solver in example run.m --- templates/run.m.in | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/run.m.in b/templates/run.m.in index f45835c6b..2a5afbb3b 100644 --- a/templates/run.m.in +++ b/templates/run.m.in @@ -4,6 +4,7 @@ handle = FS@ModelName@OpenHandle[ fsSettings -> { precisionGoal -> 1.*^-4, (* FlexibleSUSY[0] *) maxIterations -> 0, (* FlexibleSUSY[1] *) + solver -> @defaultSolverType@ (* FlexibleSUSY[2] *) calculateStandardModelMasses -> 0, (* FlexibleSUSY[3] *) poleMassLoopOrder -> 2, (* FlexibleSUSY[4] *) ewsbLoopOrder -> 2, (* FlexibleSUSY[5] *)