structure.h マニュアル

(The documentation of structure.h)

Last Update: 2023/12/13


structure.hではymaeda_opentoolsで共通に用いる構造体や共用体が定義されている。 各構造体・共用体の定義を以下に示す。
Structures and unions commonly used in ymaeda_opentools are defined in structure.h. Definitions of individual structures and unions are shown below.

◆目次(Table of contents)



◆struct im型構造体 (A struct im-type structure)

複素数を表現するための構造体である。 以下のメンバから成る。
A structure to represent a complex number. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
double r 実部。
The real part.
double i 虚部。
The imaginary part.


◆FILE_L型構造体 (A FILE_L-type structure)

ファイルを開いて排他ロックを掛けるためにファイルポインタを拡張した構造体である。 以下のメンバから成る。
A structure similar to a file pointer but was extended to open a file and apply an exclusive file lock. This structure is composed of the following members.

この構造体はtypedef宣言をしているので「struct」無しで宣言できる。
The typedef declaration is applied to this structure, meaning that it can be declared without “struct”.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
FILE ∗ main ファイルにアクセスするためのファイルポインタ。
A file pointer to access the file.
FILE ∗ keep ファイルを読み込みモードで開く際に 排他ロックを掛けるためのファイルポインタ。
A file pointer used for an exclusively lock file when the file is opened in the reading mode.


◆struct eigen_info型構造体 (A struct eigen_info-type structure)

複素数値の固有値・固有ベクトルを表現するための構造体である。 以下のメンバから成る。
A structure to represent eigenvalues and eigenvectors of complex numbers. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int dimension 元の行列のサイズ。
The size of the original matrix.
struct im ∗ eigenvalue 固有値を並べた配列。
Array composed of the eigenvalues.
struct im ∗∗ eigenvector 固有ベクトルを並べた配列。
An array composed of the eigenvectors.
  • eigenvector[0], eigenvector[1], … がそれぞれ固有値1, 2, …に対する固有ベクトルを表す。
    The sub-arrays eigenvector[0], eigenvector[1], …, represent the eigenvectors corresponding to 1st, 2nd, …, eigenvalues, respectively.
  • eigenvector[i][0], eigenvector[i][1], … が\(i+1\)番目の固有ベクトルの \(x_1\), \(x_2\), …成分を表す。
    The values of eigenvector[i][0], eigenvector[i][1], …, are the \(x_1\), \(x_2\), …, components of (\(i+1\))-th eigenvector, respectively.


◆struct eigen_info_r型構造体 (A struct eigen_info_r-type structure)

実数値の固有値・固有ベクトルを表現するための構造体である。 以下のメンバから成る。
A structure to represent eigenvalues and eigenvectors of real numbers. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int dimension 元の行列のサイズ。
The size of the original matrix.
double ∗ eigenvalue 固有値を並べた配列。
Array composed of the eigenvalues.
double ∗∗ eigenvector 固有ベクトルを並べた配列。
An array composed of the eigenvectors.
  • eigenvector[0], eigenvector[1], … がそれぞれ固有値1, 2, …に対する固有ベクトルを表す。
    The sub-arrays eigenvector[0], eigenvector[1], …, represent the eigenvectors corresponding to 1st, 2nd, …, eigenvalues, respectively.
  • eigenvector[i][0], eigenvector[i][1], … が\(i+1\)番目の固有ベクトルの \(x_1\), \(x_2\), …成分を表す。
    The values of eigenvector[i][0], eigenvector[i][1], …, are the \(x_1\), \(x_2\), …, components of (\(i+1\))-th eigenvector, respectively.


◆struct humanTime型構造体 (A struct humanTime-type structure)

人間にとって分かりやすい形式で日付・時刻を表現するための構造体である。
A structure to represent a date and time in a form comprehensive to human.

C言語には日付・時刻を表すためのstruct tm型構造体が用意されている。しかし
という少し使いにくい仕様になっている。 そこで、より使いやすくしたのがこのstruct humanTime型構造体である。
In the C language, dates and times can be expressed by a built in struct tm-type structure. However, it is not easy to use in that:
To overcome these difficulties and to be more user-friendly, the struct humanTime-type structure was developed.

この構造体を使った様々な日付・時刻演算を簡単に行うための関数を mytime.hに用意してある。
Functions to conduct various operations of dates and times based on this structure are given in mytime.h.

