From c90272891099d52f206060167972e350452534ab Mon Sep 17 00:00:00 2001 From: Alexander Voigt Date: Tue, 17 Jan 2017 14:53:18 +0100 Subject: [PATCH] do not import @ModelName@_info namespace because it contains C-style enums. These enums would be imported as well, which might lead to ambiguities. --- meta/LoopMasses.m | 10 +++++----- meta/ThresholdCorrections.m | 3 +-- meta/TreeMasses.m | 8 +++++--- templates/mass_eigenstates.cpp.in | 2 -- templates/two_scale_model.cpp.in | 2 -- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/meta/LoopMasses.m b/meta/LoopMasses.m index 11377a79f..c9c0649ce 100644 --- a/meta/LoopMasses.m +++ b/meta/LoopMasses.m @@ -144,7 +144,7 @@ "const double self_energy = Re(" <> selfEnergyFunction <> "(p));\n" <> "const double mass_sqr = " <> massMatrixName <> " - self_energy;\n\n" <> "if (mass_sqr < 0.)\n" <> - IndentText["problems.flag_tachyon(" <> particleName <> ");"] <> "\n\n" <> + IndentText[TreeMasses`FlagTachyon[particleName]] <> "\n" <> "PHYSICAL(" <> massName <> ") = AbsSqrt(mass_sqr);\n"; @@ -697,7 +697,7 @@ be set to the (positive) tree-level mass. M_tree Module[{result, body = ""}, If[!IsFermion[particle] && !(IsUnmixed[particle] && GetMassOfUnmixedParticle[particle] === 0), - body = "if (!force_output && problems.is_tachyon(" <> ToValidCSymbolString[particle] <> "))\n" <> + body = "if (!force_output && problems.is_tachyon(" <> FlexibleSUSY`FSModelName <> "_info::" <> ToValidCSymbolString[particle] <> "))\n" <> IndentText["return;"] <> "\n\n"; ]; body = body <> DoDiagonalization[particle, precision, tadpole]; @@ -726,7 +726,7 @@ be set to the (positive) tree-level mass. M_tree Return[""]; ]; If[!(IsUnmixed[particle] && GetMassOfUnmixedParticle[particle] === 0), - body = "if (!force_output && problems.is_tachyon(" <> ToValidCSymbolString[particle] <> "))\n" <> + body = "if (!force_output && problems.is_tachyon(" <> FlexibleSUSY`FSModelName <> "_info::" <> ToValidCSymbolString[particle] <> "))\n" <> IndentText["return 0.;"] <> "\n\n"; ]; If[!IsMassless[particle], @@ -745,7 +745,7 @@ be set to the (positive) tree-level mass. M_tree "const double self_energy = Re(" <> selfEnergyFunction <> "(p));\n" <> "const double mass_sqr = " <> mTree <> " - self_energy;\n\n" <> "if (mass_sqr < 0.)\n" <> - IndentText["problems.flag_tachyon(" <> particleName <> ");"] <> "\n\n" <> + IndentText[TreeMasses`FlagTachyon[particleName]] <> "\n" <> "return AbsSqrt(mass_sqr);\n"; , body = "return 0.;\n"; @@ -1110,7 +1110,7 @@ be set to the (positive) tree-level mass. M_tree "const double self_energy = Re(" <> selfEnergyFunction <> "(p));\n" <> "const double mass_sqr = Sqr(m_pole) + self_energy;\n\n" <> "if (mass_sqr < 0.) {\n" <> - IndentText["problems.flag_tachyon(" <> particleName <> ");\n" <> + IndentText[TreeMasses`FlagTachyon[particleName] <> "return m_pole;"] <> "\n}\n\n" <> "return AbsSqrt(mass_sqr);\n"; ]; diff --git a/meta/ThresholdCorrections.m b/meta/ThresholdCorrections.m index d0f2fe575..1bb3abd04 100644 --- a/meta/ThresholdCorrections.m +++ b/meta/ThresholdCorrections.m @@ -601,8 +601,7 @@ const double mw_pole_sqr = Sqr(mw_drbar) - self_energy_w_at_mw; if (mw_pole_sqr < 0.) - MODEL->get_problems().flag_tachyon(" <> FlexibleSUSY`FSModelName <> "_info::" <> wStr <> "); - + " <> TreeMasses`FlagTachyon[wStr, "MODEL->get_problems()."] <> " return AbsSqrt(mw_pole_sqr);" ]; diff --git a/meta/TreeMasses.m b/meta/TreeMasses.m index bfe2192fb..4a1bff317 100644 --- a/meta/TreeMasses.m +++ b/meta/TreeMasses.m @@ -201,6 +201,8 @@ CallDiagonalizeSymmetricFunction::usage=""; CallDiagonalizeHermitianFunction::usage=""; +FlagTachyon::usage = ""; + Begin["`Private`"]; unrotatedParticles = {}; @@ -1286,7 +1288,7 @@ the fundamental representation of SU(3) in SARAH. WrapMacro[CConversion`ToValidCSymbolString[FlexibleSUSY`M[particle]],macro] <> If[dimEnd > 1, ".tail<" <> ToString[dimEnd - dimStart + 1] <> ">().minCoeff()", ""]<> " < 0.) " <> - "problems.flag_tachyon(" <> particleName <> ");\n" + FlagTachyon[particleName] ]; CheckPoleMassesForTachyons[macro_String] := @@ -1374,8 +1376,8 @@ the fundamental representation of SU(3) in SARAH. {prototype, def} ]; -FlagTachyon[particle_String] := - "problems.flag_tachyon(" <> +FlagTachyon[particle_String, problems_String:"problems."] := + problems <> "flag_tachyon(" <> FlexibleSUSY`FSModelName <> "_info::" <> particle <> ");\n"; diff --git a/templates/mass_eigenstates.cpp.in b/templates/mass_eigenstates.cpp.in index f973549d9..2890c6c11 100644 --- a/templates/mass_eigenstates.cpp.in +++ b/templates/mass_eigenstates.cpp.in @@ -57,8 +57,6 @@ namespace flexiblesusy { -using namespace @ModelName@_info; - #define CLASSNAME @ModelName@_mass_eigenstates #define PHYSICAL(parameter) physical.parameter diff --git a/templates/two_scale_model.cpp.in b/templates/two_scale_model.cpp.in index a8309f840..3e1882906 100644 --- a/templates/two_scale_model.cpp.in +++ b/templates/two_scale_model.cpp.in @@ -34,8 +34,6 @@ namespace flexiblesusy { -using namespace @ModelName@_info; - #define CLASSNAME @ModelName@ CLASSNAME::@ModelName@(const @ModelName@_input_parameters& input_)