Page MenuHomec4science

simulation.hh
No OneTemporary

File Metadata

Created
Sun, May 19, 16:10

simulation.hh

#ifndef SIMULATION_HH
#define SIMULATION_HH
/* -------------------------------------------------------------------------- */
#include "double_buffer.hh"
#include "dumpers.hh"
#include "grid.hh"
/* -------------------------------------------------------------------------- */
#include <tuple>
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class Simulation {
public:
Simulation(int m, int n, int n_iter, int prank, int psize);
/// set the initial conditions, Dirichlet and source term
virtual void set_initial_conditions();
/// perform the simulation
std::tuple<float, int> compute();
protected:
/// compute one step and return an error
virtual float compute_step();
private:
/// Global problem size
int m_global_m, m_global_n;
/// Number of iterations
int m_n_iter;
/// grid spacing
float m_h_m;
float m_h_n;
/// Grids storage
DoubleBuffer m_grids;
/// source term
Grid m_f;
/// Dumper to use for outputs
std::unique_ptr<Dumper> m_dumper;
/// MPI parameters
int m_prank, m_psize;
};
#endif /* SIMULATION_HH */

Event Timeline