Problems#
Simple problem#
-
template<typename Callable_t>
class simple_problem# define a problem with a unique function
This class represent a problem of the form
\[\dot{y}=f(t,y)\]- Template Parameters:
Callable_t – type of callable object (or function) stored in problem
Subclassed by ponio::implicit_problem< Callable_t, Jacobian_t >
Public Functions
-
inline simple_problem(Callable_t &&f_)#
constructor of simple_problem from a callable and hints
- Parameters:
f_ – callable object
-
template<typename state_t, typename value_t, typename state_expr_t>
inline void operator()(value_t t, state_expr_t &&y, state_t &dy)# call operator to evaluate \(f(t,y)\)
- Parameters:
t – time value \(t\)
y – variable of the problem value \(y\)
dy – \(\dot{y}\), returns value of \(f(t, y)\) of the problem
-
template<typename Callable_t>
simple_problem<Callable_t> ponio::make_simple_problem(Callable_t &&c)# factory of simple_problem
- Parameters:
c – callable object (function or functor) which represent the function of the problem
Lawson problem#
-
template<typename Linear_t, typename Nonlinear_t>
class lawson_problem# define a problem with a linear part and non-linear part
This class represent a problem of the form
\[\dot{u}=Lu + N(t,u)\]- Template Parameters:
Linear_t – type of the linear part (a matrix)
Nonlinear_t – type of callable of the non-lineart part (function or functor)
Public Functions
-
lawson_problem(Linear_t &&l_, Nonlinear_t &&n_)#
constructor of lawson_problem
- Parameters:
l_ – linerar part \(L\) of Lawson problem
n_ – nonlinerar part \(N(t,u)\) of Lawson problem
-
template<typename state_t, typename value_t, typename state_expr_t>
void operator()(value_t t, state_expr_t &&y, state_t &dy)# call operator to evaluate \(f(t,y)\)
- Parameters:
t – time value \(t\)
y – variable of the problem value \(y\)
dy – returns where store \(Ly+N(t,y)\)
-
template<typename Linear_t, typename Nonlinear_t>
auto ponio::make_lawson_problem(Linear_t l, Nonlinear_t n)# factory of lawson_problem
- Parameters:
l – linerar part \(L\) of Lawson problem
n – nonlinerar part \(N(t,u)\) of Lawson problem
Implicit problem#
This kind of problems are defined by a function and its Jacobian.
-
template<typename Callable_t, typename Jacobian_t>
class implicit_problem : public ponio::simple_problem<Callable_t># define a problem with its jacobian to use implicit Runge-Kutta method
- Template Parameters:
Callable_t – type of callable object (or function) stored in problem
Jacobian_t – type of callable object (or function) that represents the jacobian
Public Functions
-
inline implicit_problem(Callable_t &&f_, Jacobian_t &&df_)#
constructor of implicit_problem from a callable and hints
- Parameters:
f_ – callable object that represents problem
df_ – callable object that represents Jacobian of problem
-
template<typename Callable_t, typename Jacobian_t>
implicit_problem<Callable_t, Jacobian_t> ponio::make_implicit_problem(Callable_t &&f, Jacobian_t &&df)# factory of implicit_problem
- Parameters:
f – callable object (function or functor) which represent the function of the problem
df – jacobian of \(f\) function
Implicit problem with operator#
This kind of problems are defined by a function and an operator, for example to solve :
the function is \(f\) ;
the operator is \(t \mapsto f(t, \cdot)\) which is a function.
-
template<typename Callable1_t, typename Callable2_t>
class implicit_operator_problem : public ponio::simple_problem<Callable1_t># define a problem with its operator to use implicit Runge-Kutta method with Samurai
- Template Parameters:
Callable1_t – type of callable object (or function) stored in problem
Callable2_t – type of callable object (or function) that represents the \(f:\mapsto f(t,\cdot)\)
Public Functions
-
inline implicit_operator_problem(Callable1_t &&f_, Callable2_t &&f_t_)#
Construct a new implicit operator problem<Callable1 t, Callable2 t>::implicit operator problem object.
- Template Parameters:
Callable1_t –
Callable2_t –
- Parameters:
f_ – callable object that represents problem, \(f:t,u\mapsto f(t,u)\)
f_t_ – callable object that returns operator, \(f_t:t\mapsto f(t,\cdot)\)
-
template<typename Callable1_t, typename Callable2_t>
implicit_operator_problem<Callable1_t, Callable2_t> ponio::make_implicit_operator_problem(Callable1_t &&f, Callable2_t &&f_t)# factory of implicit_operator_problem
- Parameters:
f – callable object (function or functor) which represent the function of the problem
f_t – callable of \(f:t\mapsto f(t,\cdot)\) function
Coupled Implicit-Explicit problem#
This kind of problems are defined by a function and an operator, for example to solve :
where we would like to solve explicitly \(f\) and implicitly \(g\).
-
template<typename Callable_explicit_t, typename Implicit_problem_t>
class imex_problem# define a problem with its explicit and implicit part
- Template Parameters:
Callable_explicit_t – type of callable object (or function) that represents the explicit part of the problem
Implicit_problem_t – type of implicit problem (by operator or jacobian) that represents the implict part of the problem
Public Functions
-
inline imex_problem(Callable_explicit_t &&f_explicit, Implicit_problem_t &&pb_implicit)#
Construct a new imex_problem<Callable explicit t, Implicit problem t>::imex_problem object.
- Template Parameters:
Callable_explicit_t –
Implicit_problem_t –
- Parameters:
f_explicit – explicit part of problem
pb_implicit – implicit part of problem (a implicit_operator_problem or a implicit_problem)
Like for implicit problems we can define the implicit part with its Jacobian matrix or with a samurai operator.
-
template<typename Callable_explicit_t, typename Callable_implicit_t, typename Callable_implicit_jac_t>
auto ponio::make_imex_jacobian_problem(Callable_explicit_t &&f, Callable_implicit_t &&g, Callable_implicit_jac_t &&dg)#
-
template<typename Callable_explicit_t, typename Callable_implicit_t, typename Callable_implicit_op_t>
auto ponio::make_imex_operator_problem(Callable_explicit_t &&f, Callable_implicit_t &&g, Callable_implicit_op_t &&g_t)# factory of imex_problem from an explicit part and a implicit part which is a implicit_operator_problem
- Template Parameters:
Callable_explicit_t –
Callable_implicit_t –
Callable_implicit_op_t –
- Parameters:
f – explicit part
g – implicit part
g_t – operator on the implicit part
Problem#
A problem is a collection of sub-problems defined by previous problems.
-
template<typename ...Callables_t>
class problem# main problem that could contains multiple sub-problem
Main goal of this class is to represent a problem of the form
\[\dot{u} = \sum_i f_i(t,u)\]Public Functions
-
inline problem(Callables_t... args)#
constructor of problem from variadic number of sub-problem
- Parameters:
args – list of sub-problems
-
template<typename value_t, typename state_t, typename state_expr_t, std::size_t... Is>
inline state_t _sum_components_impl(value_t t, state_expr_t &&y, state_t &dy, std::index_sequence<Is...>)# sum all call of each sub-problem
- Template Parameters:
Is – index sequence to iterate over tuple of sub-problems
- Parameters:
t – time \(t\)
y – solution \(y\) at time \(t\)
dy – returns \(\sum_i f_i(t,y)\)
-
template<typename state_t, typename value_t, typename state_expr_t>
inline void operator()(value_t t, state_expr_t &&y, state_t &dy)# call operator
- Parameters:
t – time \(t\)
y – solution \(y\) at time \(t\)
dy – returns \(\sum_i f_i(t,y)\)
-
template<std::size_t I, typename state_t, typename value_t, typename state_expr_t>
inline void operator()(std::integral_constant<std::size_t, I>, value_t t, state_expr_t &&y, state_t &dy)# call operator for the I operator in Callables_t
- Template Parameters:
I – Index index of tuple of sub-problems to call
- Parameters:
t – time \(t\)
y – solution \(y\) at time \(t\)
dy – returns \(f_i(t,y)\)
-
template<std::size_t I, typename state_t, typename value_t, typename state_expr_t>
inline state_t call(value_t t, state_expr_t &&y, state_t &dy)# call the
Isub-problem- Template Parameters:
I – index of tuple of sub-problems to call
- Parameters:
t – time \(t\)
y – solution \(y(t)\)
dy – returns \(f(t, y)\)
- Returns:
returns \(f(t, y)\)
-
inline problem(Callables_t... args)#