HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Euler1DPreStep.c
Go to the documentation of this file.
1 
6 #include <arrayfunctions.h>
8 #include <hypar.h>
9 
17  double *u,
18  void *s,
19  void *m,
20  double waqt
21  )
22 {
23  HyPar *solver = (HyPar*) s;
24  Euler1D *param = (Euler1D*) solver->physics;
25  int *dim = solver->dim_local;
26  int ghosts = solver->ghosts;
27  static const int ndims = _MODEL_NDIMS_;
28  static const int JacSize = _MODEL_NVARS_*_MODEL_NVARS_;
29  static int index[_MODEL_NDIMS_], bounds[_MODEL_NDIMS_], offset[_MODEL_NDIMS_];
30 
31  /* set bounds for array index to include ghost points */
32  _ArrayAddCopy1D_(dim,(2*ghosts),bounds,ndims);
33  /* set offset such that index is compatible with ghost point arrangement */
34  _ArraySetValue_(offset,ndims,-ghosts);
35  /* copy the solution to act as a reference for linearization */
37 
38  int done = 0; _ArraySetValue_(index,ndims,0);
39  while (!done) {
40  int p; _ArrayIndex1DWO_(ndims,dim,index,offset,ghosts,p);
41  double rho, v, e, P;
42  _Euler1DGetFlowVar_((u+_MODEL_NVARS_*p),rho,v,e,P,param);
43  _Euler1DSetStiffJac_((param->fast_jac+JacSize*p),rho,v,e,P,param->gamma);
44  _ArrayIncrementIndex_(ndims,bounds,index,done);
45  }
46 
47  return(0);
48 }
int npoints_local_wghosts
Definition: hypar.h:42
#define _ArraySetValue_(x, size, value)
#define _Euler1DGetFlowVar_(u, rho, v, e, P, p)
Definition: euler1d.h:81
int Euler1DPreStep(double *, void *, void *, double)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _MODEL_NVARS_
Definition: euler1d.h:58
void * physics
Definition: hypar.h:266
int * dim_local
Definition: hypar.h:37
#define _MODEL_NDIMS_
Definition: euler1d.h:56
int ghosts
Definition: hypar.h:52
#define _Euler1DSetStiffJac_(J, rho, v, e, P, gamma)
Definition: euler1d.h:149
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
double * fast_jac
Definition: euler1d.h:289
#define _ArrayCopy1D_(x, y, size)
double * solution
Definition: euler1d.h:290
Contains structure definition for hypar.
Contains macros and function definitions for common array operations.
#define _ArrayAddCopy1D_(x, a, y, size)
1D Euler Equations (inviscid, compressible flows)
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
Structure containing variables and parameters specific to the 1D Euler equations. This structure cont...
Definition: euler1d.h:273
double gamma
Definition: euler1d.h:274