HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Euler1DModifiedSolution.c
Go to the documentation of this file.
1 
6 #include <basic.h>
7 #include <arrayfunctions.h>
9 #include <mpivars.h>
10 #include <hypar.h>
11 
24  double *uC,
25  double *u,
26  int d,
27  void *s,
28  void *m,
29  double waqt
30  )
31 {
32  HyPar *solver = (HyPar*) s;
33  Euler1D *param = (Euler1D*) solver->physics;
34 
35  int ghosts = solver->ghosts;
36  int *dim = solver->dim_local;
37  int ndims = solver->ndims;
38  int index[ndims], bounds[ndims], offset[ndims];
39 
40  /* set bounds for array index to include ghost points */
41  _ArrayCopy1D_(dim,bounds,ndims);
42  int i; for (i=0; i<ndims; i++) bounds[i] += 2*ghosts;
43 
44  /* set offset such that index is compatible with ghost point arrangement */
45  _ArraySetValue_(offset,ndims,-ghosts);
46 
47  int done = 0; _ArraySetValue_(index,ndims,0);
48  while (!done) {
49  int p; _ArrayIndex1DWO_(ndims,dim,index,offset,ghosts,p); p *= _MODEL_NVARS_;
50  _ArrayScaleCopy1D_((u+p),(1.0/param->grav_field[p/_MODEL_NVARS_]),(uC+p),_MODEL_NVARS_);
51  _ArrayIncrementIndex_(ndims,bounds,index,done);
52  }
53  return(0);
54 }
#define _ArraySetValue_(x, size, value)
int Euler1DModifiedSolution(double *, double *, int, void *, void *, double)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _MODEL_NVARS_
Definition: euler1d.h:58
#define _ArrayScaleCopy1D_(x, a, y, size)
void * physics
Definition: hypar.h:266
int * dim_local
Definition: hypar.h:37
MPI related function definitions.
int ghosts
Definition: hypar.h:52
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
Contains structure definition for hypar.
double * grav_field
Definition: euler1d.h:288
Some basic definitions and macros.
int ndims
Definition: hypar.h:26
Contains macros and function definitions for common array operations.
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