flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
flexiblesusy::Shooting_solver< N > Class Template Reference

Solves the IVP using the shooting method. More...

#include <shooting_solver.hpp>

Collaboration diagram for flexiblesusy::Shooting_solver< N >:
Collaboration graph

Classes

struct  Constraint_slider
 
struct  Matching_slider
 
struct  Slider
 

Public Types

using Fun_t = std::function< Vec_t(const Vec_t &)>
 
using Pre_t = std::function< Vec_t()>
 
using Set_t = std::function< void(const Vec_t &)>
 
using Vec_t = Eigen::Matrix< double, N, 1 >
 

Public Member Functions

void add (const Pre_t &p)
 add predictor
 
void add (const Set_t &s)
 add parameter setter
 
void add (Single_scale_constraint *, Model *)
 add constraint
 
void add (Single_scale_matching *, Model *, Model *)
 add matching condition
 
Vec_t get_solution () const
 returns solution
 
void reset ()
 clear all internal data
 
void set_max_iterations (std::size_t n)
 set maximum number of iterations
 
void set_precision (double p)
 set precision goal
 
void solve (const Vec_t &)
 solves the boundary value problem with initial guess
 

Private Attributes

std::size_t max_it {100}
 maximum number of iterations
 
double precision {1e-3}
 running precision
 
Pre_t predictor {nullptr}
 calculates prediction
 
Set_t setter {nullptr}
 sets parameters
 
std::vector< std::shared_ptr< Slider > > sliders {}
 sliders to be run
 
Vec_t solution {Vec_t::Zero()}
 stored solution
 

Detailed Description

template<std::size_t N>
class flexiblesusy::Shooting_solver< N >

Solves the IVP using the shooting method.

Definition at line 38 of file shooting_solver.hpp.

Member Typedef Documentation

◆ Fun_t

template<std::size_t N>
using flexiblesusy::Shooting_solver< N >::Fun_t = std::function<Vec_t(const Vec_t&)>

Definition at line 41 of file shooting_solver.hpp.

◆ Pre_t

template<std::size_t N>
using flexiblesusy::Shooting_solver< N >::Pre_t = std::function<Vec_t()>

Definition at line 42 of file shooting_solver.hpp.

◆ Set_t

template<std::size_t N>
using flexiblesusy::Shooting_solver< N >::Set_t = std::function<void(const Vec_t&)>

Definition at line 43 of file shooting_solver.hpp.

◆ Vec_t

template<std::size_t N>
using flexiblesusy::Shooting_solver< N >::Vec_t = Eigen::Matrix<double, N, 1>

Definition at line 40 of file shooting_solver.hpp.

Member Function Documentation

◆ add() [1/4]

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::add ( const Pre_t p)
inline

add predictor

Definition at line 50 of file shooting_solver.hpp.

References flexiblesusy::Shooting_solver< N >::predictor.

◆ add() [2/4]

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::add ( const Set_t s)
inline

add parameter setter

Definition at line 52 of file shooting_solver.hpp.

References flexiblesusy::Shooting_solver< N >::setter.

◆ add() [3/4]

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::add ( Single_scale_constraint c,
Model m 
)

add constraint

Adding a model constraint

Parameters
cconstraint
mmodel

Definition at line 131 of file shooting_solver.hpp.

◆ add() [4/4]

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::add ( Single_scale_matching mc,
Model m1,
Model m2 
)

add matching condition

Adds a matching condition. This matching condition matches the two models by calling match(). The two models are passed to the set_models() function of the matching condition.

Parameters
mcmatching condition
m1model 1
m2model 2

Definition at line 148 of file shooting_solver.hpp.

References flexiblesusy::mc.

◆ get_solution()

template<std::size_t N>
Vec_t flexiblesusy::Shooting_solver< N >::get_solution ( ) const
inline

returns solution

Definition at line 54 of file shooting_solver.hpp.

References flexiblesusy::Shooting_solver< N >::solution.

◆ reset()

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::reset ( )

clear all internal data

Reset solver

Definition at line 161 of file shooting_solver.hpp.

◆ set_max_iterations()

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::set_max_iterations ( std::size_t  n)
inline

set maximum number of iterations

Definition at line 58 of file shooting_solver.hpp.

References flexiblesusy::Shooting_solver< N >::max_it.

◆ set_precision()

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::set_precision ( double  p)
inline

set precision goal

Definition at line 56 of file shooting_solver.hpp.

References flexiblesusy::Shooting_solver< N >::precision.

◆ solve()

template<std::size_t N>
void flexiblesusy::Shooting_solver< N >::solve ( const Vec_t v0)

solves the boundary value problem with initial guess

Solves the IVP by finding the root of the function defined by the following procdure:

  1. setting the parameters (using the setter)
  2. imposing all boundary and matching conditions
  3. calculating the output (calling the predictor)
Parameters
v0initial parameter guess

Definition at line 182 of file shooting_solver.hpp.

References flexiblesusy::Composite_root_finder< N >::get_solution(), flexiblesusy::Composite_root_finder< N >::set_max_iterations(), flexiblesusy::Composite_root_finder< N >::set_precision(), and flexiblesusy::Composite_root_finder< N >::solve().

Member Data Documentation

◆ max_it

template<std::size_t N>
std::size_t flexiblesusy::Shooting_solver< N >::max_it {100}
private

maximum number of iterations

Definition at line 119 of file shooting_solver.hpp.

Referenced by flexiblesusy::Shooting_solver< N >::set_max_iterations().

◆ precision

template<std::size_t N>
double flexiblesusy::Shooting_solver< N >::precision {1e-3}
private

running precision

Definition at line 118 of file shooting_solver.hpp.

Referenced by flexiblesusy::Shooting_solver< N >::set_precision().

◆ predictor

template<std::size_t N>
Pre_t flexiblesusy::Shooting_solver< N >::predictor {nullptr}
private

calculates prediction

Definition at line 120 of file shooting_solver.hpp.

Referenced by flexiblesusy::Shooting_solver< N >::add().

◆ setter

template<std::size_t N>
Set_t flexiblesusy::Shooting_solver< N >::setter {nullptr}
private

sets parameters

Definition at line 121 of file shooting_solver.hpp.

Referenced by flexiblesusy::Shooting_solver< N >::add().

◆ sliders

template<std::size_t N>
std::vector<std::shared_ptr<Slider> > flexiblesusy::Shooting_solver< N >::sliders {}
private

sliders to be run

Definition at line 116 of file shooting_solver.hpp.

◆ solution

template<std::size_t N>
Vec_t flexiblesusy::Shooting_solver< N >::solution {Vec_t::Zero()}
private

stored solution

Definition at line 117 of file shooting_solver.hpp.

Referenced by flexiblesusy::Shooting_solver< N >::get_solution().


The documentation for this class was generated from the following file: