numerics 0.1.0
Loading...
Searching...
No Matches
problems.hpp
Go to the documentation of this file.
1/// @file solve/problems.hpp
2/// @brief Problem types: carry the mathematics, not the numerics.
3#pragma once
4
5#include "core/vector.hpp"
6#include "ode/ode.hpp"
7#include <concepts>
8
9namespace num {
10
11struct ODEProblem {
14 double t0 = 0.0;
15 double tf = 1.0;
16};
17
18/// @brief Any type carrying an ODE right-hand side f(t,y,dy) and t0/tf/u0 data.
19template<typename P>
20concept IsODEProblem = requires(const P& p, double t, const Vector& y, Vector& dy) {
21 p.f(t, y, dy);
22 { p.u0 } -> std::convertible_to<const Vector&>;
23 { p.t0 } -> std::convertible_to<double>;
24 { p.tf } -> std::convertible_to<double>;
25};
26
27/// @brief Linear system A x = b. A is any matrix or LinearOperator; b the RHS.
28/// Non-owning view over A and b (bind at the call site for an immediate solve).
29template<class Op>
31 const Op& A;
32 const Vector& b;
33};
34
35template<class Op>
37
38} // namespace num
Any type carrying an ODE right-hand side f(t,y,dy) and t0/tf/u0 data.
Definition problems.hpp:20
std::function< void(real t, const Vector &y, Vector &dydt)> ODERhsFn
Definition ode.hpp:14
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
Definition vector.hpp:129
ODE and symplectic integrators.
Linear system A x = b. A is any matrix or LinearOperator; b the RHS. Non-owning view over A and b (bi...
Definition problems.hpp:30
const Vector & b
Definition problems.hpp:32
Dense vector storage and operations.