HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VlasovCleanup.c
Go to the documentation of this file.
1 
6 #include <stdlib.h>
8 
10 int VlasovCleanup(void *s )
11 {
12  Vlasov *physics = (Vlasov*) s;
13 
14  free(physics->e_field);
15  free(physics->potential);
16 
17 #ifdef fftw
18  if(physics->self_consistent_electric_field) {
19  free(physics->sum_buffer);
20 
21  fftw_destroy_plan(physics->plan_forward_e);
22  fftw_destroy_plan(physics->plan_backward_e);
23 
24  fftw_free(physics->phys_buffer_e);
25  fftw_free(physics->fourier_buffer_e);
26 
27  fftw_destroy_plan(physics->plan_forward_phi);
28  fftw_destroy_plan(physics->plan_backward_phi);
29 
30  fftw_free(physics->phys_buffer_phi);
31  fftw_free(physics->fourier_buffer_phi);
32  }
33 #endif
34 
35  return(0);
36 }
double * e_field
Definition: vlasov.h:81
double * potential
Definition: vlasov.h:84
int VlasovCleanup(void *)
Definition: VlasovCleanup.c:10
Definition: vlasov.h:57
Vlasov Equation.
int self_consistent_electric_field
Definition: vlasov.h:60