1 #ifndef DEF_RKMK_STEPINTERNALS 2 #define DEF_RKMK_STEPINTERNALS 8 template <
typename T_LIE_ALGEBRA,
9 int T_N_INTERNAL_STAGES,
17 T_LIE_ALGEBRA m_solution;
21 double m_a_coeffs [T_N_INTERNAL_STAGES * T_N_INTERNAL_STAGES];
22 double m_b_coeffs [T_N_INTERNAL_STAGES];
23 T_LIE_ALGEBRA m_k [T_N_INTERNAL_STAGES];
24 unsigned int m_order_q;
29 { setTruncatureOrder(); }
45 m_solution = other.m_solution;
46 m_problem = other.m_problem;
47 std::copy(std::begin(other.m_a_coeffs),std::end(other.m_a_coeffs),std::begin(m_a_coeffs));
48 std::copy(std::begin(other.m_b_coeffs),std::end(other.m_b_coeffs),std::begin(m_b_coeffs));
49 std::copy(std::begin(other.m_k),std::end(other.m_k),std::begin(m_k));
50 m_order_q = other.m_order_q;
54 a_coeffs (
int i,
int j)
const 55 {
return m_a_coeffs[i*T_N_INTERNAL_STAGES+j]; }
65 setCoeffs (std::vector<double> a, std::vector<double> b)
67 if ((a.size()!=T_N_INTERNAL_STAGES*T_N_INTERNAL_STAGES) || (b.size()!=T_N_INTERNAL_STAGES))
69 for (
int i=0; i<T_N_INTERNAL_STAGES; i++)
71 for (
int i=0; i<T_N_INTERNAL_STAGES*T_N_INTERNAL_STAGES; i++)
77 setTruncatureOrder ( )
78 { m_order_q = std::max(0,T_N_INTERNAL_STAGES-2); }
89 T_LIE_ALGEBRA omega0 = T_LIE_ALGEBRA::Zero();
90 T_LIE_ALGEBRA omega = omega0;
91 T_LIE_ALGEBRA sol = omega0;
95 for (i=0; i<T_N_INTERNAL_STAGES; i++) {
99 for (j=0; j<T_N_INTERNAL_STAGES; j++) {
100 omega += this->m_k[j]*this->m_h*this->a_coeffs(i,j);
103 this->m_problem.computeA(A,omega.exp()*this->m_y0);
105 this->m_k[i] = omega.computeDExpRInv(A,this->m_order_q);
106 sol += this->m_b_coeffs[i]*this->m_h*this->m_k[i];
109 this->m_solution = sol;
118 T_LIE_ALGEBRA w(solution);
124 {
return this->reconstruct(this->m_solution.toVector()); }
128 {
return m_problem.computeA(A,y); }
132 {
return m_problem.computeJacobianA(JA,y); }
bool computeSolution(void)
Definition: StepInternals.hpp:85
Definition: Abstract_Problem.hpp:10
Definition: Abstract_Integrator.hpp:4
Definition: StepInternals.hpp:11