waterPMLコマンドのソースコードの概略

(1)関数TF_calculate_V, TF_calculate_T

(Outline of the source code of waterPML command; (1) Functions TF_calculate_V and TF_calculate_T)


◆概要 (Outline)



◆関数のプロトタイプ (Prototypes of the functions)

関数TF_calculate_V, TF_calculate_Tのプロトタイプは以下のようになる。
The prototypes of the functions TF_calculate_V and TF_calculate_T are as follows.

inline void TF_calculate_V
(const struct grid stg,const struct waterPML_parameters parameters,
 int ∗Nigv,int ∗∗igv2ig,const int it,
 char ∗∗type, double ∗∗c0,double ∗∗c1, double ∗∗∗T,double ∗∗∗f,
 struct sequence ∗stfun,double ∗∗∗V)

inline void TF_calculate_T
(const struct grid stg,const struct waterPML_parameters parameters,
 int ∗Nigt,int ∗∗igt2ig,char ∗∗type, double ∗∗c0,double ∗∗c2,
 double ∗∗∗V,double ∗∗∗T)

一見して引数が多く複雑に見えるが、 本質的な引数はVとT であり、これらはそれぞれ速度場と応力場を表す。 関数の呼び出し前後において、これらの引数は具体的に下記の時刻での 速度場と応力場を表す。
Although the functions have many arguments, most essential arguments are V and T , which represent the velocity and stress fields, respectively. Before and after the function call, these arguments represent the velocity and stress fields at the times shown in the table below.

●関数TF_calculate_Vの引数 (Arguments in function TF_calculate_V)

引数
Argument
関数呼び出し前
Before the function call
関数呼び出し後
After the function call
V 時刻tΔtにおける速度場
Velocity field at time tΔt
時刻tにおける速度場
Velocity field at time t
T 時刻tΔt/2における応力場
Stress field at time tΔt/2

●関数TF_calculate_Tの引数 (Arguments in function TF_calculate_T)

引数
Argument
関数呼び出し前
Before the function call
関数呼び出し後
After the function call
V 時刻tにおける速度場
Velocity field at time t
T 時刻tΔt/2における応力場
Stress field at time tΔt/2
時刻t+Δt/2における応力場
Stress field at time t+Δt/2


◆関数の2つのバージョン (Two versions of the functions)

関数TF_calculate_V, TF_calculate_Tは OpenMP並列化を行うバージョンと行わないバージョンの2種類があり、 これらは$YMAEDA_OPENTOOL_DIR/opentws/src/waterPML_subディレクトリ内の 以下のファイルにおいて定義されている。 どちらのバージョンも使い方は同じである。
The functions TF_calculate_V and TF_calculate_T have two versions; one version uses the OpenMP parallelization and the other does not. These versions are defined in the files below under the $YMAEDA_OPENTOOL_DIR/opentws/src/waterPML_sub directory. The usages of the two versions are same.

関数
Function
OpenMP並列化版の定義ファイル
The file in which the OpenMP version is defined
並列化無し版の定義ファイル
The file in which the non-parallelization version is defined
TF_calculate_V calculate_V_omp.h calculate_V.h
TF_calculate_T calculate_T_omp.h calculate_T.h


◆引数Vの定義 (Definition of argument V)

関数TF_calculate_V, TF_calculate_Tにおいて、 引数Vは3次元配列として以下のように定義される。
In the functions TF_calculate_V and TF_calculate_T, the argument V is defined as a 3-D array as follows.

引数番号
Argument
意味
Meaning
第1引数
1st argument
速度成分をvikと書いたときの成分番号ii=0x成分、i=1y成分、i=2z成分を表す。
The index i of a velocity component vik; i=0, i=1, and i=2 represent x-, y-, and z-components, respectively.
第2引数
2nd argument
速度成分をvikと書いたときの成分番号kk=0x成分、k=1y成分、k=2z成分を表す。
The index k of a velocity component vik; k=0, k=1, and k=2 represent x-, y-, and z-components, respectively.
第3引数
3rd argument
位置を表す番号。
The index representing a location.

この第3引数の「位置を表す番号」は 次のページ で解説する方法3-2に基づく番号である。 現時点では速度定義点の座標と1対1で対応する整数と思えば良い。
The “index representing a location” (3rd argument) is based on the method 3-2 explained in the next page. At this stage, understand this quantity as an integer that has a one-to-one relation with the coordinates of the definition points of velocities.


◆引数Tの定義 (Definition of argument T)

関数TF_calculate_V, TF_calculate_Tにおいて、 引数Tは3次元配列として以下のように定義される。
In the functions TF_calculate_V and TF_calculate_T, the argument T is defined as a 3-D array as follows.

引数番号
Argument
意味
Meaning
第1引数
1st argument
応力成分をτijlと書いたときの成分番号(i,j)の組。 0がxx成分、1がyy成分、2がzz成分、 3がxy(yx)成分、4がyz(zy)成分、5がzx(xz)成分 を表す。
The combination of indices (i,j) of a stress component τijl; the values from 0 to 5 represent the xx-, yy-, zz-, xy- (yx-), yz- (zy-), and zx- (xz)-components, respectively.
第2引数
2nd argument
応力成分をτijlと書いたときの成分番号ll=0x成分、l=1y成分、l=2z成分を表す。
The index l of a stress component τijl; l=0, l=1, and l=2 represent x-, y-, and z-components, respectively.
第3引数
3rd argument
位置を表す番号。
The index representing a location.