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
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <basic.h>
3 #include <arrayfunctions.h>
5 #include <hypar.h>
6 
7 int FPPowerSystem1BusAdvection(double *f,double *u,int dir,void *s,double t)
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
Contains structure definition for hypar.
Some basic definitions and macros.
int ndims
Definition: hypar.h:26
Contains macros and function definitions for common array operations.
#define _ArrayAddCopy1D_(x, a, y, size)
#define _ArrayProduct1D_(x, size, p)
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
Fokker-Planck Model for 1-Bus Power System.
int FPPowerSystem1BusAdvection(double *f, double *u, int dir, void *s, double t)