HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
BCCleanup.c
Go to the documentation of this file.
1 
5 #include <stdlib.h>
6 #if defined(HAVE_CUDA)
7 #include <arrayfunctions_gpu.h>
8 #endif
9 #include <boundaryconditions.h>
10 
12 int BCCleanup( void *b,
13  int flag_gpu )
14 {
15  DomainBoundary *boundary = (DomainBoundary*) b;
16  free(boundary->xmin);
17  free(boundary->xmax);
18  free(boundary->is);
19  free(boundary->ie);
20  if (boundary->DirichletValue) free(boundary->DirichletValue);
21  if (boundary->SpongeValue ) free(boundary->SpongeValue );
22  if (boundary->FlowVelocity ) free(boundary->FlowVelocity );
23 
24  if (boundary->UnsteadyDirichletSize) free(boundary->UnsteadyDirichletSize);
25  if (boundary->UnsteadyDirichletData) free(boundary->UnsteadyDirichletData);
26 
27  if (boundary->UnsteadyTemperatureSize) free(boundary->UnsteadyTemperatureSize);
28  if (boundary->UnsteadyTimeLevels) free(boundary->UnsteadyTimeLevels);
29  if (boundary->UnsteadyTemperatureData) free(boundary->UnsteadyTemperatureData);
30 
31 #if defined(HAVE_CUDA)
32  if (flag_gpu) {
33  gpuFree(boundary->gpu_bounds);
34  gpuFree(boundary->gpu_is);
35  gpuFree(boundary->gpu_ie);
36  if (boundary->FlowVelocity) gpuFree(boundary->gpu_FlowVelocity );
37  }
38 #endif
39 
40  return 0;
41 }
Containts the structures and definitions for boundary condition implementation.
Contains function definitions for common array operations on GPU.
Structure containing the variables and function pointers defining a boundary.
double * UnsteadyDirichletData
double * UnsteadyTimeLevels
double * UnsteadyTemperatureData
int BCCleanup(void *b, int flag_gpu)
Definition: BCCleanup.c:12
void gpuFree(void *)