この構造体は以下のメンバから成る。
This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int year 年(西暦)。
The year in A.D.
int month 月(1-12)。
The month in 1-12.
int day 日(1-31)。
The day in 1-31.
int hour 時(0-23)。
The hour in 0-23.
int min 分(0-59)。
The minute in 0-59.
double sec 秒(0.0-59.999…)。
The second in 0.0-59.999….


◆union data_for_convertEndian__int型共用体 (A union data_for_convertEndian__int-type union)

int型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for an int-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int d 変換したい変数
The variable to convert
char c[sizeof(int)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関する説明 (A description for the coding in the header file)
これ以降、data_for_convertEndian_∗という名前の共用体が多数登場する。 structure.h内部ではこれらを 関数形式マクロDEFINE_DATA_FOR_CONVERT_ENDIANを用いて定義している。 DEFINE_DATA_FOR_CONVERT_ENDIANは2つの引数を持ち、 1つ目が符号の有無(unsignedまたは空文字)、 2つ目が型名(int,long,short,float,double)である。 この関数形式マクロはこれらの共用体の定義の直前で定義し、 共用体の定義の直後で定義除去しているので他の部分には影響を及ぼさない。
From here, many unions with the names data_for_convertEndian_∗ are defined. Internally, these unions are defined by using a function-type macro DEFINE_DATA_FOR_CONVERT_ENDIAN. This macro has two arguments; the first argument is either unsigned or empty (which means signed), and the second one represents the type (int, long, short, float, or long). This function-type macro is defined immediately before the definitions of the unions, and the macro is undefined immediately after the definitions of the unions, so that the macro has no effect to the other parts of the program.


◆union data_for_convertEndian__long型共用体 (A union data_for_convertEndian__long-type union)

long型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for a long-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
long d 変換したい変数
The variable to convert
char c[sizeof(long)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関しては union data_for_convertEndian__int型共用体の説明参照。
For the coding in the header file, see the description of union data_for_convertEndian__int-type union.


◆union data_for_convertEndian_unsigned_long型共用体 (A union data_for_convertEndian_unsigned_long-type union)

unsigned long型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for a unsigned long-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
unsigned long d 変換したい変数
The variable to convert
char c[sizeof(unsigned long)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関しては union data_for_convertEndian__int型共用体の説明参照。
For the coding in the header file, see the description of union data_for_convertEndian__int-type union.


◆union data_for_convertEndian__short型共用体 (A union data_for_convertEndian__short-type union)

short型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for a short-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
short d 変換したい変数
The variable to convert
char c[sizeof(short)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関しては union data_for_convertEndian__int型共用体の説明参照。
For the coding in the header file, see the description of union data_for_convertEndian__int-type union.


◆union data_for_convertEndian_unsigned_short型共用体 (A union data_for_convertEndian_unsigned_short-type union)

unsigned short型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for a unsigned short-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
unsigned short d 変換したい変数
The variable to convert
char c[sizeof(unsigned short)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関しては union data_for_convertEndian__int型共用体の説明参照。
For the coding in the header file, see the description of union data_for_convertEndian__int-type union.


◆union data_for_convertEndian__float型共用体 (A union data_for_convertEndian__float-type union)

float型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for a float-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
float d 変換したい変数
The variable to convert
char c[sizeof(float)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関しては union data_for_convertEndian__int型共用体の説明参照。
For the coding in the header file, see the description of union data_for_convertEndian__int-type union.


◆union data_for_convertEndian__double型共用体 (A union data_for_convertEndian__double-type union)

double型変数について ビッグエンディアンとリトルエンディアンの変換を行うための共用体である。 以下のメンバから成る。
A union for conversion between big and little endians for a double-type variable. This union is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
double d 変換したい変数
The variable to convert
char c[sizeof(double)] 変換のために1バイトずつに割り当てる値
Values assigned to each byte for conversion

ヘッダファイル内でのコーディングに関しては union data_for_convertEndian__int型共用体の説明参照。
For the coding in the header file, see the description of union data_for_convertEndian__int-type union.


◆struct grid型構造体 (A struct grid-type structure)

位置の関数を表す複数の1次元配列について、 位置と配列要素番号との対応関係を一括で与えるための構造体である。 staggered gridを用いた差分計算での利用を主に念頭に置いている。 以下のメンバから成る。
A structure to relate each location and the corresponding array component indices for multiple 1-D arrays that represent functions of locations. This structure is assumed mainly to be used for finite difference computations with a staggered grid. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int Nv 扱う1次元配列(位置の関数)の個数。
The number of 1-D arrays (functions of locations) to treat.
int Ng 格子点の総数。 位置の関数のいずれかが値を持つ場所を全て格子点としてカウントする。
The total number of grid nodes, counted as the number of locations where at least one of the functions of locations has a value.
int ∗∗ index 格子点番号と配列要素番号の対応表。 index[iv][ig]がiv番目の関数(1次元配列)の ig番目の位置における配列要素番号を表し、 その場所で定義されない場合は\(-1\)を取るものとする。
A table relating each grid node index and array component indices; index[iv][ig] represents the array component index for ivth function (1-D array) at igth location, and this value is \(-1\) if the function is not defined at that place.

使用例(Example)
この構造体はstaggered gridを用いた差分計算を主に念頭に置いている。 例として2つの関数\(f(x,t)\), \(g(x,t)\) (\(x\): 位置、\(t\): 時刻) を用いた偏微分方程式 \[\begin{equation} \PartialDiff{f}{t}=\PartialDiff{g}{x} \label{eq.diff1} \end{equation}\] \[\begin{equation} \PartialDiff{g}{t}=\PartialDiff{f}{x} \label{eq.diff2} \end{equation}\] を数値的に解くことを考える。 空間刻みを\(\Delta x\)、時間刻みを\(\Delta t\)とし、 \(f(x,t)\)を位置\(x=i\Delta x\)で、 \(g(x,t)\)を位置\(x=(i+1/2)\Delta x\)で定義する(\(i\):整数)。 このとき(\ref{eq.diff1})式に対応する時間発展の計算コードは
     f[i]+=(dt/dx)∗(g[i]-g[i-1]);
のようになる。 ここでg[i], g[i-1]はそれぞれ 位置\(x=(i+1/2)\Delta x\), \(x=(i-1/2)\Delta x\)での\(g(x,t)\)の値を表し、 その差を用いて位置\(x=i\Delta x\)での\(f(x,t)\)の値f[i]を更新する というコードになっている。すなわち中心差分なのであるが fとgの定義位置の違いによって一見すると左側の片側差分のように見える。 一方、(\ref{eq.diff2})式に対応する時間発展の計算コードは
     g[i]+=(dt/dx)∗(f[i+1]-f[i]);
となる。これは一見すると右側の片側差分のように見える。 staggered gridを用いた差分計算ではこのように 配列要素番号と位置の対応関係が分かりにくい。
This structure was developed mainly for finite difference computations that use a staggered grid. For example, consider to numerically solve partial differential equations (\ref{eq.diff1}) and (\ref{eq.diff2}) for functions \(f(x,t)\) and \(g(x,t)\), where \(x\) is location and \(t\) is time. Let \(\Delta x\) and \(\Delta t\) be grid intervals in space and time, respectively. Assume that \(f(x,t)\) is defined at locations \(x=i\Delta x\), and \(g(x,t)\) is defined at locations \(x=(i+1/2)\Delta x\), where \(i\) is an integer. Then the temporal evolution corresponding to eq. (\ref{eq.diff1}) can be implemented as:
     f[i]+=(dt/dx)∗(g[i]-g[i-1]);
where g[i] and g[i-1] denote the values of \(g(x,t)\) at locations \(x=(i+1/2)\Delta x\) and \(x=(i-1/2)\Delta x\), respectively. The code uses the difference of the values at these two locations to update f[i], which is the value of \(f(x,t)\) at a location \(x=i\Delta t\). Therefore the code uses a central difference. However, at a first glance the code looks like a one-sided (left-side) difference due to the difference in the definition points between f and g. The temporal evolution for eq. (\ref{eq.diff2}) can be impremented as:
     g[i]+=(dt/dx)∗(f[i+1]-f[i]);
which looks as if a one-sided (right-side) difference at a first glance. These examples show that the relations between array component indices and locations are not easy to understand in staggered grid finite difference codes.

そこでstruct grid型構造体を利用する。 struct grid型構造体stgを宣言し、そのメンバindexを次のように定義したとする。
The codes can be more comprehensive with the use of the struct grid-type structure. Let stg be a struct grid-type structure, whose member index was defined as below.

\(j\) stg.index[0][j] stg.index[1][j]
位置\(x=j\Delta x/2\)でのfの配列要素番号
Array component index for f at a location \(x=j\Delta x/2\)
位置\(x=j\Delta x/2\)でのgの配列要素番号
Array component index for g at a location \(x=j\Delta x/2\)
00\(-1\)
1\(-1\)0
21\(-1\)
3\(-1\)1
42\(-1\)
5\(-1\)2
63\(-1\)
7\(-1\)3

このとき(\ref{eq.diff1})式の時間発展は
     if(stg.index[0][j]>=0){
         f[stg.index[0][j]]+=(dt/dx)∗ (g[stg.index[1][j+1]]-g[stg.index[1][j-1]]);
    }
のように書ける。また(\ref{eq.diff2})式の時間発展は
     if(stg.index[1][j]>=0){
         g[stg.index[1][j]]+=(dt/dx)∗ (f[stg.index[0][j+1]]-f[stg.index[0][j-1]]);
    }
のように書ける。どちらも\(j+1\)番目の位置での値と \(j-1\)番目の位置での値の差を用いて \(j\)番目の位置での値を更新するという、 中心差分であることが一目瞭然のコードになっており、 元の偏微分方程式との対応づけもしやすい。
Then the temporal evolutions of eqs. (\ref{eq.diff1}) and (\ref{eq.diff2}) can be impremented as:
     if(stg.index[0][j]>=0){
         f[stg.index[0][j]]+=(dt/dx)∗ (g[stg.index[1][j+1]]-g[stg.index[1][j-1]]);
    }
and
     if(stg.index[1][j]>=0){
         g[stg.index[1][j]]+=(dt/dx)∗ (f[stg.index[0][j+1]]-f[stg.index[0][j-1]]);
    }
respectively. In the both codes, the value at \(j\)th node is updated based on the difference of (\(j+1\))th and (\(j-1\))th nodes, showing very clearly that the codes are central differences and providing simple correspondence to the original partial differential equations.


◆struct DegMinSec型構造体 (A struct DegMinSec-type structure)

緯度経度の度分秒表記を扱うための構造体である。 以下のメンバから成る。
A structure to treat the degree-minute-second representation of a latitude or a longitude. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int sign 符号。東経と北緯は\(+1\)、西経と南緯は\(-1\)とする。
The sign, which is \(+1\) for east longitudes and north latitudes, and \(-1\) for west longitudes and south latitudes.
int deg 度。0-359の間の整数値を取るものとする。
Degrees, which must be an integer between 0 and 359.
int min 分。0-59の間の整数値を取るものとする。
Minutes, which must be an integer between 0 and 59.
double sec 秒。0.0以上60.0未満の実数値を取るものとする。
Seconds, which must be a real number greater than or equal to 0.0 and less than 60.0.

なお度分秒表記から小数の度表記への換算の際に 符号に応じた場合分けを毎回書くのは面倒なので 西経や南緯を表す際に「度」に\(-\)を付けるのではなく 符号を別途与える方式にしている。
Here, the sign is given separately instead of using a negative value of degrees to represent a west longitude and a south latitude because it enables a simpler conversion from a degree-minute-second representation to a degree representation of a decimal fraction.

もしも仮に西経や南緯を「度」に\(-\)を付ける方式で表現した場合、 換算には以下のような場合分けが必要になる。
If a west longitude and a south latitude were represented by a negative value of degrees, then a branch operation shown below would be needed for the conversion.

struct DegMinSec a;
double b;
if(a.deg>0){
    b=a.deg+a.min/60.0+a.sec/3600.0;
}else if(a.deg<0){
    b=a.deg-a.min/60.0-a.sec/3600.0;
}else{
    if(a.min>0){
        b=a.min/60.0+a.sec/3600.0;
    }else if(a.min<0){
        b=a.min/60.0-a.sec/3600.0;
    }else{
        b=a.sec/3600.0;
    }
}

一方、符号を別にしておけば以下の1行で変換できる。
By separating the sign, the conversion can be implemented by the single line below.

struct DegMinSec a;
double b;
b=a.sign*(a.deg+a.min/60.0+a.deg/3600.0);


◆struct hypo_info型構造体 (A struct hypo_info-type structure)

地震の震源の情報を扱うための構造体である。 以下のメンバから成る。
A structure to treat the information on the hypocenter of an earthquake. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
struct humanTime originTime 地震の発震日時。
The origin time of an earthquake.
double Edeg 地震の震源の経度(小数単位の度)。東経を正、西経を負とする。
The longitude of the hypocenter of an earthquake in degrees of a decimal fraction. The east and west longitudes are represented by positive and negative values, respectively.
struct DegMinSec E60 地震の震源の経度(度分秒表記)。
The longitude of the hypocenter of an earthquake in a degree-minute-second representation.
double Ndeg 地震の震源の緯度(小数単位の度)。北緯を正、南緯を負とする。
The latitude of the hypocenter of an earthquake in degrees of a decimal fraction. The north and south latitudes are represented by positive and negative values, respectively.
struct DegMinSec N60 地震の震源の緯度(度分秒表記)。
The latitude of the hypocenter of an earthquake in a degree-minute-second representation.
double depth_km 地震の震源の深さ(km)。
The depth (km) of the hypocenter of an earthquake.
double x 直交座標系で表した地震の震源位置の\(x\)成分(東方向、m)。 座標原点は1つの解析の中で整合性が取れていれば自由に与えて良い。
The \(x\)-component (east, in meters) of the hypocenter location of an earthquake in a cartesian coordinate system. The origin of the coordinate system can be determined arbitrarily as long as it is consistent throughout an analysis.
double y 直交座標系で表した地震の震源位置の\(y\)成分(北方向、m)。 座標原点は1つの解析の中で整合性が取れていれば自由に与えて良い。
The \(y\)-component (north, in meters) of the hypocenter location of an earthquake in a cartesian coordinate system. The origin of the coordinate system can be determined arbitrarily as long as it is consistent throughout an analysis.
double z 地震の震源の標高(m)。 海抜を原点とし、上方向を正に取る。 地震の震源は深さ(下方向を正)で表される場合が多いが、 ymaeda_opentoolsでは火山の解析を主に念頭に置いていることと、 震源から地表の観測点までの波線や波動伝搬を計算する際に 上向きを正で統一しておく方が分かりやすいため上方向を正にしている。
The altitude (m) of the hypocenter of an earthquake. The origin is taken at sea level, and positive is taken upward. Although the hypocenter of an earthquake is more commonly represented by a depth (positive downward), here the positive is taken upward because ymaeda_opentools mainly assumes analyses in volcanic fields, and because using a convention of positive upward throughout would be more comprehensive in calculations of rays and wavefields from a hypocenter to stations on the ground.
double M 地震のマグニチュード。
The magnitude of an earthquake.


◆struct station_info型構造体 (A struct station_info-type structure)

観測点の情報を扱うための構造体である。 以下のメンバから成る。
A structure to treat the information on a station. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
char name[strsize] 観測点名またはコード。 ファイル名の一部として用いられる場合があるので 空白を含まない英数字とすること。
Name or code of a station; this value must be composed of alphanumeric characters and must not consist of blanks because this value name may be used as a part of a file name.
char name_detail[strsize] 観測点名(正式名称など)。日本語や空白文字を含んでも良い。
The official name of a station, which can consist of Japanese characters or blanks.
char channelCode[strsize] チャンネルコード。
A channel code.
double Edeg 観測点の経度(小数単位の度)。東経を正、西経を負とする。
The longitude of a station location in degrees of a decimal fraction. The east and west longitudes are represented by positive and negative values, respectively.
struct DegMinSec E60 観測点の経度(度分秒表記)。
The longitude of a station location in a degree-minute-second representation.
double Ndeg 観測点の緯度(小数単位の度)。北緯を正、南緯を負とする。
The latitude of a station location in degrees of a decimal fraction. The north and south latitudes are represented by positive and negative values, respectively.
struct DegMinSec N60 観測点の緯度(度分秒表記)。
The latitude of a station location in a degree-minute-second representation.
double x 直交座標系で表した観測点位置の\(x\)成分(東方向、m)。 座標原点は1つの解析の中で整合性が取れていれば自由に与えて良い。
The \(x\)-component (east, in meters) of a station location in a cartesian coordinate system. The origin of the coordinate system can be determined arbitrarily as long as it is consistent throughout an analysis.
double y 直交座標系で表した観測点位置の\(y\)成分(北方向、m)。 座標原点は1つの解析の中で整合性が取れていれば自由に与えて良い。
The \(y\)-component (north, in meters) of a station location in a cartesian coordinate system. The origin of the coordinate system can be determined arbitrarily as long as it is consistent throughout an analysis.
double z 観測点の標高(m)。 海抜を原点とし、上方向を正に取る。
The altitude of a station location. The origin is taken at sea level, and positive is taken upward.


◆struct mesh_Japan型構造体 (A struct mesh_Japan-type structure)

緯度経度範囲に基づく日本の地域メッシュを扱うための構造体である。 以下のメンバから成る。
A structure to treat the regional mesh of Japan based on coordinate ranges. This structure is composed of the following members.

日本の地域メッシュについては 関数JapanMeshCode2latlonRange (coordinate.h)のマニュアル参照。
For the regional mesh of Japan, see the documentation of function JapanMeshCode2latlonRange (coordinate.h).


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int meshCode メッシュコード。
The mesh code.
struct DegMinSec S メッシュの南端の緯度(度分秒表記)。
The latitude on the southern edge of the mesh by the degree-minute-second representation.
struct DegMinSec N メッシュの北端の緯度(度分秒表記)。
The latitude on the northern edge of the mesh by the degree-minute-second representation.
struct DegMinSec W メッシュの西端の経度(度分秒表記)。
The longitude on the western edge of the mesh by the degree-minute-second representation.
struct DegMinSec E メッシュの東端の経度(度分秒表記)。
The longitude on the eastern edge of the mesh by the degree-minute-second representation.
double Sdeg メッシュの南端の緯度(小数の度表記)。
The latitude on the southern edge of the mesh by the decimal number representation in degree unit.
double Ndeg メッシュの北端の緯度(小数の度表記)。
The latitude on the northern edge of the mesh by the decimal number representation in degree unit.
double Wdeg メッシュの西端の経度(小数の度表記)。
The longitude on the western edge of the mesh by the decimal number representation in degree unit.
double Edeg メッシュの東端の経度(小数の度表記)。
The longitude on the eastern edge of the mesh by the decimal number representation in degree unit.


◆struct triangle型構造体 (A struct triangle-type structure)

三角形要素を扱うための構造体である。 以下のメンバから成る。
A structure to treat a triangular element. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int ip1 三角形を構成する1つ目の頂点の点番号。 点のリストが別の配列で与えられていることを想定しており、 「点番号」とはその配列要素番号のことである。
The index of point for the 1st convex of the triangle. A list of points is assumed to be given as a separate array. The “index of point” refers to the index of this array.
int ip2 三角形を構成する2つ目の頂点の点番号。
The index of point for the 2nd convex of the triangle.
int ip3 三角形を構成する3つ目の頂点の点番号。
The index of point for the 3rd convex of the triangle.
double p1[3] 三角形を構成する1つ目の頂点の\(x\), \(y\), \(z\)座標を並べた配列。
An array composed of the \(x\)-, \(y\)-, and \(z\)-coordinates of the 1st convex of the triangle.
double p2[3] 三角形を構成する2つ目の頂点の\(x\), \(y\), \(z\)座標を並べた配列。
An array composed of the \(x\)-, \(y\)-, and \(z\)-coordinates of the 2nd convex of the triangle.
double p3[3] 三角形を構成する3つ目の頂点の\(x\), \(y\), \(z\)座標を並べた配列。
An array composed of the \(x\)-, \(y\)-, and \(z\)-coordinates of the 3rd convex of the triangle.
double outerCircle_center[3] 三角形の外接円の中心点の\(x\), \(y\), \(z\)座標を並べた配列。
An array composed of the \(x\)-, \(y\)-, and \(z\)-coordinates of the center of the circumscribed circle of the triangle.
double outerCircle_radius 三角形の外接円の半径。
The radius of the circumscribed circle of the triangle.
double normalVector[3] 三角形の単位法線ベクトル。 メンバp1, p2, p3で与えられる点を順に\(P_1\), \(P_2\), \(P_3\)として、 \(\overrightarrow{P_1P_2}\times\overrightarrow{P_1P_3}\) の向きに取る。
The unit normal vector of the triangle oriented in a direction of \(\overrightarrow{P_1P_2}\times\overrightarrow{P_1P_3}\), where \(P_1\), \(P_2\), and \(P_3\) are the points given by members p1, p2, and p3, respectively.


◆struct topography型構造体 (A struct topography-type structure)

地形データを扱うための構造体である。 地形データは各水平位置\((x,y)\)における地表面の標高のデータであり、 この構造体では\((x,y)\)が不規則に配置されたデータを扱うことができる。 この構造体は以下のメンバから成る。
A structure to treat a topography data, which is a data for the ground surface elevation at each horizontal location \((x,y)\). This structure can treat the data with irregular \((x,y)\) arrangement. This structure is composed of the following members.


Type
メンバ名
Name of member
メンバの意味
Meaning of member
int Ndata データ点の個数。
The number of data points.
double ∗ x データ点の\(x\)座標を並べた配列。
An array composed of the \(x\)-coordinates of data points.
double ∗ y データ点の\(y\)座標をxと同じ順番で並べた配列。
An array composed of the \(y\)-coordinates of data points in the same order as x.
double ∗ elevation データ点の標高をxと同じ順番で並べた配列。
An array composed of the altitudes of data points in the same order as x.