This file is the header file that controls data input and output. 更多...
函数 | |
| void | example_io (const char *example, char *add_mkdir, const int i_or_o) |
| This function produces folder path for data input or output. 更多... | |
| int | flu_var_count (FILE *fp, const char *add) |
| This function counts how many numbers are there in the initial data file. 更多... | |
| int | flu_var_count_line (FILE *fp, const char *add, int *n_x) |
| This function counts the line and column number of the numbers are there in the initial data file. 更多... | |
| int | flu_var_read (FILE *fp, double *U, const int num) |
| This function reads the initial data file to generate the initial data. 更多... | |
| struct flu_var | _1D_initialize (const char *name) |
| This function reads the 1-D initial data file of velocity/pressure/density. 更多... | |
| struct flu_var | _2D_initialize (const char *name) |
| This function reads the 2-D initial data file of velocity/pressure/density. 更多... | |
| void | _1D_file_write (const int m, const int N, const struct cell_var_stru CV, double *X[], const double *cpu_time, const char *name, const double *time_plot) |
| This function write the 1-D solution into output .dat files. 更多... | |
| void | _2D_file_write (const int n_x, const int n_y, const int N, const struct cell_var_stru CV[], double **X, double **Y, const double *cpu_time, const char *name, const double *time_plot) |
| This function write the 2-D solution into output .dat files. 更多... | |
| void | _2D_TEC_file_write (const int n_x, const int n_y, const int N, const struct cell_var_stru CV[], double **X, double **Y, const double *cpu_time, const char *problem, const double *time_plot) |
| This function write the 2-D solution into Tecplot output files. 更多... | |
| void | configurate (const char *name) |
| This function controls configuration data reading and validation. 更多... | |
| void | config_write (const char *add_out, const double *cpu_time, const char *name) |
This file is the header file that controls data input and output.
This header file declares functions in the folder 'file_io'.
在文件 file_io.h 中定义.
| void _1D_file_write | ( | const int | m, |
| const int | N, | ||
| const struct cell_var_stru | CV, | ||
| double * | X[], | ||
| const double * | cpu_time, | ||
| const char * | name, | ||
| const double * | time_plot | ||
| ) |
This function write the 1-D solution into output .dat files.
| [in] | m | The number of spatial points in the output data. |
| [in] | N | The number of time steps in the output data. |
| [in] | CV | Structure of grid variable data. |
| [in] | X[] | Array of the coordinate data. |
| [in] | cpu_time | Array of the CPU time recording. |
| [in] | name | Name of the numerical results. |
| [in] | time_plot | Array of the plotting time recording. |
在文件 _1D_file_out.c 第 50 行定义.
| struct flu_var _1D_initialize | ( | const char * | name | ) |
This function reads the 1-D initial data file of velocity/pressure/density.
The function initialize the extern pointer FV0.RHO/U/P pointing to the position of a block of memory consisting (m+1) variables* of type double. The value of first of these variables is m. The following m variables are the initial value.
| [in] | name | Name of the test example. |
在文件 _1D_file_in.c 第 70 行定义.
| void _2D_file_write | ( | const int | n_x, |
| const int | n_y, | ||
| const int | N, | ||
| const struct cell_var_stru | CV[], | ||
| double ** | X, | ||
| double ** | Y, | ||
| const double * | cpu_time, | ||
| const char * | name, | ||
| const double * | time_plot | ||
| ) |
This function write the 2-D solution into output .dat files.
| [in] | n_x | The number of x-spatial points in the output data. |
| [in] | n_y | The number of y-spatial points in the output data. |
| [in] | N | The number of time steps in the output data. |
| [in] | CV | Structure of grid variable data. |
| [in] | X | Array of the x-coordinate data. |
| [in] | Y | Array of the y-coordinate data. |
| [in] | cpu_time | Array of the CPU time recording. |
| [in] | name | Name of the numerical results. |
| [in] | time_plot | Array of the plotting time recording. |
在文件 _2D_file_out.c 第 56 行定义.
| struct flu_var _2D_initialize | ( | const char * | name | ) |
This function reads the 2-D initial data file of velocity/pressure/density.
The function initialize the extern pointer FV0.RHO/U/V/P pointing to the position of a block of memory consisting (line*column+2) variables* of type double. The value of first of these variables is (line) number; The value of second of these variables is (column) number; The following (line*column) variables are the initial value.
| [in] | name | Name of the test example. |
在文件 _2D_file_in.c 第 79 行定义.
| void _2D_TEC_file_write | ( | const int | n_x, |
| const int | n_y, | ||
| const int | N, | ||
| const struct cell_var_stru | CV[], | ||
| double ** | X, | ||
| double ** | Y, | ||
| const double * | cpu_time, | ||
| const char * | problem, | ||
| const double * | time_plot | ||
| ) |
This function write the 2-D solution into Tecplot output files.
| [in] | n_x | The number of x-spatial points in the output data. |
| [in] | n_y | The number of y-spatial points in the output data. |
| [in] | N | The number of time steps in the output data. |
| [in] | CV | Structure of grid variable data. |
| [in] | X | Array of the x-coordinate data. |
| [in] | Y | Array of the y-coordinate data. |
| [in] | cpu_time | Array of the CPU time recording. |
| [in] | problem | Name of the numerical results. |
| [in] | time_plot | Array of the plotting time recording. |
在文件 _2D_file_out.c 第 104 行定义.
| void config_write | ( | const char * | add_out, |
| const double * | cpu_time, | ||
| const char * | name | ||
| ) |
| void configurate | ( | const char * | add_in | ) |
This function controls configuration data reading and validation.
The parameters in the configuration data file refer to 'doc/config.csv'.
| [in] | add_in | Adress of the initial data folder of the test example. |
在文件 config_handle.c 第 191 行定义.
| void example_io | ( | const char * | example, |
| char * | add_mkdir, | ||
| const int | i_or_o | ||
| ) |
This function produces folder path for data input or output.
| [in] | example | Name of the test example/numerical results. |
| [out] | add_mkdir | Folder path for data input or output. |
| [in] | i_or_o | Conversion parameters for data input/output.
|
在文件 io_control.c 第 39 行定义.
| int flu_var_count | ( | FILE * | fp, |
| const char * | add | ||
| ) |
This function counts how many numbers are there in the initial data file.
| [in] | fp | The pointer to the input file. |
| [in] | add | The address of the input file. |
在文件 io_control.c 第 111 行定义.
| int flu_var_count_line | ( | FILE * | fp, |
| const char * | add, | ||
| int * | n_x | ||
| ) |
This function counts the line and column number of the numbers are there in the initial data file.
| [in] | fp | The pointer to the input file. |
| [in] | add | The address of the input file. |
| [out] | n_x | The colume number of the numbers in the initial data file. |
在文件 io_control.c 第 150 行定义.
| int flu_var_read | ( | FILE * | fp, |
| double * | U, | ||
| const int | num | ||
| ) |
This function reads the initial data file to generate the initial data.
| [in] | fp | The pointer to the input file. |
| [out] | U | The pointer to the data array of fluid variables. |
| [in] | num | The number of the numbers in the input file. |
在文件 io_control.c 第 208 行定义.