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

Contains the function to clean up the Vlasov physics module. More...

#include <stdlib.h>
#include <physicalmodels/vlasov.h>

Go to the source code of this file.

Functions

int VlasovCleanup (void *s)
 

Detailed Description

Contains the function to clean up the Vlasov physics module.

Author
John Loffeld

Definition in file VlasovCleanup.c.

Function Documentation

◆ VlasovCleanup()

int VlasovCleanup ( void *  s)

Function to clean up all physics-related allocations for the Vlasov equations

Parameters
sSolver object of type HyPar

Definition at line 10 of file VlasovCleanup.c.

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 }
Definition: vlasov.h:57
double * potential
Definition: vlasov.h:84
int self_consistent_electric_field
Definition: vlasov.h:60
double * e_field
Definition: vlasov.h:81