HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
IBIdentifyMode.c
Go to the documentation of this file.
1 
6 #include <string.h>
7 #include <immersedboundaries.h>
8 
25  double *X,
26  int *dim,
27  void *ib
28  )
29 {
31  Body3D *body = IB->body;
32 
33  double *x = X, *y = x + dim[0], *z = y + dim[1];
34 
35  double grid_xmin = x[0],
36  grid_xmax = x[dim[0]-1],
37  grid_ymin = y[0],
38  grid_ymax = y[dim[1]-1],
39  grid_zmin = z[0],
40  grid_zmax = z[dim[2]-1];
41 
42  if ( (grid_xmin > body->xmin) && (grid_xmax < body->xmax) ) strcpy(IB->mode,_IB_YZ_);
43  else if ( (grid_ymin > body->ymin) && (grid_ymax < body->ymax) ) strcpy(IB->mode,_IB_XZ_);
44  else if ( (grid_zmin > body->zmin) && (grid_zmax < body->zmax) ) strcpy(IB->mode,_IB_XY_);
45  else strcpy(IB->mode,_IB_3D_);
46 
47  return(0);
48 }
49 
Structure defining a body.
Structure containing variables for immersed boundary implementation.
#define _IB_3D_
#define _IB_YZ_
Structures and function definitions for immersed boundaries.
#define _IB_XZ_
int IBIdentifyMode(double *X, int *dim, void *ib)
char mode[_MAX_STRING_SIZE_]
#define _IB_XY_