HydroCODE_2D 0.1
This is a implementation of fully explict forward Euler scheme for 2-D Euler equations of motion on Eulerian coordinate
tools.h
浏览该文件的文档.
1
7#ifndef TOOLS_H
8#define TOOLS_H
9
10// sys_pro.c
11void DispPro(const double pro, const int step);
12
13int CreateDir(const char* pPath);
14
15
16// math_algo.c
17int rinv(double a[], const int n);
18
19
23inline double minmod2(const double s_L, const double s_R)
24{
25 if(s_L * s_R <= 0.0)
26 return 0.0;
27 else if(s_R > 0.0 && s_R < s_L)
28 return s_R;
29 else if(s_R <= 0.0 && s_R > s_L)
30 return s_R;
31 else // fabs(s_R) > fabs(s_L)
32 return s_L;
33}
34
38inline double minmod3(const double s_L, const double s_R, const double s_m)
39{
40 if(s_L * s_m <= 0.0 || s_R * s_m <= 0.0)
41 return 0.0;
42 else if(s_m > 0.0 && s_m < s_L && s_m < s_R)
43 return s_m;
44 else if(s_m <= 0.0 && s_m > s_L && s_m > s_R)
45 return s_m;
46 else if(s_R > 0.0 && s_R < s_L)
47 return s_R;
48 else if(s_R <= 0.0 && s_R > s_L)
49 return s_R;
50 else
51 return s_L;
52}
53
54#endif
int rinv(double a[], const int n)
A function to caculate the inverse of the input square matrix.
Definition: math_algo.c:19
int CreateDir(const char *pPath)
This is a function that recursively creates folders.
Definition: sys_pro.c:57
double minmod2(const double s_L, const double s_R)
Minmod limiter function of two variables.
Definition: tools.h:23
double minmod3(const double s_L, const double s_R, const double s_m)
Minmod limiter function of three variables.
Definition: tools.h:38
void DispPro(const double pro, const int step)
This function print a progress bar on one line of standard output.
Definition: sys_pro.c:36