HydroCODE_2D 0.1
This is a implementation of fully explict forward Euler scheme for 2-D Euler equations of motion on Eulerian coordinate
file_io.h 文件参考

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 中定义.

函数说明

◆ _1D_file_write()

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.

注解
It is quite simple so there will be no more comments.
参数
[in]mThe number of spatial points in the output data.
[in]NThe number of time steps in the output data.
[in]CVStructure of grid variable data.
[in]X[]Array of the coordinate data.
[in]cpu_timeArray of the CPU time recording.
[in]nameName of the numerical results.
[in]time_plotArray of the plotting time recording.

在文件 _1D_file_out.c50 行定义.

函数调用图:

◆ _1D_initialize()

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]nameName of the test example.
返回
FV0: Structure of initial data array pointer.

在文件 _1D_file_in.c70 行定义.

函数调用图:

◆ _2D_file_write()

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.

注解
It is quite simple so there will be no more comments.
参数
[in]n_xThe number of x-spatial points in the output data.
[in]n_yThe number of y-spatial points in the output data.
[in]NThe number of time steps in the output data.
[in]CVStructure of grid variable data.
[in]XArray of the x-coordinate data.
[in]YArray of the y-coordinate data.
[in]cpu_timeArray of the CPU time recording.
[in]nameName of the numerical results.
[in]time_plotArray of the plotting time recording.

在文件 _2D_file_out.c56 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ _2D_initialize()

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]nameName of the test example.
返回
FV0: Structure of initial data array pointer.

在文件 _2D_file_in.c79 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ _2D_TEC_file_write()

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_xThe number of x-spatial points in the output data.
[in]n_yThe number of y-spatial points in the output data.
[in]NThe number of time steps in the output data.
[in]CVStructure of grid variable data.
[in]XArray of the x-coordinate data.
[in]YArray of the y-coordinate data.
[in]cpu_timeArray of the CPU time recording.
[in]problemName of the numerical results.
[in]time_plotArray of the plotting time recording.

在文件 _2D_file_out.c104 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ config_write()

void config_write ( const char *  add_out,
const double *  cpu_time,
const char *  name 
)

在文件 config_handle.c224 行定义.

这是这个函数的调用关系图:

◆ configurate()

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_inAdress of the initial data folder of the test example.

在文件 config_handle.c191 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ example_io()

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]exampleName of the test example/numerical results.
[out]add_mkdirFolder path for data input or output.
[in]i_or_oConversion parameters for data input/output.
  • 0: data output.
  • else (e.g. 1): data input.

在文件 io_control.c39 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ flu_var_count()

int flu_var_count ( FILE *  fp,
const char *  add 
)

This function counts how many numbers are there in the initial data file.

参数
[in]fpThe pointer to the input file.
[in]addThe address of the input file.
返回
num: The number of the numbers in the initial data file.

在文件 io_control.c111 行定义.

◆ flu_var_count_line()

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]fpThe pointer to the input file.
[in]addThe address of the input file.
[out]n_xThe colume number of the numbers in the initial data file.
返回
line: The line number of the numbers in the initial data file.

在文件 io_control.c150 行定义.

◆ flu_var_read()

int flu_var_read ( FILE *  fp,
double *  U,
const int  num 
)

This function reads the initial data file to generate the initial data.

参数
[in]fpThe pointer to the input file.
[out]UThe pointer to the data array of fluid variables.
[in]numThe number of the numbers in the input file.
返回
It returns 0 if successfully read the file, while returns the index of the wrong entry.

在文件 io_control.c208 行定义.