53class ExplicitRungeKuttaTimeIntegrator :
public ExplicitTimeIntegrator<Operator, VectorType>
57 ExplicitRungeKuttaTimeIntegrator(
unsigned int order_time_integrator,
58 std::shared_ptr<Operator>
const operator_in)
59 : ExplicitTimeIntegrator<Operator, VectorType>(operator_in), order(order_time_integrator)
63 this->underlying_operator->initialize_dof_vector(vec_rhs);
65 this->underlying_operator->initialize_dof_vector(vec_temp);
72 double const time_step)
final
85 this->underlying_operator->evaluate(dst, src, time);
86 dst.sadd(time_step, 1., src);
101 this->underlying_operator->evaluate(vec_rhs, src, time);
104 vec_rhs.sadd(time_step / 2., 1., src);
105 this->underlying_operator->evaluate(dst, vec_rhs, time + time_step / 2.);
106 dst.sadd(time_step, 1., src);
124 this->underlying_operator->evaluate(vec_temp, src, time);
125 dst.add(1. * time_step / 4., vec_temp);
128 vec_rhs.equ(1., src);
129 vec_rhs.add(time_step / 3., vec_temp);
130 this->underlying_operator->evaluate(vec_temp, vec_rhs, time + time_step / 3.);
133 vec_rhs.equ(1., src);
134 vec_rhs.add(2. * time_step / 3., vec_temp);
135 this->underlying_operator->evaluate(vec_temp, vec_rhs, time + 2. * time_step / 3.);
136 dst.add(3. * time_step / 4., vec_temp);
155 this->underlying_operator->evaluate(vec_temp, src, time);
156 dst.add(time_step / 6., vec_temp);
159 vec_rhs.equ(1., src);
160 vec_rhs.add(time_step / 2., vec_temp);
161 this->underlying_operator->evaluate(vec_temp, vec_rhs, time + time_step / 2.);
162 dst.add(time_step / 3., vec_temp);
165 vec_rhs.equ(1., src);
166 vec_rhs.add(time_step / 2., vec_temp);
167 this->underlying_operator->evaluate(vec_temp, vec_rhs, time + time_step / 2.);
168 dst.add(time_step / 3., vec_temp);
171 vec_rhs.equ(1., src);
172 vec_rhs.add(time_step, vec_temp);
173 this->underlying_operator->evaluate(vec_temp, vec_rhs, time + time_step);
174 dst.add(time_step / 6., vec_temp);
178 AssertThrow(order <= 4,
180 "Explicit Runge-Kutta method only implemented for order <= 4!"));
185 get_order()
const final
234class LowStorageRK3Stage4Reg2C :
public ExplicitTimeIntegrator<Operator, VectorType>
237 LowStorageRK3Stage4Reg2C(std::shared_ptr<Operator>
const operator_in)
238 : ExplicitTimeIntegrator<Operator, VectorType>(operator_in)
246 double const time_step)
final
248 if(not vec_tmp1.partitioners_are_globally_compatible(*vec_n.get_partitioner()))
250 vec_tmp1.reinit(vec_np);
265 double const a21 = 11847461282814. / 36547543011857.;
266 double const a32 = 3943225443063. / 7078155732230.;
267 double const a43 = -346793006927. / 4029903576067.;
269 double const b1 = 1017324711453. / 9774461848756.;
270 double const b2 = 8237718856693. / 13685301971492.;
271 double const b3 = 57731312506979. / 19404895981398.;
272 double const b4 = -101169746363290. / 37734290219643.;
274 double const c1 = 0.;
275 double const c2 = a21;
276 double const c3 = b1 + a32;
277 double const c4 = b1 + b2 + a43;
280 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c1 * time_step);
281 vec_n.add(a21 * time_step, vec_tmp1);
283 vec_np.add((b1 - a21) * time_step, vec_tmp1);
286 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c2 * time_step);
287 vec_np.add(a32 * time_step, vec_tmp1);
289 vec_n.add((b2 - a32) * time_step, vec_tmp1);
292 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c3 * time_step);
293 vec_n.add(a43 * time_step, vec_tmp1);
295 vec_np.add((b3 - a43) * time_step, vec_tmp1);
298 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c4 * time_step);
299 vec_np.add(b4 * time_step, vec_tmp1);
303 get_order()
const final
319class LowStorageRK4Stage5Reg2C :
public ExplicitTimeIntegrator<Operator, VectorType>
322 LowStorageRK4Stage5Reg2C(std::shared_ptr<Operator>
const operator_in)
323 : ExplicitTimeIntegrator<Operator, VectorType>(operator_in)
331 double const time_step)
final
333 if(not vec_tmp1.partitioners_are_globally_compatible(*vec_n.get_partitioner()))
335 vec_tmp1.reinit(vec_np);
351 double const a21 = 970286171893. / 4311952581923.;
352 double const a32 = 6584761158862. / 12103376702013.;
353 double const a43 = 2251764453980. / 15575788980749.;
354 double const a54 = 26877169314380. / 34165994151039.;
356 double const b1 = 1153189308089. / 22510343858157.;
357 double const b2 = 1772645290293. / 4653164025191.;
358 double const b3 = -1672844663538. / 4480602732383.;
359 double const b4 = 2114624349019. / 3568978502595.;
360 double const b5 = 5198255086312. / 14908931495163.;
362 double const c1 = 0.;
363 double const c2 = a21;
364 double const c3 = b1 + a32;
365 double const c4 = b1 + b2 + a43;
366 double const c5 = b1 + b2 + b3 + a54;
369 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c1 * time_step);
370 vec_n.add(a21 * time_step, vec_tmp1);
372 vec_np.add((b1 - a21) * time_step, vec_tmp1);
375 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c2 * time_step);
376 vec_np.add(a32 * time_step, vec_tmp1);
378 vec_n.add((b2 - a32) * time_step, vec_tmp1);
381 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c3 * time_step);
382 vec_n.add(a43 * time_step, vec_tmp1);
384 vec_np.add((b3 - a43) * time_step, vec_tmp1);
387 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c4 * time_step);
388 vec_np.add(a54 * time_step, vec_tmp1);
390 vec_n.add((b4 - a54) * time_step, vec_tmp1);
393 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c5 * time_step);
395 vec_np.add(b5 * time_step, vec_tmp1);
399 get_order()
const final
414class LowStorageRK4Stage5Reg3C :
public ExplicitTimeIntegrator<Operator, VectorType>
417 LowStorageRK4Stage5Reg3C(std::shared_ptr<Operator>
const operator_in)
418 : ExplicitTimeIntegrator<Operator, VectorType>(operator_in)
426 double const time_step)
final
428 if(not vec_tmp1.partitioners_are_globally_compatible(*vec_n.get_partitioner()))
430 vec_tmp1.reinit(vec_np,
true);
431 vec_tmp2.reinit(vec_np,
true);
446 double const a21 = 2365592473904. / 8146167614645.;
447 double const a32 = 4278267785271. / 6823155464066.;
448 double const a43 = 2789585899612. / 8986505720531.;
449 double const a54 = 15310836689591. / 24358012670437.;
451 double const a31 = -722262345248. / 10870640012513.;
452 double const a42 = 1365858020701. / 8494387045469.;
453 double const a53 = 3819021186. / 2763618202291.;
455 double const b1 = 846876320697. / 6523801458457.;
456 double const b2 = 3032295699695. / 12397907741132.;
457 double const b3 = 612618101729. / 6534652265123.;
458 double const b4 = 1155491934595. / 2954287928812.;
459 double const b5 = 707644755468. / 5028292464395.;
461 double const c1 = 0.;
462 double const c2 = a21;
463 double const c3 = a31 + a32;
464 double const c4 = b1 + a42 + a43;
465 double const c5 = b1 + b2 + a53 + a54;
468 this->underlying_operator->evaluate(vec_np , vec_n , time + c1 * time_step);
469 vec_n.add(a21 * time_step, vec_np );
471 vec_tmp1.add((b1 - a21) * time_step, vec_np );
474 this->underlying_operator->evaluate(vec_tmp2 , vec_n , time + c2 * time_step);
475 vec_tmp1.add(a32 * time_step,
477 (a31 - b1) * time_step,
479 vec_np.sadd((b1 - a31) * time_step, 1, vec_tmp1 );
480 vec_np.add((b2 - a32) * time_step, vec_tmp2 );
483 this->underlying_operator->evaluate(vec_n , vec_tmp1 , time + c3 * time_step);
484 vec_np.add(a43 * time_step,
486 (a42 - b2) * time_step,
488 vec_tmp2.sadd((b2 - a42) * time_step, 1, vec_np );
489 vec_tmp2.add((b3 - a43) * time_step, vec_n );
492 this->underlying_operator->evaluate(vec_tmp1 ,
494 time + c4 * time_step);
495 vec_tmp2.add(a54 * time_step,
497 (a53 - b3) * time_step,
499 vec_n.sadd((b3 - a53) * time_step, 1, vec_tmp2 );
500 vec_n.add((b4 - a54) * time_step, vec_tmp1 );
503 this->underlying_operator->evaluate(vec_tmp1 ,
505 time + c5 * time_step);
507 vec_np.add(b5 * time_step, vec_tmp1 );
511 get_order()
const final
526class LowStorageRK5Stage9Reg2S :
public ExplicitTimeIntegrator<Operator, VectorType>
529 LowStorageRK5Stage9Reg2S(std::shared_ptr<Operator>
const operator_in)
530 : ExplicitTimeIntegrator<Operator, VectorType>(operator_in)
538 double const time_step)
final
540 if(not vec_tmp1.partitioners_are_globally_compatible(*vec_n.get_partitioner()))
542 vec_tmp1.reinit(vec_np);
562 double const a21 = 1107026461565. / 5417078080134.;
563 double const a32 = 38141181049399. / 41724347789894.;
564 double const a43 = 493273079041. / 11940823631197.;
565 double const a54 = 1851571280403. / 6147804934346.;
566 double const a65 = 11782306865191. / 62590030070788.;
567 double const a76 = 9452544825720. / 13648368537481.;
568 double const a87 = 4435885630781. / 26285702406235.;
569 double const a98 = 2357909744247. / 11371140753790.;
571 double const b1 = 2274579626619. / 23610510767302.;
572 double const b2 = 693987741272. / 12394497460941.;
573 double const b3 = -347131529483. / 15096185902911.;
574 double const b4 = 1144057200723. / 32081666971178.;
575 double const b5 = 1562491064753. / 11797114684756.;
576 double const b6 = 13113619727965. / 44346030145118.;
577 double const b7 = 393957816125. / 7825732611452.;
578 double const b8 = 720647959663. / 6565743875477.;
579 double const b9 = 3559252274877. / 14424734981077.;
581 double const c1 = 0.;
582 double const c2 = a21;
583 double const c3 = b1 + a32;
584 double const c4 = b1 + b2 + a43;
585 double const c5 = b1 + b2 + b3 + a54;
586 double const c6 = b1 + b2 + b3 + b4 + a65;
587 double const c7 = b1 + b2 + b3 + b4 + b5 + a76;
588 double const c8 = b1 + b2 + b3 + b4 + b5 + b6 + a87;
589 double const c9 = b1 + b2 + b3 + b4 + b5 + b6 + b7 + a98;
592 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c1 * time_step);
593 vec_n.add(a21 * time_step, vec_tmp1);
595 vec_np.add((b1 - a21) * time_step, vec_tmp1);
598 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c2 * time_step);
599 vec_np.add(a32 * time_step, vec_tmp1);
601 vec_n.add((b2 - a32) * time_step, vec_tmp1);
604 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c3 * time_step);
605 vec_n.add(a43 * time_step, vec_tmp1);
607 vec_np.add((b3 - a43) * time_step, vec_tmp1);
610 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c4 * time_step);
611 vec_np.add(a54 * time_step, vec_tmp1);
613 vec_n.add((b4 - a54) * time_step, vec_tmp1);
616 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c5 * time_step);
617 vec_n.add(a65 * time_step, vec_tmp1);
619 vec_np.add((b5 - a65) * time_step, vec_tmp1);
622 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c6 * time_step);
623 vec_np.add(a76 * time_step, vec_tmp1);
625 vec_n.add((b6 - a76) * time_step, vec_tmp1);
628 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c7 * time_step);
629 vec_n.add(a87 * time_step, vec_tmp1);
631 vec_np.add((b7 - a87) * time_step, vec_tmp1);
634 this->underlying_operator->evaluate(vec_tmp1, vec_n , time + c8 * time_step);
635 vec_np.add(a98 * time_step, vec_tmp1);
637 vec_n.add((b8 - a98) * time_step, vec_tmp1);
640 this->underlying_operator->evaluate(vec_tmp1, vec_np , time + c9 * time_step);
642 vec_np.add(b9 * time_step, vec_tmp1);
646 get_order()
const final
668class LowStorageRKTD :
public ExplicitTimeIntegrator<Operator, VectorType>
671 LowStorageRKTD(std::shared_ptr<Operator>
const operator_in,
672 unsigned int const order_in,
673 unsigned int const stages_in)
674 : ExplicitTimeIntegrator<Operator, VectorType>(operator_in), order(order_in), stages(stages_in)
682 double const time_step)
final
684 if(not vec_tmp.partitioners_are_globally_compatible(*vec_n.get_partitioner()))
686 vec_tmp.reinit(vec_np);
689 std::vector<double> A;
691 std::vector<double> B;
693 std::vector<double> c;
696 if(order == 3 and stages == 7)
699 A[1] = -0.8083163874983830;
700 A[2] = -1.503407858773331;
701 A[3] = -1.053064525050744;
702 A[4] = -1.463149119280508;
703 A[5] = -0.6592881281087830;
704 A[6] = -1.667891931891068;
706 B[0] = 0.01197052673097840;
707 B[1] = 0.8886897793820711;
708 B[2] = 0.4578382089261419;
709 B[3] = 0.5790045253338471;
710 B[4] = 0.3160214638138484;
711 B[5] = 0.2483525368264122;
712 B[6] = 0.06771230959408840;
715 c[1] = 0.01197052673097840;
716 c[2] = 0.1823177940361990;
717 c[3] = 0.5082168062551849;
718 c[4] = 0.6532031220148590;
719 c[5] = 0.8534401385678250;
720 c[6] = 0.9980466084623790;
722 else if(order == 4 and stages == 8)
725 A[1] = -0.7212962482279240;
726 A[2] = -0.01077336571612980;
727 A[3] = -0.5162584698930970;
728 A[4] = -1.730100286632201;
729 A[5] = -5.200129304403076;
730 A[6] = 0.7837058945416420;
731 A[7] = -0.5445836094332190;
733 B[0] = 0.2165936736758085;
734 B[1] = 0.1773950826411583;
735 B[2] = 0.01802538611623290;
736 B[3] = 0.08473476372541490;
737 B[4] = 0.8129106974622483;
738 B[5] = 1.903416030422760;
739 B[6] = 0.1314841743399048;
740 B[7] = 0.2082583170674149;
743 c[1] = 0.2165936736758085;
744 c[2] = 0.2660343487538170;
745 c[3] = 0.2840056122522720;
746 c[4] = 0.3251266843788570;
747 c[5] = 0.4555149599187530;
748 c[6] = 0.7713219317101170;
749 c[7] = 0.9199028964538660;
753 AssertThrow(
false, dealii::ExcMessage(
"Not implemented."));
757 for(
unsigned int s = 0; s < stages; s++)
759 this->underlying_operator->evaluate(vec_np, vec_n, time + c[s] * time_step);
760 vec_tmp.sadd(A[s], time_step, vec_np);
761 vec_n.add(B[s], vec_tmp);
768 get_order()
const final