HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
WENOCleanup.c File Reference

Cleans up allocations specific to WENO-type methods. More...

#include <stdlib.h>
#include <arrayfunctions_gpu.h>
#include <interpolation.h>
#include <mpivars.h>
#include <hypar.h>

Go to the source code of this file.

Functions

int WENOCleanup (void *s, int flag_gpu)
 

Detailed Description

Cleans up allocations specific to WENO-type methods.

Author
Debojyoti Ghosh, Youngdae Kim

Definition in file WENOCleanup.c.

Function Documentation

◆ WENOCleanup()

int WENOCleanup ( void *  s,
int  flag_gpu 
)

Cleans up all allocations related to the WENO-type methods.

Parameters
sWENO object of type WENOParameters
flag_gpuflag to indicate if on GPU

Definition at line 17 of file WENOCleanup.c.

19 {
20  WENOParameters *weno = (WENOParameters*) s;
21 
22  if (weno->offset) free(weno->offset);
23 #if defined(HAVE_CUDA)
24  if (flag_gpu) {
25  if (weno->w1) gpuFree(weno->w1);
26  if (weno->w2) gpuFree(weno->w2);
27  if (weno->w3) gpuFree(weno->w3);
28  } else {
29 #endif
30  if (weno->w1) free(weno->w1);
31  if (weno->w2) free(weno->w2);
32  if (weno->w3) free(weno->w3);
33 #if defined(HAVE_CUDA)
34  }
35 #endif
36 
37  return(0);
38 }
Structure of variables/parameters needed by the WENO-type scheme.
void gpuFree(void *)