12#include "../include/var_struc.h"
13#include "../include/file_io.h"
19#define PRINT_NC(v, v_print) \
21 strcpy(file_data, add_out); \
22 strcat(file_data, #v); \
23 strcat(file_data, ".dat"); \
24 if((fp_write = fopen(file_data, "w")) == NULL) \
26 printf("Cannot open solution output file: %s!\n", #v); \
29 for(k = 0; k < N; ++k) \
31 for(j = 0; j < m; ++j) \
32 fprintf(fp_write, "%.10g\t", (v_print)); \
33 fprintf(fp_write, "\n"); \
50 double * X[],
const double * cpu_time,
const char * problem,
const double time_plot[])
61 char add_out[FILENAME_MAX+40];
65 char file_data[FILENAME_MAX+40];
78 PRINT_NC(X, 0.5 * (X[k][j] + X[k][j+1]));
81 strcpy(file_data, add_out);
82 strcat(file_data,
"time_plot.dat");
83 printf(
"%s\n",file_data);
84 if((fp_write = fopen(file_data,
"w")) == NULL)
86 printf(
"Cannot open solution output file: time_plot!\n");
89 for(k = 0; k < N; ++k)
90 fprintf(fp_write,
"%.10g\n", time_plot[k]);
void config_write(const char *add_out, const double *cpu_time, const char *name)
This function write configuration data and program record into the file 'log.dat'.
void file_1D_write(const int m, const int N, const struct cell_var_stru CV, double *X[], const double *cpu_time, const char *problem, const double time_plot[])
This function write the 1-D solution into output '.dat' files.
#define PRINT_NC(v, v_print)
Print out fluid variable 'v' with array data element 'v_print'.
void example_io(const char *example, char *add_mkdir, const int i_or_o)
This function produces folder path for data input or output.
pointer structure of VARiables on STRUctural computational grid CELLs.
double ** E
specific total energy.
double ** P
density, velocity components in direction x and y, pressure.