HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WriteInputs.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 <timeintegration.h>
11 #include <mpivars.h>
12 #include <simulation_object.h>
13 
15 int WriteInputs ( void *s,
17  int nsims,
18  int rank
19  )
20 {
22  int n;
23 
24  if (sim == NULL) return 0;
25 
26  if (!rank) {
27 
28  printf(" No. of dimensions : %d\n",sim[0].solver.ndims);
29  printf(" No. of variables : %d\n",sim[0].solver.nvars);
30  if (nsims > 1) {
31  printf(" Domain sizes:\n");
32  for (int n = 0; n < nsims; n++) {
33  printf(" domain %3d - ", n);
34  for (int i=0; i<sim[n].solver.ndims; i++) printf ("%d ",sim[n].solver.dim_global[i]);
35  printf("\n");
36  }
37 #ifndef serial
38  printf(" Processes along each dimension:\n");
39  for (int n = 0; n < nsims; n++) {
40  printf(" domain %3d - ", n);
41  for (int i=0; i<sim[n].solver.ndims; i++) printf ("%d ",sim[n].mpi.iproc[i]);
42  printf("\n");
43  }
44 #endif
45  printf(" Exact solution domain sizes:\n");
46  for (int n = 0; n < nsims; n++) {
47  printf(" domain %3d - ", n);
48  for (int i=0; i<sim[n].solver.ndims; i++) printf ("%d ",sim[n].solver.dim_global_ex[i]);
49  printf("\n");
50  }
51  } else {
52  printf(" Domain size : ");
53  for (int i=0; i<sim[0].solver.ndims; i++) printf ("%d ",sim[0].solver.dim_global[i]);
54  printf("\n");
55 #ifndef serial
56  printf(" Processes along each dimension : ");
57  for (int i=0; i<sim[0].solver.ndims; i++) printf ("%d ",sim[0].mpi.iproc[i]);
58  printf("\n");
59 #endif
60  printf(" Exact solution domain size : ");
61  for (int i=0; i<sim[0].solver.ndims; i++) printf ("%d ",sim[0].solver.dim_global_ex[i]);
62  printf("\n");
63  }
64  printf(" No. of ghosts pts : %d\n" ,sim[0].solver.ghosts );
65  printf(" No. of iter. : %d\n" ,sim[0].solver.n_iter );
66  printf(" Restart iteration : %d\n" ,sim[0].solver.restart_iter );
67 #ifdef with_petsc
68  if (sim[0].solver.use_petscTS)
69  printf(" Time integration scheme : PETSc \n" );
70  else {
71  printf(" Time integration scheme : %s ",sim[0].solver.time_scheme );
72  if (strcmp(sim[0].solver.time_scheme,_FORWARD_EULER_)) {
73  printf("(%s)",sim[0].solver.time_scheme_type );
74  }
75  printf("\n");
76  }
77 #else
78  printf(" Time integration scheme : %s ",sim[0].solver.time_scheme );
79  if (strcmp(sim[0].solver.time_scheme,_FORWARD_EULER_)) {
80  printf("(%s)",sim[0].solver.time_scheme_type );
81  }
82  printf("\n");
83 #endif
84  printf(" Spatial discretization scheme (hyperbolic) : %s\n" ,sim[0].solver.spatial_scheme_hyp );
85  printf(" Split hyperbolic flux term? : %s\n" ,sim[0].solver.SplitHyperbolicFlux );
86  printf(" Interpolation type for hyperbolic term : %s\n" ,sim[0].solver.interp_type );
87  printf(" Spatial discretization type (parabolic ) : %s\n" ,sim[0].solver.spatial_type_par );
88  printf(" Spatial discretization scheme (parabolic ) : %s\n" ,sim[0].solver.spatial_scheme_par );
89  printf(" Time Step : %E\n" ,sim[0].solver.dt );
90  printf(" Check for conservation : %s\n" ,sim[0].solver.ConservationCheck );
91  printf(" Screen output iterations : %d\n" ,sim[0].solver.screen_op_iter );
92  printf(" File output iterations : %d\n" ,sim[0].solver.file_op_iter );
93  printf(" Initial solution file type : %s\n" ,sim[0].solver.ip_file_type );
94  printf(" Initial solution read mode : %s" ,sim[0].solver.input_mode );
95  if (strcmp(sim[0].solver.input_mode,"serial")) printf(" [%d file IO rank(s)]\n",sim[0].mpi.N_IORanks );
96  else printf("\n");
97  printf(" Solution file write mode : %s" ,sim[0].solver.output_mode );
98  if (strcmp(sim[0].solver.output_mode,"serial")) printf(" [%d file IO rank(s)]\n",sim[0].mpi.N_IORanks );
99  else printf("\n");
100  printf(" Solution file format : %s\n" ,sim[0].solver.op_file_format );
101  printf(" Overwrite solution file : %s\n" ,sim[0].solver.op_overwrite );
102 #if defined(HAVE_CUDA)
103  printf(" Use GPU : %s\n" ,(sim[0].solver.use_gpu == 1)? "yes" : "no");
104  printf(" GPU device no : %d\n" ,(sim[0].solver.gpu_device_no));
105 #endif
106  printf(" Physical model : %s\n" ,sim[0].solver.model );
107  if (sim[0].solver.flag_ib) {
108  printf(" Immersed Body : %s\n" ,sim[0].solver.ib_filename );
109  }
110  }
111 
112  return 0;
113 }
#define _FORWARD_EULER_
MPI related function definitions.
int WriteInputs(void *, int, int)
Definition: WriteInputs.c:15
Simulation object.
Contains function declarations for time integration.
Structure defining a simulation.
Some basic definitions and macros.
int ndims
Definition: hypar.h:26