Writes out the errors and other data for each simulation.
30 if (nsims > 1) printf(
"\n");
32 for (n = 0; n < nsims; n++) {
37 strcpy(err_fname,
"errors");
38 strcpy(cons_fname,
"conservation");
39 strcpy(fc_fname,
"function_counts");
42 strcpy(rom_diff_fname,
"pde_rom_diff");
48 strcat(err_fname,
"_");
49 strcat(cons_fname,
"_");
52 strcat(rom_diff_fname,
"_");
58 strcat(err_fname,index);
59 strcat(cons_fname,index);
60 strcat(fc_fname,index);
62 strcat(rom_diff_fname,index);
66 strcat(err_fname,
".dat");
67 strcat(cons_fname,
".dat");
68 strcat(fc_fname,
".dat");
70 strcat(rom_diff_fname,
".dat");
75 out = fopen(err_fname,
"w");
76 for (
int d=0; d<sim[n].
solver.
ndims; d++) fprintf(out,
"%4d ",sim[n].solver.dim_global[d]);
77 for (
int d=0; d<sim[n].
solver.
ndims; d++) fprintf(out,
"%4d ",sim[n].mpi.iproc[d]);
78 fprintf(out,
"%1.16E ",sim[n].solver.dt);
80 fprintf(out,
"%1.16E %1.16E\n",solver_runtime,main_runtime);
83 out = fopen(cons_fname,
"w");
84 for (
int d=0; d<sim[n].
solver.
ndims; d++) fprintf(out,
"%4d ",sim[n].solver.dim_global[d]);
85 for (
int d=0; d<sim[n].
solver.
ndims; d++) fprintf(out,
"%4d ",sim[n].mpi.iproc[d]);
86 fprintf(out,
"%1.16E ",sim[n].solver.dt);
87 for (
int d=0; d<sim[n].
solver.
nvars; d++) fprintf(out,
"%1.16E ",sim[n].solver.ConservationError[d]);
91 out = fopen(fc_fname,
"w");
92 fprintf(out,
"%d\n",sim[n].solver.n_iter);
93 fprintf(out,
"%d\n",sim[n].solver.count_hyp);
94 fprintf(out,
"%d\n",sim[n].solver.count_par);
95 fprintf(out,
"%d\n",sim[n].solver.count_sou);
97 fprintf(out,
"%d\n",sim[n].solver.count_RHSFunction);
98 fprintf(out,
"%d\n",sim[n].solver.count_IFunction);
99 fprintf(out,
"%d\n",sim[n].solver.count_IJacobian);
100 fprintf(out,
"%d\n",sim[n].solver.count_IJacFunction);
105 if (sim[n].solver.rom_diff_norms[0] >= 0) {
106 out = fopen(rom_diff_fname,
"w");
107 for (
int d=0; d<sim[n].
solver.
ndims; d++) fprintf(out,
"%4d ",sim[n].solver.dim_global[d]);
108 for (
int d=0; d<sim[n].
solver.
ndims; d++) fprintf(out,
"%4d ",sim[n].mpi.iproc[d]);
109 fprintf(out,
"%1.16E ",sim[n].solver.dt);
111 fprintf(out,
"%1.16E %1.16E\n",solver_runtime,main_runtime);
117 if (sim[n].solver.error[0] >= 0) {
118 printf(
"Computed errors for domain %d:\n", n);
119 printf(
" L1 Error : %1.16E\n",sim[n].solver.error[0]);
120 printf(
" L2 Error : %1.16E\n",sim[n].solver.error[1]);
121 printf(
" Linfinity Error : %1.16E\n",sim[n].solver.error[2]);
123 if (!strcmp(sim[n].solver.ConservationCheck,
"yes")) {
124 printf(
"Conservation Errors:\n");
125 for (
int d=0; d<sim[n].
solver.
nvars; d++) printf(
"\t%1.16E\n",sim[n].solver.ConservationError[d]);
128 if (sim[n].solver.rom_diff_norms[0] >= 0) {
129 printf(
"Norms of the diff between ROM and PDE solutions for domain %d:\n", n);
130 printf(
" L1 Norm : %1.16E\n",sim[n].solver.rom_diff_norms[0]);
131 printf(
" L2 Norm : %1.16E\n",sim[n].solver.rom_diff_norms[1]);
132 printf(
" Linfinity Norm : %1.16E\n",sim[n].solver.rom_diff_norms[2]);
138 printf(
"Solver runtime (in seconds): %1.16E\n",solver_runtime);
139 printf(
"Total runtime (in seconds): %1.16E\n",main_runtime);
140 if (nsims > 1) printf(
"\n");
void GetStringFromInteger(int, char *, int)
#define _MAX_STRING_SIZE_
Structure defining a simulation.