Skip to content

Commit

Permalink
Add skeleton templates for semi-analytic model
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Harries committed Dec 16, 2016
1 parent 14cff3a commit 606042a
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 1 deletion.
17 changes: 17 additions & 0 deletions meta/FlexibleSUSY.m
Expand Up @@ -1276,6 +1276,9 @@ corresponding tadpole is real or imaginary (only in models with CP
WriteTwoScaleModelClass[files_List] :=
WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }];

WriteSemiAnalyticModelClass[files_List] :=
WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }];

WriteTwoScaleSpectrumGeneratorClass[files_List] :=
Module[{fillSMFermionPoleMasses = ""},
fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[];
Expand Down Expand Up @@ -2796,6 +2799,20 @@ corresponding tadpole is real or imaginary (only in models with CP

]; (* If[HaveBVPSolver[FlexibleSUSY`TwoScaleSolver] *)

If[HaveBVPSolver[FlexibleSUSY`SemiAnalyticSolver],
PrintHeadline["Creating semi-analytic solver"];

Print["Creating class for semi-analytic model ..."];
WriteSemiAnalyticModelClass[{{FileNameJoin[{$flexiblesusyTemplateDir, "semi_analytic_model.hpp.in"}],
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_semi_analytic_model.hpp"}]},
{FileNameJoin[{$flexiblesusyTemplateDir, "semi_analytic_model.cpp.in"}],
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_semi_analytic_model.cpp"}]}}];

Print["Creating makefile module for semi-analytic solver ..."];
WriteBVPSolverMakefile[{{FileNameJoin[{$flexiblesusyTemplateDir, "semi_analytic.mk.in"}],
FileNameJoin[{FSOutputDir, "semi_analytic.mk"}]}}];
]; (* If[HaveBVPSolver[FlexibleSUSY`SemiAnalyticSolver] *)

PrintHeadline["Creating observables"];
Print["Creating class for effective couplings ..."];
(* @note separating this out for now for simplicity *)
Expand Down
7 changes: 6 additions & 1 deletion templates/module.mk
Expand Up @@ -76,9 +76,14 @@ TWO_SCALE_TEMPLATES := \
$(DIR)/two_scale_susy_scale_constraint.hpp.in \
$(DIR)/two_scale_susy_scale_constraint.cpp.in

SEMI_ANALYTIC_TEMPLATES := \
$(DIR)/semi_analytic_model.hpp.in \
$(DIR)/semi_analytic_model.cpp.in

TEMPLATES := \
$(BASE_TEMPLATES) \
$(TWO_SCALE_TEMPLATES)
$(TWO_SCALE_TEMPLATES) \
$(SEMI_ANALYTIC_TEMPLATES)

.PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME)

Expand Down
24 changes: 24 additions & 0 deletions templates/semi_analytic.mk.in
@@ -0,0 +1,24 @@
# ====================================================================
# 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
# <http://www.gnu.org/licenses/>.
# ====================================================================

@ModelName@_INCLUDE_MK += $(DIR)/semi_analytic.mk

LIB@ModelName@_SRC += \
$(DIR)/@ModelName@_semi_analytic_model.cpp
LIB@ModelName@_HDR += \
$(DIR)/@ModelName@_semi_analytic_model.hpp
86 changes: 86 additions & 0 deletions templates/semi_analytic_model.cpp.in
@@ -0,0 +1,86 @@
// ====================================================================
// 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
// <http://www.gnu.org/licenses/>.
// ====================================================================

// File generated at @DateAndTime@

/**
* @file @ModelName@_semi_analytic_model.cpp
* @brief implementation of the @ModelName@ model class
*
* Contains the definition of the @ModelName@ model class methods
* which solve EWSB and calculate pole masses and mixings from DRbar
* parameters.
*
* This file was generated at @DateAndTime@ with FlexibleSUSY
* @FlexibleSUSYVersion@ (git commit: @FlexibleSUSYGitCommit@) and SARAH @SARAHVersion@ .
*/

#include "@ModelName@_semi_analytic_model.hpp"

namespace flexiblesusy {

using namespace @ModelName@_info;

#define CLASSNAME @ModelName@<Semi_analytic>

CLASSNAME::@ModelName@(const @ModelName@_input_parameters& input_)
: @ModelName@_mass_eigenstates(input_)
{
}

CLASSNAME::~@ModelName@()
{
}

void CLASSNAME::calculate_spectrum()
{
@ModelName@_mass_eigenstates::calculate_spectrum();
}

void CLASSNAME::clear_problems()
{
@ModelName@_mass_eigenstates::clear_problems();
}

std::string CLASSNAME::name() const
{
return @ModelName@_mass_eigenstates::name();
}

void CLASSNAME::run_to(double scale, double eps)
{
@ModelName@_mass_eigenstates::run_to(scale, eps);
}

void CLASSNAME::print(std::ostream& out) const
{
@ModelName@_mass_eigenstates::print(out);
}

void CLASSNAME::set_precision(double p)
{
@ModelName@_mass_eigenstates::set_precision(p);
}

std::ostream& operator<<(std::ostream& ostr, const @ModelName@<Semi_analytic>& model)
{
model.print(ostr);
return ostr;
}

} // namespace flexiblesusy
67 changes: 67 additions & 0 deletions templates/semi_analytic_model.hpp.in
@@ -0,0 +1,67 @@
// ====================================================================
// 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
// <http://www.gnu.org/licenses/>.
// ====================================================================

// File generated at @DateAndTime@

/**
* @file @ModelName@_semi_analytic_model.hpp
* @brief contains class for model with routines needed to solve boundary
* value problem using the semi_analytic solver by solving EWSB
* and determine the pole masses and mixings
*
* This file was generated at @DateAndTime@ with FlexibleSUSY
* @FlexibleSUSYVersion@ (git commit: @FlexibleSUSYGitCommit@) and SARAH @SARAHVersion@ .
*/

#ifndef @ModelName@_SEMI_ANALYTIC_MODEL_H
#define @ModelName@_SEMI_ANALYTIC_MODEL_H

#include "@ModelName@_model.hpp"
#include "@ModelName@_mass_eigenstates.hpp"

namespace flexiblesusy {

class Semi_analytic;
/**
* @class @ModelName@<Semi_analytic>
* @brief model class with routines for determining masses and mixings and EWSB
*/
template<>
class @ModelName@<Semi_analytic> : public @ModelName@_mass_eigenstates {
public:
explicit @ModelName@(const @ModelName@_input_parameters& input_ = @ModelName@_input_parameters());
@ModelName@(const @ModelName@&) = default;
@ModelName@(@ModelName@&&) = default;
virtual ~@ModelName@();
@ModelName@& operator=(const @ModelName@&) = default;
@ModelName@& operator=(@ModelName@&&) = default;

// interface functions
virtual void calculate_spectrum();
virtual void clear_problems();
virtual std::string name() const;
virtual void run_to(double scale, double eps = -1.0);
virtual void print(std::ostream& out = std::cout) const;
virtual void set_precision(double);
};

std::ostream& operator<<(std::ostream&, const @ModelName@<Semi_analytic>&);

} // namespace flexiblesusy

#endif

0 comments on commit 606042a

Please sign in to comment.