HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InitializeSolvers.c
Go to the documentation of this file.
1 
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <io.h>
10 #include <tridiagLU.h>
11 #include <timeintegration.h>
12 #include <interpolation.h>
13 #include <firstderivative.h>
14 #include <secondderivative.h>
15 #include <mpivars.h>
16 #include <simulation_object.h>
17 
18 #ifdef with_python
19 #include <Python.h>
20 #endif
21 
22 /* Function declarations */
23 int ApplyBoundaryConditions (void*,void*,double*,double*,double);
24 int ApplyIBConditions (void*,void*,double*,double);
25 int HyperbolicFunction (double*,double*,void*,void*,double,int,
26  int(*)(double*,double*,int,void*,double),
27  int(*)(double*,double*,double*,double*,double*,
28  double*,int,void*,double));
29 int ParabolicFunctionNC1Stage (double*,double*,void*,void*,double);
30 int ParabolicFunctionNC2Stage (double*,double*,void*,void*,double);
31 int ParabolicFunctionNC1_5Stage (double*,double*,void*,void*,double);
32 int ParabolicFunctionCons1Stage (double*,double*,void*,void*,double);
33 int SourceFunction (double*,double*,void*,void*,double);
34 int VolumeIntegral (double*,double*,void*,void*);
35 int BoundaryIntegral (void*,void*);
36 int CalculateConservationError (void*,void*);
37 void IncrementFilenameIndex (char*,int);
38 int NonLinearInterpolation (double*,void*,void*,double,
39  int(*)(double*,double*,int,void*,double));
40 
41 #if defined(HAVE_CUDA)
42 int gpuHyperbolicFunction (double*,double*,void*,void*,double,int,
43  int(*)(double*,double*,int,void*,double),
44  int(*)(double*,double*,double*,double*,
45  double*,double*,int,void*,double));
46 #endif
47 
52 int InitializeSolvers( void *s,
53  int nsims
54  )
55 {
57  int ns;
59 
60  if (nsims == 0) return 0;
61 
62  if (!sim[0].mpi.rank) {
63  printf("Initializing solvers.\n");
64  }
65 
66  for (ns = 0; ns < nsims; ns++) {
67 
68  HyPar *solver = &(sim[ns].solver);
69  MPIVariables *mpi = &(sim[ns].mpi);
70 
74 #if defined(HAVE_CUDA)
75  if (solver->use_gpu) {
77  } else {
78 #endif
80 #if defined(HAVE_CUDA)
81  }
82 #endif
87 
88  /* choose the type of parabolic discretization */
89  solver->ParabolicFunction = NULL;
90  solver->SecondDerivativePar = NULL;
91  solver->FirstDerivativePar = NULL;
92  solver->InterpolateInterfacesPar = NULL;
93 
94 #if defined(HAVE_CUDA)
95  if (solver->use_gpu) {
96 
97  if (!strcmp(solver->spatial_type_par,_NC_2STAGE_)) {
98 
100 
101  if (!strcmp(solver->spatial_scheme_par,_FOURTH_ORDER_CENTRAL_)) {
103  } else {
104  fprintf(stderr,"ERROR (domain %d): scheme %s is not supported on GPU!",
105  ns, solver->spatial_scheme_par);
106  return 1;
107  }
108 
109  }
110 
111  } else {
112 #endif
113 
114  if (!strcmp(solver->spatial_type_par,_NC_1STAGE_)) {
115 
117  if (!strcmp(solver->spatial_scheme_par,_SECOND_ORDER_CENTRAL_)) {
119  } else if (!strcmp(solver->spatial_scheme_par,_FOURTH_ORDER_CENTRAL_)) {
121  } else {
122  fprintf(stderr,"Error (domain %d): %s is not a supported ",
123  ns, solver->spatial_scheme_par);
124  fprintf(stderr,"spatial scheme of type %s for the parabolic terms.\n",
125  solver->spatial_type_par);
126  }
127 
128  } else if (!strcmp(solver->spatial_type_par,_NC_2STAGE_)) {
129 
131  if (!strcmp(solver->spatial_scheme_par,_SECOND_ORDER_CENTRAL_)) {
133  /* why first order? see ParabolicFunctionNC2Stage.c. 2nd order central
134  approximation to the 2nd derivative can be expressed as a conjugation
135  of 1st order approximations to the 1st derivative (one forward and
136  one backward) -- this prevents odd-even decoupling */
137  } else if (!strcmp(solver->spatial_scheme_par,_FOURTH_ORDER_CENTRAL_)) {
139  /* why 4th order? I could not derive the decomposition of the
140  4th order central approximation to the 2nd derivative! Some problems
141  may show odd-even decoupling */
142  } else {
143  fprintf(stderr,"Error (domain %d): %s is not a supported ",
144  ns, solver->spatial_scheme_par);
145  fprintf(stderr,"spatial scheme of type %s for the parabolic terms.\n",
146  solver->spatial_type_par);
147  }
148 
149  } else if (!strcmp(solver->spatial_type_par,_NC_1_5STAGE_)) {
150 
152  if (!strcmp(solver->spatial_scheme_par,_SECOND_ORDER_CENTRAL_)) {
155  } else if (!strcmp(solver->spatial_scheme_par,_FOURTH_ORDER_CENTRAL_)) {
158  } else {
159  fprintf(stderr,"Error (domain %d): %s is not a supported ",
160  ns, solver->spatial_scheme_par);
161  fprintf(stderr,"spatial scheme of type %s for the parabolic terms.\n",
162  solver->spatial_type_par);
163  }
164 
165  } else if (!strcmp(solver->spatial_type_par,_CONS_1STAGE_)) {
166 
168  if (!strcmp(solver->spatial_scheme_par,_SECOND_ORDER_CENTRAL_)) {
170  } else {
171  fprintf(stderr,"Error (domain %d): %s is not a supported ",
172  ns, solver->spatial_scheme_par);
173  fprintf(stderr,"spatial scheme of type %s for the parabolic terms.\n",
174  solver->spatial_type_par);
175  }
176 
177  } else {
178 
179  fprintf(stderr,"Error (domain %d): %s is not a supported ",
180  ns, solver->spatial_type_par);
181  fprintf(stderr,"spatial discretization type for the parabolic terms.\n");
182  return(1);
183 
184  }
185 
186 #if defined(HAVE_CUDA)
187  }
188 #endif
189 
190  /* Spatial interpolation for hyperbolic term */
191  solver->interp = NULL;
192  solver->compact = NULL;
193  solver->lusolver = NULL;
194  solver->SetInterpLimiterVar = NULL;
195  solver->flag_nonlinearinterp = 1;
196  if (strcmp(solver->interp_type,_CHARACTERISTIC_) && strcmp(solver->interp_type,_COMPONENTS_)) {
197  fprintf(stderr,"Error in InitializeSolvers() (domain %d): %s is not a ",
198  ns, solver->interp_type);
199  fprintf(stderr,"supported interpolation type.\n");
200  return(1);
201  }
202 
203 #if defined(HAVE_CUDA)
204  if (solver->use_gpu) {
205 
206  if (!strcmp(solver->spatial_scheme_hyp,_FIFTH_ORDER_WENO_)) {
207 
208  /* Fifth order WENO scheme */
209  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
210  fprintf(stderr,
211  "Error (domain %d): characteristic-based WENO5 is not yet implemented on GPUs.\n",
212  ns );
213  return 1;
214  } else {
216  }
217  solver->interp = (WENOParameters*) calloc(1,sizeof(WENOParameters));
218  IERR WENOInitialize(solver,mpi,solver->spatial_scheme_hyp,solver->interp_type); CHECKERR(ierr);
219  solver->flag_nonlinearinterp = !(((WENOParameters*)solver->interp)->no_limiting);
220 
221  } else {
222 
223  fprintf(stderr,
224  "Error (domain %d): %s is a not a supported spatial interpolation scheme on GPUs.\n",
225  ns, solver->spatial_scheme_hyp);
226  return 1;
227  }
228 
229  } else {
230 #endif
231 
232  if (!strcmp(solver->spatial_scheme_hyp,_FIRST_ORDER_UPWIND_)) {
233 
234  /* First order upwind scheme */
235  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
237  } else {
239  }
240 
241  } else if (!strcmp(solver->spatial_scheme_hyp,_SECOND_ORDER_CENTRAL_)) {
242 
243  /* Second order central scheme */
244  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
246  } else {
248  }
249 
250  } else if (!strcmp(solver->spatial_scheme_hyp,_SECOND_ORDER_MUSCL_)) {
251 
252  /* Second order MUSCL scheme */
253  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
255  } else {
257  }
258  solver->interp = (MUSCLParameters*) calloc(1,sizeof(MUSCLParameters));
259  IERR MUSCLInitialize(solver,mpi); CHECKERR(ierr);
260 
261  } else if (!strcmp(solver->spatial_scheme_hyp,_THIRD_ORDER_MUSCL_)) {
262 
263  /* Third order MUSCL scheme */
264  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
266  } else {
268  }
269  solver->interp = (MUSCLParameters*) calloc(1,sizeof(MUSCLParameters));
270  IERR MUSCLInitialize(solver,mpi); CHECKERR(ierr);
271 
272  } else if (!strcmp(solver->spatial_scheme_hyp,_FOURTH_ORDER_CENTRAL_)) {
273 
274  /* Fourth order central scheme */
275  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
277  } else {
279  }
280 
281  } else if (!strcmp(solver->spatial_scheme_hyp,_FIFTH_ORDER_UPWIND_)) {
282 
283  /* Fifth order upwind scheme */
284  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
286  } else {
288  }
289 
290  } else if (!strcmp(solver->spatial_scheme_hyp,_FIFTH_ORDER_COMPACT_UPWIND_)) {
291 
292  /* Fifth order compact upwind scheme */
293  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
295  } else {
297  }
298  solver->compact = (CompactScheme*) calloc(1,sizeof(CompactScheme));
299  IERR CompactSchemeInitialize(solver,mpi,solver->interp_type);
300  solver->lusolver = (TridiagLU*) calloc (1,sizeof(TridiagLU));
301  IERR tridiagLUInit(solver->lusolver,&mpi->world);CHECKERR(ierr);
302 
303  } else if (!strcmp(solver->spatial_scheme_hyp,_FIFTH_ORDER_WENO_)) {
304 
305  /* Fifth order WENO scheme */
306  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
308  } else {
310  }
311  solver->interp = (WENOParameters*) calloc(1,sizeof(WENOParameters));
312  IERR WENOInitialize(solver,mpi,solver->spatial_scheme_hyp,solver->interp_type); CHECKERR(ierr);
313  solver->flag_nonlinearinterp = !(((WENOParameters*)solver->interp)->no_limiting);
314 
315  } else if (!strcmp(solver->spatial_scheme_hyp,_FIFTH_ORDER_CRWENO_)) {
316 
317  /* Fifth order CRWENO scheme */
318  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
320  } else {
322  }
323  solver->interp = (WENOParameters*) calloc(1,sizeof(WENOParameters));
324  IERR WENOInitialize(solver,mpi,solver->spatial_scheme_hyp,solver->interp_type); CHECKERR(ierr);
325  solver->flag_nonlinearinterp = !(((WENOParameters*)solver->interp)->no_limiting);
326  solver->compact = (CompactScheme*) calloc(1,sizeof(CompactScheme));
327  IERR CompactSchemeInitialize(solver,mpi,solver->interp_type);
328  solver->lusolver = (TridiagLU*) calloc (1,sizeof(TridiagLU));
329  IERR tridiagLUInit(solver->lusolver,&mpi->world);CHECKERR(ierr);
330 
331  } else if (!strcmp(solver->spatial_scheme_hyp,_FIFTH_ORDER_HCWENO_)) {
332 
333  /* Fifth order HCWENO scheme */
334  if ((solver->nvars > 1) && (!strcmp(solver->interp_type,_CHARACTERISTIC_))) {
336  } else {
338  }
339  solver->interp = (WENOParameters*) calloc(1,sizeof(WENOParameters));
340  IERR WENOInitialize(solver,mpi,solver->spatial_scheme_hyp,solver->interp_type); CHECKERR(ierr);
341  solver->flag_nonlinearinterp = !(((WENOParameters*)solver->interp)->no_limiting);
342  solver->compact = (CompactScheme*) calloc(1,sizeof(CompactScheme));
343  IERR CompactSchemeInitialize(solver,mpi,solver->interp_type);
344  solver->lusolver = (TridiagLU*) calloc (1,sizeof(TridiagLU));
345  IERR tridiagLUInit(solver->lusolver,&mpi->world);CHECKERR(ierr);
346 
347  } else {
348 
349  fprintf(stderr,"Error (domain %d): %s is a not a supported spatial interpolation scheme.\n",
350  ns, solver->spatial_scheme_hyp);
351  return(1);
352  }
353 
354 #if defined(HAVE_CUDA)
355  }
356 #endif
357 
358  /* Time integration */
359  solver->time_integrator = NULL;
360 #ifdef with_petsc
361  if (solver->use_petscTS) {
362  /* dummy -- not used */
364  solver->msti = NULL;
365  } else {
366  if (!strcmp(solver->time_scheme,_FORWARD_EULER_)) {
368  solver->msti = NULL;
369  } else if (!strcmp(solver->time_scheme,_RK_)) {
370  solver->TimeIntegrate = TimeRK;
371  solver->msti = (ExplicitRKParameters*) calloc (1,sizeof(ExplicitRKParameters));
373  solver->msti,mpi); CHECKERR(ierr);
374  } else if (!strcmp(solver->time_scheme,_GLM_GEE_)) {
375  solver->TimeIntegrate = TimeGLMGEE;
376  solver->msti = (GLMGEEParameters*) calloc (1,sizeof(GLMGEEParameters));
378  solver->msti,mpi); CHECKERR(ierr);
379  } else {
380  fprintf(stderr,"Error (domain %d): %s is a not a supported time-integration scheme.\n",
381  ns, solver->time_scheme);
382  return(1);
383  }
384  }
385 #else
386  if (!strcmp(solver->time_scheme,_FORWARD_EULER_)) {
388  solver->msti = NULL;
389  } else if (!strcmp(solver->time_scheme,_RK_)) {
390  solver->TimeIntegrate = TimeRK;
391  solver->msti = (ExplicitRKParameters*) calloc (1,sizeof(ExplicitRKParameters));
393  solver->msti,mpi); CHECKERR(ierr);
394  } else if (!strcmp(solver->time_scheme,_GLM_GEE_)) {
395  solver->TimeIntegrate = TimeGLMGEE;
396  solver->msti = (GLMGEEParameters*) calloc (1,sizeof(GLMGEEParameters));
398  solver->msti,mpi); CHECKERR(ierr);
399  } else {
400  fprintf(stderr,"Error (domain %d): %s is a not a supported time-integration scheme.\n",
401  ns, solver->time_scheme);
402  return(1);
403  }
404 #endif
405 
406  /* Solution output function */
407  solver->WriteOutput = NULL; /* default - no output */
408  solver->filename_index = NULL;
409  strcpy(solver->op_fname_root, "op");
410 #ifdef with_librom
411  strcpy(solver->op_rom_fname_root, "op_rom");
412 #endif
413  strcpy(solver->aux_op_fname_root, "ts0");
414  if (!strcmp(solver->output_mode,"serial")) {
415  solver->index_length = 5;
416  solver->filename_index = (char*) calloc (solver->index_length+1,sizeof(char));
417  int i; for (i=0; i<solver->index_length; i++) solver->filename_index[i] = '0';
418  solver->filename_index[solver->index_length] = (char) 0;
419  if (!strcmp(solver->op_file_format,"text")) {
420  solver->WriteOutput = WriteText;
421  strcpy(solver->solnfilename_extn,".dat");
422  } else if (!strcmp(solver->op_file_format,"tecplot2d")) {
423  solver->WriteOutput = WriteTecplot2D;
424  strcpy(solver->solnfilename_extn,".dat");
425  } else if (!strcmp(solver->op_file_format,"tecplot3d")) {
426  solver->WriteOutput = WriteTecplot3D;
427  strcpy(solver->solnfilename_extn,".dat");
428  } else if ((!strcmp(solver->op_file_format,"binary")) || (!strcmp(solver->op_file_format,"bin"))) {
429  solver->WriteOutput = WriteBinary;
430  strcpy(solver->solnfilename_extn,".bin");
431  } else if (!strcmp(solver->op_file_format,"none")) {
432  solver->WriteOutput = NULL;
433  } else {
434  fprintf(stderr,"Error (domain %d): %s is not a supported file format.\n",
435  ns, solver->op_file_format);
436  return(1);
437  }
438  if ((!strcmp(solver->op_overwrite,"no")) && solver->restart_iter) {
439  /* if it's a restart run, fast-forward the filename */
440  int t;
441  for (t=0; t<solver->restart_iter; t++)
442  if ((t+1)%solver->file_op_iter == 0) IncrementFilenameIndex(solver->filename_index,solver->index_length);
443  }
444  } else if (!strcmp(solver->output_mode,"parallel")) {
445  if (!strcmp(solver->op_file_format,"none")) solver->WriteOutput = NULL;
446  else {
447  /* only binary file writing supported in parallel mode */
448  /* use post-processing scripts to convert */
449  solver->WriteOutput = WriteBinary;
450  strcpy(solver->solnfilename_extn,".bin");
451  }
452  } else {
453  fprintf(stderr,"Error (domain %d): %s is not a supported output mode.\n",
454  ns, solver->output_mode);
455  fprintf(stderr,"Should be \"serial\" or \"parallel\". \n");
456  return(1);
457  }
458 
459  /* Solution plotting function */
460  strcpy(solver->plotfilename_extn,".png");
461 #ifdef with_python
462  solver->py_plt_func = NULL;
463  solver->py_plt_func_args = NULL;
464  {
465  char python_plotting_fname[_MAX_STRING_SIZE_] = "plotSolution";
466  PyObject* py_plot_name = PyUnicode_DecodeFSDefault(python_plotting_fname);
467  PyObject* py_plot_module = PyImport_Import(py_plot_name);
468  Py_DECREF(py_plot_name);
469  if (py_plot_module) {
470  solver->py_plt_func = PyObject_GetAttrString(py_plot_module, "plotSolution");
471  if (!solver->py_plt_func) {
472  if (!mpi->rank) {
473  printf("Unable to load plotSolution function from Python module.\n");
474  }
475  } else {
476  if (!mpi->rank) {
477  printf("Loaded Python module for plotting.\n");
478  printf("Loaded plotSolution function from Python module.\n");
479  }
480  }
481  } else {
482  if (!mpi->rank) {
483  printf("Unable to load Python module for plotting.\n");
484  }
485  }
486  }
487 #endif
488 
489  }
490 
491  return(0);
492 }
void * py_plt_func
Definition: hypar.h:466
char spatial_scheme_hyp[_MAX_STRING_SIZE_]
Definition: hypar.h:84
void * interp
Definition: hypar.h:362
Header file for TridiagLU.
#define _FORWARD_EULER_
int CompactSchemeInitialize(void *, void *, char *)
#define _CHARACTERISTIC_
Definition: interpolation.h:33
int Interp1PrimThirdOrderMUSCLChar(double *, double *, double *, double *, int, int, void *, void *, int)
3rd order MUSCL scheme with Koren&#39;s limiter (characteristic-based) on a uniform grid ...
int SecondDerivativeFourthOrderCentral(double *, double *, int, void *, void *)
int TimeForwardEuler(void *)
int ParabolicFunctionNC1Stage(double *par, double *u, void *s, void *m, double t)
int ParabolicFunctionNC2Stage(double *par, double *u, void *s, void *m, double t)
int ParabolicFunctionNC1_5Stage(double *par, double *u, void *s, void *m, double t)
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
Definitions for the functions computing the first derivative.
char aux_op_fname_root[_MAX_STRING_SIZE_]
Definition: hypar.h:208
int HyperbolicFunction(double *hyp, double *u, void *s, void *m, double t, int LimFlag, int(*FluxFunction)(double *, double *, int, void *, double), int(*UpwindFunction)(double *, double *, double *, double *, double *, double *, int, void *, double))
int Interp1PrimSecondOrderCentralChar(double *, double *, double *, double *, int, int, void *, void *, int)
2nd order central reconstruction (characteristic-based) on a uniform grid
int NonLinearInterpolation(double *u, void *s, void *m, double t, int(*FluxFunction)(double *, double *, int, void *, double))
int gpuHyperbolicFunction(double *hyp, double *u, void *s, void *m, double t, int LimFlag, int(*FluxFunction)(double *, double *, int, void *, double), int(*UpwindFunction)(double *, double *, double *, double *, double *, double *, int, void *, double))
#define _FIFTH_ORDER_COMPACT_UPWIND_
Definition: interpolation.h:24
int Interp1PrimSecondOrderMUSCLChar(double *, double *, double *, double *, int, int, void *, void *, int)
2nd order MUSCL scheme (characteristic-based) on a uniform grid
int CalculateConservationError(void *s, void *m)
char spatial_type_par[_MAX_STRING_SIZE_]
Definition: hypar.h:96
#define _FIRST_ORDER_UPWIND_
Definition: interpolation.h:12
#define _THIRD_ORDER_MUSCL_
Definition: interpolation.h:18
int Interp1PrimFifthOrderCompactUpwindChar(double *, double *, double *, double *, int, int, void *, void *, int)
5th order compact upwind reconstruction (characteristic-based) on a uniform grid
int FirstDerivativeFirstOrder(double *, double *, int, int, void *, void *)
int FirstDerivativeFourthOrderCentral(double *, double *, int, int, void *, void *)
MPI related function definitions.
char op_file_format[_MAX_STRING_SIZE_]
Definition: hypar.h:186
int Interp1PrimThirdOrderMUSCL(double *, double *, double *, double *, int, int, void *, void *, int)
3rd order MUSCL scheme with Koren&#39;s limiter (component-wise) on a uniform grid
#define _SECOND_ORDER_CENTRAL_
int MUSCLInitialize(void *, void *)
int BoundaryIntegral(void *s, void *m)
int TimeRK(void *)
Definition: TimeRK.c:35
int TimeExplicitRKInitialize(char *, char *, void *, void *)
#define _FIFTH_ORDER_HCWENO_
Definition: interpolation.h:30
int Interp1PrimFifthOrderUpwind(double *, double *, double *, double *, int, int, void *, void *, int)
5th order upwind reconstruction (component-wise) on a uniform grid
Function declarations for file I/O functions.
int(* ParabolicFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:256
Structure of variables/parameters needed by the WENO-type scheme.
Structure of variables/parameters needed by the compact schemes.
#define _GLM_GEE_
int Interp1PrimFifthOrderWENOChar(double *, double *, double *, double *, int, int, void *, void *, int)
5th order WENO reconstruction (characteristic-based) on a uniform grid
#define _FOURTH_ORDER_CENTRAL_
#define _CONS_1STAGE_
Definition: hypar.h:483
int(* NonlinearInterp)(double *, void *, void *, double, int(*)(double *, double *, int, void *, double))
Definition: hypar.h:228
int(* SetInterpLimiterVar)(double *, double *, double *, int, void *, void *)
Definition: hypar.h:234
char * filename_index
Definition: hypar.h:197
char op_fname_root[_MAX_STRING_SIZE_]
Definition: hypar.h:206
int Interp1PrimFifthOrderCompactUpwind(double *, double *, double *, double *, int, int, void *, void *, int)
5th order compact upwind reconstruction (component-wise) on a uniform grid
Definitions for the functions computing the second derivative.
MPI_Comm world
int Interp1PrimFirstOrderUpwind(double *, double *, double *, double *, int, int, void *, void *, int)
1st order upwind reconstruction (component-wise) on a uniform grid
int ApplyIBConditions(void *s, void *m, double *x, double waqt)
#define _NC_2STAGE_
Definition: hypar.h:477
#define _MAX_STRING_SIZE_
Definition: basic.h:14
int TimeGLMGEE(void *)
Definition: TimeGLMGEE.c:45
Structure containing the parameters for the General Linear Methods with Global Error Estimators (GLM-...
Structure containing the parameters for an explicit Runge-Kutta method.
#define _FIFTH_ORDER_WENO_
Definition: interpolation.h:26
void * py_plt_func_args
Definition: hypar.h:467
char plotfilename_extn[_MAX_STRING_SIZE_]
Definition: hypar.h:203
int WENOInitialize(void *, void *, char *, char *)
#define _RK_
char time_scheme[_MAX_STRING_SIZE_]
Definition: hypar.h:78
char op_overwrite[_MAX_STRING_SIZE_]
Definition: hypar.h:191
int Interp1PrimFifthOrderWENO(double *, double *, double *, double *, int, int, void *, void *, int)
5th order WENO reconstruction (component-wise) on a uniform grid
int(* SourceFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:259
void * compact
Definition: hypar.h:364
int ApplyBoundaryConditions(void *s, void *m, double *x, double *xref, double waqt)
Applies the boundary conditions specified for each boundary zone.
int(* InterpolateInterfacesPar)(double *, double *, int, void *, void *)
Definition: hypar.h:239
int(* BoundaryIntegralFunction)(void *, void *)
Definition: hypar.h:390
int Interp1PrimFourthOrderCentralChar(double *, double *, double *, double *, int, int, void *, void *, int)
4th order central reconstruction (characteristic-based) on a uniform grid
#define _NC_1STAGE_
Definition: hypar.h:475
int(* VolumeIntegralFunction)(double *, double *, void *, void *)
Definition: hypar.h:388
char op_rom_fname_root[_MAX_STRING_SIZE_]
Definition: hypar.h:407
int ParabolicFunctionCons1Stage(double *par, double *u, void *s, void *m, double t)
int(* FirstDerivativePar)(double *, double *, int, int, void *, void *)
Definition: hypar.h:243
Simulation object.
int Interp1PrimFourthOrderCentral(double *, double *, double *, double *, int, int, void *, void *, int)
4th order central reconstruction (component-wise) on a uniform grid
int SecondDerivativeSecondOrderCentral(double *, double *, int, void *, void *)
#define _NC_1_5STAGE_
Definition: hypar.h:481
int tridiagLUInit(void *, void *)
Definition: tridiagLUInit.c:39
#define _COMPONENTS_
Definition: interpolation.h:34
int(* HyperbolicFunction)(double *, double *, void *, void *, double, int, int(*)(double *, double *, int, void *, double), int(*)(double *, double *, double *, double *, double *, double *, int, void *, double))
Definition: hypar.h:250
#define _FIFTH_ORDER_UPWIND_
Definition: interpolation.h:22
int WriteTecplot3D(int, int, int *, double *, double *, char *, int *)
int nvars
Definition: hypar.h:29
int file_op_iter
Definition: hypar.h:171
char spatial_scheme_par[_MAX_STRING_SIZE_]
Definition: hypar.h:99
int Interp1PrimSecondOrderMUSCL(double *, double *, double *, double *, int, int, void *, void *, int)
2nd order MUSCL scheme (component-wise) on a uniform grid
int use_petscTS
Definition: hypar.h:395
int Interp1PrimSecondOrderCentral(double *, double *, double *, double *, int, int, void *, void *, int)
2nd order central reconstruction (component-wise) on a uniform grid
char time_scheme_type[_MAX_STRING_SIZE_]
Definition: hypar.h:81
int gpuInterp1PrimFifthOrderWENO(double *, double *, double *, double *, int, int, void *, void *, int)
5th order WENO reconstruction (component-wise) on a uniform grid
int(* InterpolateInterfacesHyp)(double *, double *, double *, double *, int, int, void *, void *, int)
Definition: hypar.h:224
#define CHECKERR(ierr)
Definition: basic.h:18
int Interp1PrimFifthOrderCRWENO(double *, double *, double *, double *, int, int, void *, void *, int)
5th order CRWENO reconstruction (component-wise) on a uniform grid
char interp_type[_MAX_STRING_SIZE_]
Definition: hypar.h:88
int Interp1PrimFifthOrderHCWENOChar(double *, double *, double *, double *, int, int, void *, void *, int)
5th order hybrid compact-WENO reconstruction (characteristic-based) on a uniform grid ...
Contains function declarations for time integration.
#define _SECOND_ORDER_MUSCL_
Definition: interpolation.h:16
int use_gpu
Definition: hypar.h:449
int Interp1PrimFifthOrderCRWENOChar(double *, double *, double *, double *, int, int, void *, void *, int)
5th order CRWENO reconstruction (characteristic-based) on a uniform grid
void * msti
Definition: hypar.h:366
Structure defining a simulation.
int TimeGLMGEEInitialize(char *, char *, void *, void *)
int WriteText(int, int, int *, double *, double *, char *, int *)
Definition: WriteText.c:27
Structure of variables/parameters needed by the MUSCL scheme.
int SourceFunction(double *source, double *u, void *s, void *m, double t)
int(* SecondDerivativePar)(double *, double *, int, void *, void *)
Definition: hypar.h:247
int WriteTecplot2D(int, int, int *, double *, double *, char *, int *)
int(* ApplyBoundaryConditions)(void *, void *, double *, double *, double)
Definition: hypar.h:214
#define IERR
Definition: basic.h:16
char solnfilename_extn[_MAX_STRING_SIZE_]
Definition: hypar.h:201
#define _FIFTH_ORDER_CRWENO_
Definition: interpolation.h:28
int(* TimeIntegrate)(void *)
Definition: hypar.h:220
int(* CalculateConservationError)(void *, void *)
Definition: hypar.h:392
int index_length
Definition: hypar.h:199
int gpuFirstDerivativeFourthOrderCentral(double *, double *, int, int, void *, void *)
int WriteBinary(int, int, int *, double *, double *, char *, int *)
Definition: WriteBinary.c:34
int FirstDerivativeSecondOrderCentral(double *, double *, int, int, void *, void *)
Structure of MPI-related variables.
int(* ApplyIBConditions)(void *, void *, double *, double)
Definition: hypar.h:217
char output_mode[_MAX_STRING_SIZE_]
Definition: hypar.h:183
int InitializeSolvers(void *, int)
int flag_nonlinearinterp
Definition: hypar.h:411
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
int Interp1PrimFifthOrderHCWENO(double *, double *, double *, double *, int, int, void *, void *, int)
5th order hybrid compact-WENO reconstruction (component-wise) on a uniform grid
void * lusolver
Definition: hypar.h:368
void IncrementFilenameIndex(char *f, int len)
int restart_iter
Definition: hypar.h:58
int VolumeIntegral(double *VolumeIntegral, double *u, void *s, void *m)
int Interp1PrimFirstOrderUpwindChar(double *, double *, double *, double *, int, int, void *, void *, int)
1st order upwind reconstruction (characteristic-based) on a uniform grid
int(* WriteOutput)(int, int, int *, double *, double *, char *, int *)
Definition: hypar.h:211
#define _DECLARE_IERR_
Definition: basic.h:17
int Interp1PrimFifthOrderUpwindChar(double *, double *, double *, double *, int, int, void *, void *, int)
5th order upwind reconstruction (characteristic-based) on a uniform grid
void * time_integrator
Definition: hypar.h:165
int Interp2PrimSecondOrder(double *, double *, int, void *, void *)
2nd order component-wise interpolation of the 2nd primitive on a uniform grid