HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 }
double * UnsteadyTemperatureData
double * UnsteadyDirichletData
Containts the structures and definitions for boundary condition implementation.
int BCCleanup(void *, int)
Definition: BCCleanup.c:12
Structure containing the variables and function pointers defining a boundary.
double * UnsteadyTimeLevels
void gpuFree(void *)
Contains function definitions for common array operations on GPU.