HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ApplyBoundaryConditions.c
Go to the documentation of this file.
1 
9 #include <stdio.h>
10 #include <basic.h>
11 #include <arrayfunctions.h>
12 #include <mpivars.h>
13 #include <boundaryconditions.h>
14 #include <hypar.h>
15 
29  void *m,
30  double *x,
31  double *xref,
32  double waqt
33  )
34 {
35  HyPar *solver = (HyPar*) s;
36  DomainBoundary *boundary = (DomainBoundary*) solver->boundary;
37  MPIVariables *mpi = (MPIVariables*) m;
38  int nb = solver->nBoundaryZones;
39 
40  int* dim_local;
41 #if defined(HAVE_CUDA)
42  if (solver->use_gpu) {
43  dim_local = solver->gpu_dim_local;
44  } else {
45 #endif
46  dim_local = solver->dim_local;
47 #if defined(HAVE_CUDA)
48  }
49 #endif
50 
51  /* Apply domain boundary conditions to x */
52  int n;
53  for (n = 0; n < nb; n++) {
54  boundary[n].BCFunctionU(&boundary[n],mpi,solver->ndims,solver->nvars,
55  dim_local,solver->ghosts,x,waqt);
56  }
57 
58  return(0);
59 }
Containts the structures and definitions for boundary condition implementation.
int(* BCFunctionU)(void *, void *, int, int, int *, int, double *, double)
int * dim_local
Definition: hypar.h:37
MPI related function definitions.
int ghosts
Definition: hypar.h:52
void * boundary
Definition: hypar.h:159
int * gpu_dim_local
Definition: hypar.h:455
Structure containing the variables and function pointers defining a boundary.
int ApplyBoundaryConditions(void *s, void *m, double *x, double *xref, double waqt)
Applies the boundary conditions specified for each boundary zone.
int nBoundaryZones
Definition: hypar.h:157
int nvars
Definition: hypar.h:29
Contains structure definition for hypar.
int use_gpu
Definition: hypar.h:449
Some basic definitions and macros.
int ndims
Definition: hypar.h:26
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23