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
;
26
m_sim
->
mpi
.
nproc
=
m_nproc
;
27
28
if
(!
m_rank
) {
29
printf(
"Allocated simulation object(s).\n"
);
30
}
31
32
m_is_defined
=
true
;
33
return
0;
34
}
SingleSimulation::m_sim
SimulationObject * m_sim
Definition:
single_simulation.h:179
SingleSimulation::m_is_defined
bool m_is_defined
Definition:
single_simulation.h:175
SimulationObject
Structure defining a simulation.
Definition:
simulation_object.h:23
HyPar::nsims
int nsims
Definition:
hypar.h:64
SimulationObject::solver
HyPar solver
Definition:
simulation_object.h:26
MPIVariables::nproc
int nproc
Definition:
mpivars_struct.h:26
single_simulation.h
Single simulation class.
MPIVariables::rank
int rank
Definition:
mpivars_struct.h:25
HyPar::my_idx
int my_idx
Definition:
hypar.h:61
SingleSimulation::m_nproc
int m_nproc
Definition:
single_simulation.h:176
SimulationObject::mpi
MPIVariables mpi
Definition:
simulation_object.h:25
SingleSimulation::define
int define(int, int)
Definition:
SingleSimulationDefine.cpp:10
SingleSimulation::m_rank
int m_rank
Definition:
single_simulation.h:176