HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
SingleSimulationDefine.cpp
Go to the documentation of this file.
1 
6 #include <string>
7 #include <single_simulation.h>
8 
10 int SingleSimulation::define( int a_rank,
11  int a_nproc
12  )
13 {
14  if (m_is_defined) {
15  fprintf(stderr,"Error: object already defined on rank %d.\n", a_rank);
16  return 1;
17  }
18 
19  m_rank = a_rank;
20  m_nproc = a_nproc;
21 
22  m_sim = new SimulationObject;
23  m_sim->solver.my_idx = 0;
24  m_sim->solver.nsims = 1;
25  m_sim->mpi.rank = m_rank;
27 
28  if (!m_rank) {
29  printf("Allocated simulation object(s).\n");
30  }
31 
32  m_is_defined = true;
33  return 0;
34 }
SimulationObject * m_sim
Structure defining a simulation.
int nsims
Definition: hypar.h:64
Single simulation class.
int my_idx
Definition: hypar.h:61