|
17 | 17 |
|
18 | 18 |
|
19 | 19 | #include <deal.II/base/timer.h> |
20 | | -// #include <deal.II/base/parameter_handler.h> |
21 | 20 |
|
22 | 21 | #include <deal.II/lac/trilinos_precondition.h> |
23 | 22 | #include <deal.II/lac/trilinos_block_sparse_matrix.h> |
24 | 23 | #include <deal.II/lac/linear_operator.h> |
25 | 24 |
|
26 | | - |
27 | | - |
28 | 25 | #include <mpi.h> |
29 | 26 |
|
30 | | - |
31 | | -// #include <deal.II/lac/precondition.h> |
32 | | - |
33 | | - |
34 | 27 | #include "base_interface.h" |
35 | 28 | #include "simulator_access.h" |
36 | 29 | #include "pidomus_signals.h" |
| 30 | +#include "copy_data.h" |
37 | 31 |
|
38 | 32 | #include <deal2lkit/parsed_grid_generator.h> |
39 | 33 | #include <deal2lkit/parsed_finite_element.h> |
@@ -522,6 +516,86 @@ class piDoMUS : public ParameterAcceptor, public SundialsInterface<typename LAC: |
522 | 516 | const typename LAC::VectorType &solution_dot); |
523 | 517 |
|
524 | 518 |
|
| 519 | + // checkpoint restart |
| 520 | + |
| 521 | + // used in output solution |
| 522 | + unsigned int step_number; |
| 523 | + |
| 524 | + unsigned int old_step; |
| 525 | + |
| 526 | + /** resume compuatation |
| 527 | + * from a previously created snapshot |
| 528 | + */ |
| 529 | + bool resume_computation; |
| 530 | + |
| 531 | + /** |
| 532 | + * create snapshot throughout the simulation |
| 533 | + */ |
| 534 | + bool save_snapshot; |
| 535 | + |
| 536 | + /** |
| 537 | + * this prefix is put in front of the |
| 538 | + * common names used for checkpoint- restart |
| 539 | + */ |
| 540 | + std::string snap_prefix; |
| 541 | + |
| 542 | + /** |
| 543 | + * Save the state of this program to a set of files in the output |
| 544 | + * directory. In reality, however, only some variables are stored (in |
| 545 | + * particular the mesh, the solution vectors, etc) whereas others can |
| 546 | + * either be re-generated (matrices, DoFHandler objects, etc) or are |
| 547 | + * read from the input parameter file. |
| 548 | + * |
| 549 | + * This function is implemented in |
| 550 | + * <code>source/checkpoint_restart.cc</code>. |
| 551 | + */ |
| 552 | + void create_snapshot() const; |
| 553 | + |
| 554 | + void save_solutions_and_triangulation(const LADealII::VectorType &y, |
| 555 | + const LADealII::VectorType &y_dot, |
| 556 | + const LADealII::VectorType &locally_relevant_y_expl, |
| 557 | + const LADealII::VectorType &, |
| 558 | + const LADealII::VectorType &) const; |
| 559 | + |
| 560 | + void save_solutions_and_triangulation(const LATrilinos::VectorType &y, |
| 561 | + const LATrilinos::VectorType &y_dot, |
| 562 | + const LATrilinos::VectorType &locally_relevant_y_expl, |
| 563 | + const LATrilinos::VectorType &, |
| 564 | + const LATrilinos::VectorType &) const; |
| 565 | + |
| 566 | + |
| 567 | + /** |
| 568 | + * Restore the state of this program from a set of files in the output |
| 569 | + * directory. |
| 570 | + * |
| 571 | + * This function is implemented in |
| 572 | + * <code>source/checkpoint_restart.cc</code>. |
| 573 | + */ |
| 574 | + void resume_from_snapshot(); |
| 575 | + |
| 576 | + void load_solutions(LADealII::VectorType &y, |
| 577 | + LADealII::VectorType &y_expl, |
| 578 | + LADealII::VectorType &y_dot); |
| 579 | + |
| 580 | + void load_solutions(LATrilinos::VectorType &y, |
| 581 | + LATrilinos::VectorType &y_expl, |
| 582 | + LATrilinos::VectorType &y_dot); |
| 583 | + |
| 584 | +public: |
| 585 | + /** |
| 586 | + * Save a number of variables using BOOST serialization mechanism. |
| 587 | + * |
| 588 | + * This function is implemented in |
| 589 | + * <code>source/checkpoint_restart.cc</code>. |
| 590 | + */ |
| 591 | + template <class Archive> |
| 592 | + void serialize (Archive &ar, const unsigned int /*version*/); |
| 593 | + |
| 594 | +private: |
| 595 | + |
| 596 | + |
| 597 | + |
| 598 | + |
525 | 599 | /** |
526 | 600 | * Struct containing the signals |
527 | 601 | */ |
|
0 commit comments