HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
SparseGridsSanityChecks.cpp
Go to the documentation of this file.
1 
7 
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 }
int * dim_global
Definition: hypar.h:33