Skip to content

Commit 42d6370

Browse files
authored
REFAC: rename data type QWVgrid and INTEGgrid (#166)
1 parent a475085 commit 42d6370

File tree

21 files changed

+133
-132
lines changed

21 files changed

+133
-132
lines changed

pygrt/C_extension/include/grt/common/const.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ typedef double complex cplx_t;
123123

124124
#define GRT_GTYPES_MAX 2 ///< 2, 所有震源根据是否使用格林函数导数分为两类
125125

126-
typedef cplx_t QWVgrid[GRT_SRC_M_NUM][GRT_QWV_NUM];
127-
typedef cplx_t INTEGgrid[GRT_SRC_M_NUM][GRT_INTEG_NUM];
128-
typedef real_t r_INTEGgrid[GRT_SRC_M_NUM][GRT_INTEG_NUM];
129-
typedef size_t s_INTEGgrid[GRT_SRC_M_NUM][GRT_INTEG_NUM];
126+
typedef cplx_t cplxQWVGrid[GRT_SRC_M_NUM][GRT_QWV_NUM];
127+
128+
typedef cplx_t cplxIntegGrid[GRT_SRC_M_NUM][GRT_INTEG_NUM];
129+
typedef real_t realIntegGrid[GRT_SRC_M_NUM][GRT_INTEG_NUM];
130+
typedef size_t sizeIntegGrid[GRT_SRC_M_NUM][GRT_INTEG_NUM];
130131

131132
/** 不同震源类型在大小为 GRT_SRC_M_NUM 的数组中的索引 */
132133
enum {

pygrt/C_extension/include/grt/common/dwm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
real_t grt_discrete_integ(
4545
GRT_MODEL1D *mod1d, real_t dk, real_t kmax, real_t keps,
4646
size_t nr, real_t *rs,
47-
INTEGgrid sum_J[nr],
47+
cplxIntegGrid sum_J[nr],
4848
bool calc_upar,
49-
INTEGgrid sum_uiz_J[nr],
50-
INTEGgrid sum_uir_J[nr],
49+
cplxIntegGrid sum_uiz_J[nr],
50+
cplxIntegGrid sum_uir_J[nr],
5151
FILE *fstats, GRT_KernelFunc kerfunc);

pygrt/C_extension/include/grt/common/fim.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
real_t grt_linear_filon_integ(
5252
GRT_MODEL1D *mod1d, real_t k0, real_t dk0, real_t filondk, real_t kmax, real_t keps,
5353
size_t nr, real_t *rs,
54-
INTEGgrid sum_J[nr],
54+
cplxIntegGrid sum_J[nr],
5555
bool calc_upar,
56-
INTEGgrid sum_uiz_J[nr],
57-
INTEGgrid sum_uir_J[nr],
56+
cplxIntegGrid sum_uiz_J[nr],
57+
cplxIntegGrid sum_uir_J[nr],
5858
FILE *fstats, GRT_KernelFunc kerfunc);
5959

6060

pygrt/C_extension/include/grt/common/integral.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @param[out] SUM 该dk区间内的积分值
2525
*
2626
*/
27-
void grt_int_Pk(real_t k, real_t r, const QWVgrid QWV, bool calc_uir, INTEGgrid SUM);
27+
void grt_int_Pk(real_t k, real_t r, const cplxQWVGrid QWV, bool calc_uir, cplxIntegGrid SUM);
2828

2929

3030

@@ -35,7 +35,7 @@ void grt_int_Pk(real_t k, real_t r, const QWVgrid QWV, bool calc_uir, INTEGgrid
3535
* @param[in] sum_J 积分结果
3636
* @param[out] tol Z、R、T分量结果
3737
*/
38-
void grt_merge_Pk(const INTEGgrid sum_J, cplx_t tol[GRT_SRC_M_NUM][GRT_CHANNEL_NUM]);
38+
void grt_merge_Pk(const cplxIntegGrid sum_J, cplx_t tol[GRT_SRC_M_NUM][GRT_CHANNEL_NUM]);
3939

4040

4141

@@ -53,7 +53,7 @@ void grt_merge_Pk(const INTEGgrid sum_J, cplx_t tol[GRT_SRC_M_NUM][GRT_CHANNEL_N
5353
* @param[out] SUM 该dk区间内的积分值
5454
*
5555
*/
56-
void grt_int_Pk_filon(real_t k, real_t r, bool iscos, const QWVgrid QWV, bool calc_uir, INTEGgrid SUM);
56+
void grt_int_Pk_filon(real_t k, real_t r, bool iscos, const cplxQWVGrid QWV, bool calc_uir, cplxIntegGrid SUM);
5757

5858

5959
/**
@@ -68,4 +68,4 @@ void grt_int_Pk_filon(real_t k, real_t r, bool iscos, const QWVgrid QWV, bool ca
6868
* @param[out] SUM 该三点区间内的积分值
6969
*
7070
*/
71-
void grt_int_Pk_sa_filon(const real_t k3[3], real_t r, const QWVgrid QWV3[3], bool calc_uir, INTEGgrid SUM);
71+
void grt_int_Pk_sa_filon(const real_t k3[3], real_t r, const cplxQWVGrid QWV3[3], bool calc_uir, cplxIntegGrid SUM);

pygrt/C_extension/include/grt/common/iostats.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @note 文件记录的值均为波数积分的中间结果,与最终的结果还差一系列的系数,
2727
* 记录其值主要用于参考其变化趋势。
2828
*/
29-
void grt_write_stats(FILE *f0, real_t k, const QWVgrid QWV);
29+
void grt_write_stats(FILE *f0, real_t k, const cplxQWVGrid QWV);
3030

3131

3232
/**
@@ -54,8 +54,8 @@ int grt_extract_stats(FILE *bf0, FILE *af0);
5454
*/
5555
void grt_write_stats_ptam(
5656
FILE *f0,
57-
r_INTEGgrid Kpt[GRT_PTAM_PT_MAX],
58-
INTEGgrid Fpt[GRT_PTAM_PT_MAX]);
57+
realIntegGrid Kpt[GRT_PTAM_PT_MAX],
58+
cplxIntegGrid Fpt[GRT_PTAM_PT_MAX]);
5959

6060

6161
/**

pygrt/C_extension/include/grt/common/kernel.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* 计算核函数的函数指针,动态与静态的接口一致
1717
*/
1818
typedef void (*GRT_KernelFunc) (
19-
GRT_MODEL1D *mod1d, const real_t k, QWVgrid QWV,
20-
bool calc_uiz, QWVgrid QWV_uiz);
19+
GRT_MODEL1D *mod1d, const real_t k, cplxQWVGrid QWV,
20+
bool calc_uiz, cplxQWVGrid QWV_uiz);
2121

2222

2323
/**
@@ -89,26 +89,26 @@ typedef void (*GRT_KernelFunc) (
8989
*
9090
*/
9191
void grt_kernel(
92-
GRT_MODEL1D *mod1d, const real_t k, QWVgrid QWV,
93-
bool calc_uiz, QWVgrid QWV_uiz);
92+
GRT_MODEL1D *mod1d, const real_t k, cplxQWVGrid QWV,
93+
bool calc_uiz, cplxQWVGrid QWV_uiz);
9494

9595
/** 构建广义反射透射系数矩阵。作为 kernel 函数中的第一部分 */
9696
void grt_GRT_matrix(GRT_MODEL1D *mod1d, const real_t k);
9797

9898
/** 从广义 R/T 矩阵出发,计算每个震源对应的核函数 QWV。 作为 kernel 函数中的第二部分 */
9999
void grt_GRT_build_QWV(
100-
GRT_MODEL1D *mod1d, QWVgrid QWV,
101-
bool calc_uiz, QWVgrid QWV_uiz);
100+
GRT_MODEL1D *mod1d, cplxQWVGrid QWV,
101+
bool calc_uiz, cplxQWVGrid QWV_uiz);
102102

103103
/** 静态解的核函数 */
104104
void grt_static_kernel(
105-
GRT_MODEL1D *mod1d, const real_t k, QWVgrid QWV,
106-
bool calc_uiz, QWVgrid QWV_uiz);
105+
GRT_MODEL1D *mod1d, const real_t k, cplxQWVGrid QWV,
106+
bool calc_uiz, cplxQWVGrid QWV_uiz);
107107

