HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FPPowerSystem1BusAdvection.c File Reference
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <physicalmodels/fppowersystem1bus.h>
#include <hypar.h>

Go to the source code of this file.

Functions

int FPPowerSystem1BusAdvection (double *f, double *u, int dir, void *s, double t)
 

Function Documentation

int FPPowerSystem1BusAdvection ( double *  f,
double *  u,
int  dir,
void *  s,
double  t 
)

Definition at line 7 of file FPPowerSystem1BusAdvection.c.

8 {
9  HyPar *solver = (HyPar*) s;
10  int *dim = solver->dim_local;
11  int ghosts = solver->ghosts;
12  int ndims = solver->ndims;
13  int nvars = solver->nvars;
14 
15  /* calculate total size of arrays */
16  int bounds[ndims]; _ArrayAddCopy1D_(dim,(2*ghosts),bounds,ndims);
17  int size; _ArrayProduct1D_(bounds,ndims,size); size *= nvars;
18 
19  /* f = u */
20  _ArrayCopy1D_(u,f,size);
21 
22  return(0);
23 }
int * dim_local
Definition: hypar.h:37
int ghosts
Definition: hypar.h:52
#define _ArrayCopy1D_(x, y, size)
int nvars
Definition: hypar.h:29
int ndims
Definition: hypar.h:26
#define _ArrayAddCopy1D_(x, a, y, size)
#define _ArrayProduct1D_(x, size, p)
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23