Solver#
-
template<typename Problem_t, typename Algorithm_t, typename state_t, typename value_t, typename Observer_t>
state_t ponio::solve(Problem_t &pb, Algorithm_t &&algo, state_t const &u0, ponio::time_span<value_t> const &t_span, value_t dt, Observer_t &&obs)# solve a problem on a specific time range with a specific method
- Parameters:
pb – problem to solve, it could by any function or functor with a call operator with following parameter
(value_t tn, state_t const& un)
.algo – choosen method to solve the problem
pb
u0 – initial condition \(u_0 = u(t=0)\)
t_span – container \([t_\text{start} , t_\text{end}]\) with possible intermediate time value where solver should go
dt – time step value \(\Delta t\)
obs – observer that do something with current time, solution and time step at each iteration
- Returns:
returns the last value of solution \(u^n\)