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

Misc. functions for the Vlasov equations. More...

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

Go to the source code of this file.

Functions

int VlasovEField (double *, void *, double)
 
int VlasovPreStep (double *u, void *s, void *m, double waqt)
 
int VlasovPostStage (double *u, void *s, void *m, double waqt)
 

Detailed Description

Misc. functions for the Vlasov equations.

Author
Debojyoti Ghosh

Definition in file VlasovFunctions.c.

Function Documentation

◆ VlasovEField()

int VlasovEField ( double *  u,
void *  s,
double  t 
)

Compute electric field.

Parameters
uConserved solution
sSolver object of type HyPar
tCurrent time

Definition at line 258 of file VlasovEField.c.

262 {
263  HyPar *solver = (HyPar*) s;
264  Vlasov *param = (Vlasov*) solver->physics;
265 
266  int ierr;
267 
268  if (param->self_consistent_electric_field) {
269  ierr = SetEFieldSelfConsistent(u, s, t);
270  } else {
271  ierr = SetEFieldPrescribed(u, s, t);
272  }
273 
274  return ierr;
275 }
Definition: vlasov.h:57
int self_consistent_electric_field
Definition: vlasov.h:60
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
static int SetEFieldSelfConsistent(double *u, void *s, double t)
Definition: VlasovEField.c:92
void * physics
Definition: hypar.h:266
static int SetEFieldPrescribed(double *u, void *s, double t)
Definition: VlasovEField.c:45

◆ VlasovPreStep()

int VlasovPreStep ( double *  u,
void *  s,
void *  m,
double  waqt 
)

Vlasov-specific function called at the beginning of each time-step: Calls the function to set the electric field

Parameters
uSolution (conserved variables)
sSolver object of type HyPar
mMPI object of type MPIVariables
waqtCurrent solution time

Definition at line 14 of file VlasovFunctions.c.

19 {
20  HyPar *solver = (HyPar*) s;
21  Vlasov *param = (Vlasov*) solver->physics;
22 
23  int ierr = VlasovEField(u, solver, waqt);
24  if (ierr) return ierr;
25 
26  return 0;
27 }
Definition: vlasov.h:57
int VlasovEField(double *, void *, double)
Definition: VlasovEField.c:258
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
void * physics
Definition: hypar.h:266

◆ VlasovPostStage()

int VlasovPostStage ( double *  u,
void *  s,
void *  m,
double  waqt 
)

Vlasov-specific function called at the end of each stage in a multistage time integrator: Calls the function to set the electric field

Parameters
uSolution (conserved variables)
sSolver object of type HyPar
mMPI object of type MPIVariables
waqtCurrent solution time

Definition at line 33 of file VlasovFunctions.c.

38 {
39  HyPar *solver = (HyPar*) s;
40  Vlasov *param = (Vlasov*) solver->physics;
41 
42  int ierr = VlasovEField(u, solver, waqt);
43  if (ierr) return ierr;
44 
45  return 0;
46 }
Definition: vlasov.h:57
int VlasovEField(double *, void *, double)
Definition: VlasovEField.c:258
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
void * physics
Definition: hypar.h:266