このページの情報はwaterPMLコマンドを利用者として使う分には必要無い。
プログラマとしてソースコードを解読・改良する場合に必要になる。
ソースコードを構成する個々のファイルの中身の詳細は
ヘッダファイルと関数
に記載しているが、このページではその基本となる考え方や概念を整理する。
The information in this page is not necessary
for users of the waterPML command
but is necessary for programmers
who wants to understand and improve the source code.
Details of individual files that constitute the source code
are described in
Header files and functions.
This page describes more basic level of concepts
to better understand the individual files.
◆ソースコードの全体構成
(The entire structure of the source code)
waterPMLコマンドのソースコードは
$YMAEDA_OPENTOOL_DIR/opentws/src/waterPML.c
に書かれたmainプログラムと、
そこから呼ばれる様々な関数
($YMAEDA_OPENTOOL_DIR/opentws/src/waterPML_subディレクトリ内で定義されている)
から成る。
The source code of the waterPML command is composed of
the main program in
$YMAEDA_OPENTOOL_DIR/opentws/src/waterPML.c
and various functions called from it,
defined in the directory
$YMAEDA_OPENTOOL_DIR/opentws/src/waterPML_sub.
mainプログラムの処理の骨格は以下の流れである。
The framework of the main program is as follows.
パラメータの読み込みと設定
Read and set parameters
for(時間に関するループ(Loop for time)){
時刻における速度場の計算(関数TF_calculate_V)
Compute the velocity field at time (function TF_calculate_V)
時刻における応力場の計算(関数TF_calculate_T)
Compute the stress field at time
(function TF_calculate_T)
計算結果の出力
Output the result
}
したがって関数TF_calculate_V, TF_calculate_Tを最初に理解すると見通しが良い。
以下の説明はこの流れに沿って組み立ててある。
Therefore, programmers should first understand the functions
TF_calculate_V and TF_calculate_T.
The description below follows this flow.