HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
CompactSchemeInitialize.c
Go to the documentation of this file.
1 
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <interpolation.h>
10 #include <mpivars.h>
11 #include <hypar.h>
12 
18  void *s,
19  void *m,
20  char *type
21  )
22 {
23  HyPar *solver = (HyPar*) s;
24  MPIVariables *mpi = (MPIVariables*) m;
25  CompactScheme *compact = (CompactScheme*) solver->compact;
26 
27  int nvars = solver->nvars;
28  int ndims = solver->ndims;
29 
30  int size = 1, d;
31  for (d=0; d<solver->ndims; d++) size *= (solver->dim_local[d]+1);
32  size *= solver->nvars;
33  if (!strcmp(solver->interp_type,_CHARACTERISTIC_)) size *= solver->nvars;
34 
35  compact->A = (double*) calloc (size, sizeof(double));
36  compact->B = (double*) calloc (size, sizeof(double));
37  compact->C = (double*) calloc (size, sizeof(double));
38  compact->R = (double*) calloc (size, sizeof(double));
39 
40  compact->sendbuf = (double*) calloc (size, sizeof(double));
41  compact->recvbuf = (double*) calloc (size, sizeof(double));
42 
43  return(0);
44 }
int nvars
Definition: hypar.h:29
MPI related function definitions.
int CompactSchemeInitialize(void *s, void *m, char *type)
#define _CHARACTERISTIC_
Definition: interpolation.h:33
int ndims
Definition: hypar.h:26
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
Contains structure definition for hypar.
char interp_type[_MAX_STRING_SIZE_]
Definition: hypar.h:88
double * recvbuf
Structure of variables/parameters needed by the compact schemes.
int * dim_local
Definition: hypar.h:37
Structure of MPI-related variables.
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
void * compact
Definition: hypar.h:364
double * sendbuf