Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102547006
simulation.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 21, 21:10
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Feb 23, 21:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24356899
Attached To
R11201 phpc-2021
simulation.hh
View Options
#ifndef SIMULATION_HH
#define SIMULATION_HH
/* -------------------------------------------------------------------------- */
#include "double_buffer.hh"
#include "dumpers.hh"
#include "grid.hh"
/* -------------------------------------------------------------------------- */
#include <tuple>
#include <cuda_runtime.h>
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class Simulation {
public:
Simulation(int m, int n);
/// set the initial conditions, Dirichlet and source term
virtual void set_initial_conditions();
/// perform the simulation
int compute(dim3 block_size = {32, 1});
protected:
/// compute one step and return an error
void compute_step(dim3 block_size);
private:
/// Global problem size
int m_global_m, m_global_n;
/// 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;
};
#endif /* SIMULATION_HH */
Event Timeline
Log In to Comment