108108
/** 静态广义反射透射系数矩阵 */
109109
void grt_static_GRT_matrix(GRT_MODEL1D *mod1d, const real_t k);
110110

111111
/** 静态 QWV */
112112
void grt_static_GRT_build_QWV(
113-
GRT_MODEL1D *mod1d, QWVgrid QWV,
114-
bool calc_uiz, QWVgrid QWV_uiz);
113+
GRT_MODEL1D *mod1d, cplxQWVGrid QWV,
114+
bool calc_uiz, cplxQWVGrid QWV_uiz);

pygrt/C_extension/include/grt/common/model.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ typedef struct {
6868
cplx_t uiz_R_EVL;
6969

7070
/* 震源处的震源系数 \f$ P_m, SV_m, SH_m */
71-
QWVgrid src_coefD;
72-
QWVgrid src_coefU;
71+
cplxQWVGrid src_coefD;
72+
cplxQWVGrid src_coefU;
7373

7474
} GRT_MODEL1D;
7575

pygrt/C_extension/include/grt/common/ptam.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
void grt_PTA_method(
4848
GRT_MODEL1D *mod1d, real_t k0, real_t predk,
4949
size_t nr, real_t *rs,
50-
INTEGgrid sum_J0[nr],
50+
cplxIntegGrid sum_J0[nr],
5151
bool calc_upar,
52-
INTEGgrid sum_uiz_J0[nr],
53-
INTEGgrid sum_uir_J0[nr],
52+
cplxIntegGrid sum_uiz_J0[nr],
53+
cplxIntegGrid sum_uir_J0[nr],
5454
FILE *ptam_fstatsnr[nr][2], GRT_KernelFunc kerfunc);
5555

