HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
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 }
int nvars
Definition: hypar.h:29
Containts the structures and definitions for boundary condition implementation.
MPI related function definitions.
int(* BCFunctionU)(void *, void *, int, int, int *, int, double *, double)
void * boundary
Definition: hypar.h:159
Some basic definitions and macros.
Structure containing the variables and function pointers defining a boundary.
int ndims
Definition: hypar.h:26
int * gpu_dim_local
Definition: hypar.h:455
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
int ApplyBoundaryConditions(void *s, void *m, double *x, double *xref, double waqt)
Applies the boundary conditions specified for each boundary zone.
Contains structure definition for hypar.
int * dim_local
Definition: hypar.h:37
int ghosts
Definition: hypar.h:52
Structure of MPI-related variables.
int use_gpu
Definition: hypar.h:449
int nBoundaryZones
Definition: hypar.h:157
Contains macros and function definitions for common array operations.