Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 95 additions & 1 deletion include/pidomus.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@
#include "lac/lac_type.h"
#include "lac/lac_initializer.h"


#include <deal2lkit/utilities.h>

#include <deal.II/base/mpi.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/distributed/solution_transfer.h>

#ifdef DEAL_II_WITH_ZLIB
# include <zlib.h>
#endif

#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>


using namespace dealii;
using namespace deal2lkit;
using namespace pidomus;
Expand Down Expand Up @@ -290,6 +305,10 @@ class piDoMUS : public ParameterAcceptor, public SundialsInterface<typename LAC:
*/
double current_dt;

/**
* step_number (it is used in output solution)
*/
unsigned int step_number;


//// previous time step
Expand Down Expand Up @@ -358,11 +377,11 @@ class piDoMUS : public ParameterAcceptor, public SundialsInterface<typename LAC:
*/
double second_to_last_dt;


/**
* Show timer statistics
*/
bool output_timer;

/**
* Teucos timer file
*/
Expand Down Expand Up @@ -453,6 +472,16 @@ class piDoMUS : public ParameterAcceptor, public SundialsInterface<typename LAC:
*/
bool enable_finer_preconditioner;

/**
* resume computation from a previously created snapshot
*/
bool resume_computation;

/**
* folder used for read and store snapshots
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for -> to

folder -> Folder

*/
std::string snapshot_folder;


/**
* Syncronize to time t. This function update functions and
Expand All @@ -464,6 +493,69 @@ class piDoMUS : public ParameterAcceptor, public SundialsInterface<typename LAC:
const typename LAC::VectorType &solution,
const typename LAC::VectorType &solution_dot);

/**
* Save the state of this program to a set of files in the output
* directory. In reality, however, only some variables are stored (in
* particular the mesh, the solution vectors, etc) whereas others can
* either be re-generated (matrices, DoFHandler objects, etc) or are
* read from the input parameter file.
*
* This function is implemented in
* <code>source/checkpoint_restart.cc</code>.
*/
void create_snapshot() const;

void save_solutions_and_triangulation(const LADealII::VectorType &y,
const LADealII::VectorType &y_dot,
const LADealII::VectorType &y_expl,
const LADealII::VectorType &,
const LADealII::VectorType &,
const LADealII::VectorType &) const;

void save_solutions_and_triangulation(const LATrilinos::VectorType &,
const LATrilinos::VectorType &,
const LATrilinos::VectorType &,
const LATrilinos::VectorType &locally_relevant_y,
const LATrilinos::VectorType &locally_relevant_y_dot,
const LATrilinos::VectorType &locally_relevant_y_expl) const;


/**
* Restore the state of this program from a set of files in the output
* directory.
*
* This function is implemented in
* <code>source/checkpoint_restart.cc</code>.
*/
void resume_from_snapshot();

void load_solutions(LADealII::VectorType &y,
LADealII::VectorType &y_expl,
LADealII::VectorType &y_dot);

void load_solutions(LATrilinos::VectorType &y,
LATrilinos::VectorType &y_expl,
LATrilinos::VectorType &y_dot);

public:
/**
* Save a number of variables using BOOST serialization mechanism.
*
* This function is implemented in
* <code>source/checkpoint_restart.cc</code>.
*/
template <class Archive>
void serialize (Archive &ar, const unsigned int /*version*/)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the implementation in the cc file.

ar &current_time;
ar &current_alpha;
ar &current_dt;
ar &step_number;
ar &current_cycle;
std::cout << "bannnnnnnnnnnnnnnnnnnaaa"<<std::endl;
}

private:

/**
* Struct containing the signals
Expand All @@ -476,6 +568,8 @@ class piDoMUS : public ParameterAcceptor, public SundialsInterface<typename LAC:
*/
friend class SimulatorAccess<dim,spacedim,LAC>;



};

#endif
Loading