HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ExactSolution.c
Go to the documentation of this file.
1 
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <basic.h>
10 #include <arrayfunctions.h>
11 #include <io.h>
12 #include <mpivars.h>
13 #include <hypar.h>
14 
17  void *s,
18  void *m,
19  double *uex,
20  char *fname,
21  int *flag
22  )
23 {
24  HyPar *solver = (HyPar*) s;
25 
26  int same_size = 1;
27  for (int i=0; i<solver->ndims; i++) {
28  if (solver->dim_global[i] != solver->dim_global_ex[i]) same_size = 0;
29  }
30 
31  if (same_size) {
32  ReadArray( solver->ndims,
33  solver->nvars,
34  solver->dim_global,
35  solver->dim_local,
36  solver->ghosts,
37  solver,
38  m,
39  NULL,
40  uex,
41  fname,
42  flag);
43  } else {
44  ReadArraywInterp( solver->ndims,
45  solver->nvars,
46  solver->dim_global,
47  solver->dim_local,
48  solver->dim_global_ex,
49  solver->ghosts,
50  solver,
51  m,
52  NULL,
53  uex,
54  fname,
55  flag);
56  }
57 
58  return(0);
59 }
int * dim_global
Definition: hypar.h:33
int * dim_global_ex
Definition: hypar.h:75
int * dim_local
Definition: hypar.h:37
MPI related function definitions.
Function declarations for file I/O functions.
int ghosts
Definition: hypar.h:52
int ReadArray(int, int, int *, int *, int, void *, void *, double *, double *, char *, int *)
Definition: ReadArray.c:25
int nvars
Definition: hypar.h:29
int ReadArraywInterp(int, int, int *, int *, int *, int, void *, void *, double *, double *, char *, int *)
Contains structure definition for hypar.
int ExactSolution(void *, void *, double *, char *, int *)
Definition: ExactSolution.c:16
Some basic definitions and macros.
int ndims
Definition: hypar.h:26
Contains macros and function definitions for common array operations.
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23