HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
SparseGridsSanityChecks.cpp
Go to the documentation of this file.
1
6
#include <
sparse_grids_simulation.h
>
7
18
int
SparseGridsSimulation::SanityChecks
()
19
{
20
int
*dim_global_fg =
m_sim_fg
->
solver
.
dim_global
;
21
int
*iproc_fg =
m_sim_fg
->
mpi
.
iproc
;
22
23
/* check if grid sizes are same along all dimensions */
24
{
25
bool
flag =
true
;
26
for
(
int
d=0; d<
m_ndims
; d++) {
27
flag = flag && (dim_global_fg[d] == dim_global_fg[0]);
28
}
29
if
(!flag) {
30
fprintf(stderr,
"Error in SparseGridsSimulation::SanityChecks()\n"
);
31
fprintf(stderr,
" full grid dimensions are not equal in all dimensions.\n"
);
32
return
1;
33
}
34
}
35
36
/* check if grid size is a power of 2 */
37
{
38
bool
flag =
isPowerOfTwo
(dim_global_fg[0]);
39
if
(!flag) {
40
fprintf(stderr,
"Error in SparseGridsSimulation::SanityChecks()\n"
);
41
fprintf(stderr,
" full grid dimensions are not a power of 2.\n"
);
42
return
1;
43
}
44
}
45
46
return
0;
47
}
HyPar::dim_global
int * dim_global
Definition:
hypar.h:33
MPIVariables::iproc
int * iproc
Definition:
mpivars_struct.h:27
SimulationObject::mpi
MPIVariables mpi
Definition:
simulation_object.h:25
sparse_grids_simulation.h
SparseGridsSimulation::m_sim_fg
SimulationObject * m_sim_fg
Definition:
sparse_grids_simulation.h:230
SparseGridsSimulation::isPowerOfTwo
bool isPowerOfTwo(int x)
Definition:
sparse_grids_simulation.h:317
SparseGridsSimulation::m_ndims
int m_ndims
Definition:
sparse_grids_simulation.h:215
SparseGridsSimulation::SanityChecks
int SanityChecks()
Definition:
SparseGridsSanityChecks.cpp:18
SimulationObject::solver
HyPar solver
Definition:
simulation_object.h:26