HydroCODE_1D 0.1
This is a implementation of fully explict forward Euler scheme for 1-D Euler equations of motion on Lagrangian/Eulerian coordinate
io_control.c 文件参考

This is a set of common functions which control the input/output data. 更多...

#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <ctype.h>
#include "../include/var_struc.h"
#include "../include/tools.h"
io_control.c 的引用(Include)关系图:

浏览源代码.

函数

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. 更多...
 
static int compare_double (const void *a, const void *b)
 Compare function of double for sort function 'qsort()'. 更多...
 
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[]'. 更多...
 

详细描述

This is a set of common functions which control the input/output data.

在文件 io_control.c 中定义.

函数说明

◆ compare_double()

static int compare_double ( const void *  a,
const void *  b 
)
static

Compare function of double for sort function 'qsort()'.

在文件 io_control.c267 行定义.

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

◆ 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.
  • 1(non-0 value): data input.

在文件 io_control.c40 行定义.

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

◆ 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.c124 行定义.

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

◆ 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.c163 行定义.

◆ 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.c221 行定义.

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

◆ time_plot_read()

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_inAdress of the initial data folder of the test example.
[in]N_maxThe maximum number of data dimension storing fluid variables in memory.
[out]N_plotPointer to the number of time steps for plotting.
[out]time_plotPointer to the array of the plotting time recording.
返回
It returns the proper number of data dimension storing fluid variables in memory.

在文件 io_control.c288 行定义.

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