forked from Expander/FlexibleSUSY
-
Notifications
You must be signed in to change notification settings - Fork 14
/
betafunction.hpp
90 lines (75 loc) · 3.19 KB
/
betafunction.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// ====================================================================
// 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 betafunction.hpp
* @brief contains class Beta_function
*/
#ifndef BETAFUNCTION_H
#define BETAFUNCTION_H
#include "rk.hpp"
namespace flexiblesusy {
/**
* @class Beta_function
* @brief beta function interface
*
* Beta_function is the abstract base class for the beta functions of
* the parameter classes of the generated models. It defines the
* basic RG running interface. The run() and run_to() functions use
* the Runge-Kutta algorithm to integrate the RGEs up to a given
* scale.
*/
class Beta_function {
public:
Beta_function() = default;
Beta_function(const Beta_function&) = default;
Beta_function(Beta_function&&) = default;
virtual ~Beta_function() {}
Beta_function& operator=(const Beta_function&) = default;
Beta_function& operator=(Beta_function&&) = default;
void set_scale(double s) { scale = s; }
void set_number_of_parameters(unsigned pars) { num_pars = pars; }
void set_loops(unsigned l) { loops = l; }
void set_thresholds(unsigned t) { thresholds = t; }
void set_zero_threshold(double t) { zero_threshold = t; }
double get_scale() const { return scale; }
unsigned get_number_of_parameters() const { return num_pars; }
unsigned get_loops() const { return loops; }
unsigned get_thresholds() const { return thresholds; }
double get_zero_threshold() const { return zero_threshold; }
void reset();
virtual Eigen::ArrayXd get() const = 0;
virtual void set(const Eigen::ArrayXd&) = 0;
virtual Eigen::ArrayXd beta() const = 0;
virtual void run(double, double, double eps = -1.0);
virtual void run_to(double, double eps = -1.0);
protected:
typedef std::function<Eigen::ArrayXd(double, const Eigen::ArrayXd&)> Derivs;
void call_rk(double, double, Eigen::ArrayXd&, Derivs, double eps = -1.0);
private:
unsigned num_pars{0}; ///< number of parameters
unsigned loops{0}; ///< to what loop order does the RG evolution run
unsigned thresholds{0}; ///< threshold correction loop order
double scale{0.}; ///< current renormalization scale
double tolerance{1.e-4}; ///< running tolerance
double min_tolerance{1.e-11}; ///< minimum tolerance allowed
double zero_threshold{1.e-11};///< threshold for treating values as zero
Eigen::ArrayXd derivatives(double, const Eigen::ArrayXd&);
double get_tolerance(double eps);
};
} // namespace flexiblesusy
#endif