forked from Expander/FlexibleSUSY
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add matching constraints to save values of matched parameters
- Loading branch information
Dylan Harries
committed
May 29, 2017
1 parent
5a61ec3
commit 293d226
Showing
3 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
// <http://www.gnu.org/licenses/>. | ||
// ==================================================================== | ||
|
||
// File generated at @DateAndTime@ | ||
|
||
#ifndef @ModelName@_MATCHING_CONSTRAINT_H | ||
#define @ModelName@_MATCHING_CONSTRAINT_H | ||
|
||
namespace flexiblesusy { | ||
|
||
template <class T> | ||
class @ModelName@_matching_constraint; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// ==================================================================== | ||
// 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@ | ||
|
||
#include "@ModelName@_semi_analytic_matching_constraint.hpp" | ||
#include "@ModelName@_semi_analytic_model.hpp" | ||
#include "@ModelName@_standard_model_semi_analytic_matching.hpp" | ||
#include "wrappers.hpp" | ||
#include "logger.hpp" | ||
#include "ew_input.hpp" | ||
|
||
#include <cmath> | ||
|
||
namespace flexiblesusy { | ||
|
||
#define DERIVEDPARAMETER(p) matching_model.p() | ||
#define INPUTPARAMETER(p) matching_model.get_input().p | ||
#define MODELPARAMETER(p) matching_model.get_##p() | ||
#define PHASE(p) matching_model.get_##p() | ||
#define BETAPARAMETER(p) beta_functions.get_##p() | ||
#define BETAPARAMETER1(l,p) beta_functions_##l##L.get_##p() | ||
#define BETA(p) beta_##p | ||
#define BETA1(l,p) beta_##l##L_##p | ||
#define LowEnergyConstant(p) Electroweak_constants::p | ||
#define MZPole qedqcd.displayPoleMZ() | ||
#define STANDARDDEVIATION(p) Electroweak_constants::Error_##p | ||
#define Pole(p) matching_model.get_physical().p | ||
#define SCALE model->get_scale() | ||
#define THRESHOLD static_cast<int>(model->get_thresholds()) | ||
#define MODEL model | ||
#define MODELCLASSNAME @ModelName@<Semi_analytic> | ||
|
||
@ModelName@_matching_constraint<Semi_analytic>::@ModelName@_matching_constraint( | ||
@ModelName@<Semi_analytic>* model_) | ||
: model(model_) | ||
{ | ||
} | ||
|
||
void @ModelName@_matching_constraint<Semi_analytic>::apply() | ||
{ | ||
check_model_ptr(); | ||
check_matching_condition_ptr(); | ||
|
||
// apply matched parameter values | ||
const auto& matching_model = matching_condition->get_model(); | ||
@applyConstraint@ | ||
} | ||
|
||
void @ModelName@_matching_constraint<Semi_analytic>::set_model(Model* model_) | ||
{ | ||
model = cast_model<@ModelName@<Semi_analytic>*>(model_); | ||
} | ||
|
||
void @ModelName@_matching_constraint<Semi_analytic>::check_model_ptr() const | ||
{ | ||
if (!model) | ||
throw SetupError("@ModelName@_matching_constraint<Semi_analytic>: " | ||
"model pointer is zero!"); | ||
} | ||
|
||
void @ModelName@_matching_constraint<Semi_analytic>::check_matching_condition_ptr() const | ||
{ | ||
if (!matching_condition) | ||
throw SetupError("@ModelName@_matching_constraint<Semi_analytic>: " | ||
"matching condition pointer is zero!"); | ||
} | ||
|
||
} // namespace flexiblesusy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
// <http://www.gnu.org/licenses/>. | ||
// ==================================================================== | ||
|
||
// File generated at @DateAndTime@ | ||
|
||
#ifndef @ModelName@_SEMI_ANALYTIC_MATCHING_CONSTRAINT_H | ||
#define @ModelName@_SEMI_ANALYTIC_MATCHING_CONSTRAINT_H | ||
|
||
#include "@ModelName@_matching_constraint.hpp" | ||
#include "single_scale_constraint.hpp" | ||
|
||
namespace flexiblesusy { | ||
|
||
template <class T> | ||
class @ModelName@; | ||
|
||
template <class T> | ||
class @ModelName@_standard_model_matching_up; | ||
|
||
class Semi_analytic; | ||
|
||
template<> | ||
class @ModelName@_matching_constraint<Semi_analytic> : public Single_scale_constraint { | ||
public: | ||
@ModelName@_matching_constraint() = default; | ||
@ModelName@_matching_constraint(@ModelName@<Semi_analytic>*); | ||
virtual ~@ModelName@_matching_constraint() = default; | ||
virtual void apply() override; | ||
virtual double get_scale() const override { return scale; } | ||
virtual std::string name() const override { return "@ModelName@ matching constraint"; } | ||
virtual void set_model(Model*) override; | ||
|
||
void set_matching_condition(@ModelName@_standard_model_matching_up<Semi_analytic>* mc) { matching_condition = mc; } | ||
void set_scale(double s) { scale = s; } | ||
private: | ||
double scale{0.}; | ||
double initial_scale_guess{0.}; | ||
@ModelName@<Semi_analytic>* model{nullptr}; | ||
@ModelName@_standard_model_matching_up<Semi_analytic>* matching_condition{nullptr}; | ||
|
||
void check_model_ptr() const; | ||
void check_matching_condition_ptr() const; | ||
}; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#endif |