HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
VlasovWriteEFieldAndPotential.c
Go to the documentation of this file.
1 
6 #include <stdlib.h>
7 #include <string.h>
8 #include <basic.h>
9 #include <common.h>
10 #include <arrayfunctions.h>
11 #include <mathfunctions.h>
12 #include <io.h>
13 #include <mpivars.h>
14 #include <hypar.h>
15 #include <physicalmodels/vlasov.h>
16 
18 int VlasovWriteSpatialField( void*, void*, double*, char* );
20 int VlasovPlotSpatialField( void*, void*, double*, double, char* );
21 
24  void* m,
25  double a_t )
26 {
27  HyPar *solver = (HyPar*) s;
28  MPIVariables *mpi = (MPIVariables*) m;
29  Vlasov *param = (Vlasov*) solver->physics;
30 
31  {
32  char fname_root[_MAX_STRING_SIZE_] = "efield";
33  VlasovWriteSpatialField( solver, mpi, param->e_field, fname_root );
34  if (!strcmp(solver->plot_solution,"yes")) {
35  VlasovPlotSpatialField( solver, mpi, param->e_field, a_t, fname_root );
36  }
37  }
38 
39  if (param->self_consistent_electric_field) {
40  char fname_root[_MAX_STRING_SIZE_] = "potential";
41  VlasovWriteSpatialField( solver, mpi, param->potential, fname_root );
42  if (!strcmp(solver->plot_solution,"yes")) {
43  VlasovPlotSpatialField( solver, mpi, param->potential, a_t, fname_root );
44  }
45  }
46 
47  return 0;
48 }
Definition: vlasov.h:57
Some common functions used here and there.
char plot_solution[_MAX_STRING_SIZE_]
Definition: hypar.h:194
MPI related function definitions.
Contains function definitions for common mathematical functions.
int VlasovWriteEFieldAndPotential(void *s, void *m, double a_t)
Some basic definitions and macros.
double * e_field
Definition: vlasov.h:81
Vlasov Equation.
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
#define _MAX_STRING_SIZE_
Definition: basic.h:14
int VlasovPlotSpatialField(void *, void *, double *, double, char *)
Contains structure definition for hypar.
int VlasovWriteSpatialField(void *, void *, double *, char *)
void * physics
Definition: hypar.h:266
Structure of MPI-related variables.
Function declarations for file I/O functions.
Contains macros and function definitions for common array operations.