Skip to content

Commit 67a8402

Browse files
author
nianhuawong
committed
改格式。
1 parent 31ac068 commit 67a8402

File tree

2 files changed

+45
-40
lines changed

2 files changed

+45
-40
lines changed

include/Global.h

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
#include <ctime>
55
using namespace std;
66

7-
#define IR 0
8-
#define IU 1
9-
#define IV 2
10-
#define IP 3
11-
#define SMALL 1E-40
12-
#define PI 3.141592653589793238
7+
#define IR 0
8+
#define IU 1
9+
#define IV 2
10+
#define IP 3
11+
12+
#define SMALL 1E-40
13+
#define PI 3.141592653589793238
1314

1415
typedef vector < int > VInt;
1516
typedef vector < VInt > VInt2D;
@@ -19,23 +20,23 @@ typedef vector < double > VDouble;
1920
typedef vector < VDouble > VDouble2D;
2021
typedef vector < VDouble2D > VDouble3D;
2122

22-
extern int num_of_prim_vars;
23-
extern int current_step, max_num_of_steps;
24-
extern double cfl_num, time_step, physical_time, max_simu_time;
25-
extern int method_of_half_q;
26-
extern int method_of_limiter;
27-
extern int method_of_flux;
28-
extern double muscl_k;
29-
extern double entropy_fix_coeff;
30-
extern char solve_direction;
31-
extern int residual_output_steps;
32-
extern int flow_save_steps;
33-
extern double converge_criterion;
34-
extern bool stop_by_residual;
35-
extern string tec_file_name;
36-
extern int num_of_RK_stages;
37-
extern VDouble2D RK_Coeff;
38-
extern clock_t lastTime, nowTime;
23+
extern int num_of_prim_vars;
24+
extern int current_step, max_num_of_steps;
25+
extern double cfl_num, time_step, physical_time, max_simu_time;
26+
extern int method_of_half_q;
27+
extern int method_of_limiter;
28+
extern int method_of_flux;
29+
extern double muscl_k;
30+
extern double entropy_fix_coeff;
31+
extern char solve_direction;
32+
extern int residual_output_steps;
33+
extern int flow_save_steps;
34+
extern double converge_criterion;
35+
extern bool stop_by_residual;
36+
extern string tec_file_name;
37+
extern int num_of_RK_stages;
38+
extern VDouble2D RK_Coeff;
39+
extern clock_t lastTime, nowTime;
3940

4041
template < typename T >
4142
void Allocate_2D_Vector(vector< vector< T > >& array, int dim1, int dim2)
@@ -90,10 +91,12 @@ void MatrixMultiply(vector< vector< T1 > >& a, vector< T2 >& b, vector< T3 >& c,
9091

9192
void Primitive_To_Conservative(VDouble& primitive, VDouble& conservative);
9293
void Conservative_To_Primitive(VDouble& conservative, VDouble& primitive);
94+
9395
bool Need_Stop_Iteration();
9496
bool IsNaN(VDouble& data);
9597

9698
clock_t Get_Current_Time();
9799
double GetClockTicksPerSecond();
100+
98101
void ExtractValue(VDouble primitiveVector, double& rm, double& um, double& vm, double& pm);
99102
void Read_Parameter_File(string fileName);

src/Global.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
#include <sys/times.h>
1212
#endif
1313

14-
int num_of_prim_vars;
15-
int current_step, max_num_of_steps;
16-
double cfl_num, time_step, physical_time, max_simu_time;
17-
int method_of_half_q;
18-
int method_of_limiter;
19-
int method_of_flux;
20-
double muscl_k;
21-
double entropy_fix_coeff;
22-
char solve_direction;
23-
int residual_output_steps;
24-
int flow_save_steps;
25-
double converge_criterion;
26-
string tec_file_name;
27-
int num_of_RK_stages;
28-
VDouble2D RK_Coeff;
29-
clock_t lastTime, nowTime;
14+
int num_of_prim_vars;
15+
int current_step, max_num_of_steps;
16+
double cfl_num, time_step, physical_time, max_simu_time;
17+
int method_of_half_q;
18+
int method_of_limiter;
19+
int method_of_flux;
20+
double muscl_k;
21+
double entropy_fix_coeff;
22+
char solve_direction;
23+
int residual_output_steps;
24+
int flow_save_steps;
25+
double converge_criterion;
26+
string tec_file_name;
27+
int num_of_RK_stages;
28+
VDouble2D RK_Coeff;
29+
clock_t lastTime, nowTime;
3030

3131
void Init_Global_Param()
3232
{
@@ -65,7 +65,9 @@ void Init_Global_Param()
6565
entropy_fix_coeff = 0.001; //Roe格式熵修正系数epsilon
6666
//==============================================================================================
6767

68-
Read_Parameter_File("./input.txt");
68+
#ifndef _WIN32
69+
Read_Parameter_File("./input.txt"); //在集群上计算时,可通过参数文件设置参数
70+
#endif // !_WIN32
6971
}
7072

7173
void Load_Q()

0 commit comments

Comments
 (0)