pygrt/C_extension/include/grt/common/safim.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
real_t grt_sa_filon_integ(
5353
GRT_MODEL1D *mod1d, real_t k0, real_t dk0, real_t tol, real_t kmax, real_t kref,
5454
size_t nr, real_t *rs,
55-
INTEGgrid sum_J0[nr],
55+
cplxIntegGrid sum_J0[nr],
5656
bool calc_upar,
57-
INTEGgrid sum_uiz_J0[nr],
58-
INTEGgrid sum_uir_J0[nr],
57+
cplxIntegGrid sum_uiz_J0[nr],
58+
cplxIntegGrid sum_uir_J0[nr],
5959
FILE *fstats, GRT_KernelFunc kerfunc);
6060

6161

pygrt/C_extension/src/common/dwm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
real_t grt_discrete_integ(
2828
GRT_MODEL1D *mod1d, real_t dk, real_t kmax, real_t keps,
2929
size_t nr, real_t *rs,
30-
INTEGgrid sum_J[nr],
30+
cplxIntegGrid sum_J[nr],
3131
bool calc_upar,
32-
INTEGgrid sum_uiz_J[nr],
33-
INTEGgrid sum_uir_J[nr],
32+
cplxIntegGrid sum_uiz_J[nr],
33+
cplxIntegGrid sum_uir_J[nr],
3434
FILE *fstats, GRT_KernelFunc kerfunc)
3535
{
36-
INTEGgrid SUM = {0};
36+
cplxIntegGrid SUM = {0};
3737

3838
// 不同震源不同阶数的核函数 F(k, w)
39-
QWVgrid QWV = {0};
40-
QWVgrid QWV_uiz = {0};
39+
cplxQWVGrid QWV = {0};
40+
cplxQWVGrid QWV_uiz = {0};
4141

4242
real_t k = 0.0;
4343
size_t ik = 0;

0 commit comments

Comments
 (0)