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. 更多... | |
int | time_plot_read (const char *add_in, const int N_max, int *N_plot, double *time_plot[]) |
This function reads the time data file for plotting 'time_plot.dat' and initialize tha array 'time_plot[]'. 更多... | |
void | arg_preprocess (const int argc_least, const int argc, char *argv[], char *scheme) |
This is a functions preprocesses ARGuments. 更多... | |
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 function write configuration data and program record into the file 'log.dat'. 更多... | |
struct flu_var | initialize_1D (const char *name, int *N, int *N_plot, double *time_plot[]) |
struct flu_var | initialize_2D (const char *name, int *N, int *N_plot, double *time_plot[]) |
This function reads the 2-D initial data file of density/velocity/pressure. 更多... | |
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[]) |
void | file_2D_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 output '.dat' files. 更多... | |
void | file_2D_write_POINT_TEC (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 with point data. 更多... | |
void | file_1D_write_HDF5 (const int m, const int N, const struct cell_var_stru CV, double *X[], const double *cpu_time, const char *problem, double time_plot[]) |
This function write the 1-D solution into HDF5 output '.h5' files. 更多... | |
void | file_2D_write_HDF5 (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, double time_plot[]) |
This function write the 2-D solution into HDF5 output '.h5' files. 更多... | |
void | file_radial_write_TEC (const struct flu_var FV, const double *R, const char *problem, const double time) |
void | file_write_2D_BLOCK_TEC (const struct flu_var FV, const struct mesh_var mv, const char *problem, const double time) |
void | file_write_3D_VTK (const struct flu_var FV, const struct mesh_var mv, const char *problem, const double time) |
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 arg_preprocess | ( | const int | argc_least, |
const int | argc, | ||
char * | argv[], | ||
char * | scheme | ||
) |
This is a functions preprocesses ARGuments.
This function prints out all ARGuments, checks for the right ARGument Counter, loads argv[3], argv[4] and argv[argc_least+1,argc_least+2,…] as configuration, and puts the scheme name into the pointer 'scheme'.
[in] | argc_least | The least value of the ARGument Counter. |
[in] | argc | ARGument Counter. |
[in] | argv | ARGument Values. |
[in] | scheme | Scheme name.
|
在文件 terminal_io.c 第 26 行定义.
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'.
The parameters in the log file refer to 'doc/config.csv'.
[in] | add_out | Address of the output data folder of the test example. |
[in] | cpu_time | Array of the CPU time recording. |
[in] | name | Name of the test example. |
在文件 config_handle.c 第 253 行定义.
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 第 208 行定义.
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 第 40 行定义.
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[] | ||
) |
void file_1D_write_HDF5 | ( | const int | m, |
const int | N, | ||
const struct cell_var_stru | CV, | ||
double * | X[], | ||
const double * | cpu_time, | ||
const char * | problem, | ||
double | time_plot[] | ||
) |
This function write the 1-D solution into HDF5 output '.h5' 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 computational grid cells. |
[in] | X[] | Array of the coordinate data. |
[in] | cpu_time | Array of the CPU time recording. |
[in] | problem | Name of the numerical results for the test problem. |
[in] | time_plot | Array of the plotting time recording. |
在文件 file_out_hdf5.c 第 54 行定义.
void file_2D_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 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 variable data in computational grid cells. |
[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 for the test problem. |
[in] | time_plot | Array of the plotting time recording. |
在文件 file_2D_out.c 第 55 行定义.
void file_2D_write_HDF5 | ( | 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, | ||
double | time_plot[] | ||
) |
This function write the 2-D solution into HDF5 output '.h5' 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 variable data in computational grid cells. |
[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 for the test problem. |
[in] | time_plot | Array of the plotting time recording. |
在文件 file_out_hdf5.c 第 162 行定义.
void file_2D_write_POINT_TEC | ( | 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 with point data.
[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 variable data in computational grid cells. |
[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. |
在文件 file_2D_out.c 第 103 行定义.
void file_radial_write_TEC | ( | const struct flu_var | FV, |
const double * | R, | ||
const char * | problem, | ||
const double | time | ||
) |
void file_write_2D_BLOCK_TEC | ( | const struct flu_var | FV, |
const struct mesh_var | mv, | ||
const char * | problem, | ||
const double | time | ||
) |
void file_write_3D_VTK | ( | const struct flu_var | FV, |
const struct mesh_var | mv, | ||
const char * | problem, | ||
const double | time | ||
) |
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 第 124 行定义.
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 第 163 行定义.
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 第 221 行定义.
struct flu_var initialize_1D | ( | const char * | name, |
int * | N, | ||
int * | N_plot, | ||
double * | time_plot[] | ||
) |
struct flu_var initialize_2D | ( | const char * | name, |
int * | N, | ||
int * | N_plot, | ||
double * | time_plot[] | ||
) |
This function reads the 2-D initial data file of density/velocity/pressure.
The function initialize the extern pointer FV0.RHO/U/V/P pointing to the position of a block of memory consisting (line*column) variables* of type double. These (line*column) variables are the initial value.
[in] | name | Name of the test example. |
[in] | N | Pointer to the number of 2-D data dimension storing fluid variables in memory. |
[out] | N_plot | Pointer to the number of time steps for plotting. |
[out] | time_plot | Pointer to the array of the plotting time recording. |
在文件 file_2D_in.c 第 119 行定义.
int time_plot_read | ( | const char * | add_in, |
const int | N_max, | ||
int * | N_plot, | ||
double * | time_plot[] | ||
) |
This function reads the time data file for plotting 'time_plot.dat' and initialize tha array 'time_plot[]'.
[in] | add_in | Adress of the initial data folder of the test example. |
[in] | N_max | The maximum number of data dimension storing fluid variables in memory. |
[out] | N_plot | Pointer to the number of time steps for plotting. |
[out] | time_plot | Pointer to the array of the plotting time recording. |
在文件 io_control.c 第 288 行定义.