3d_data_unevenヘッダファイルパッケージ マニュアル

(The documentation of 3d_data_uneven header file package)

Last Update: 2025/12/16


3d_data_unevenヘッダファイルパッケージには 等間隔でない3次元データに対して様々な処理を行うヘッダファイルをまとめてある。
Header files to perform various operations for unevenly sampled 3-D data are included in 3d_data_uneven header file package.

ymaeda_opentoolsでは3次元データの表現方法として
を併用する。
The ymaeda_opentools uses two different concepts for 3-D data: grid nodes where lines intersect (Fig. 1a), and grid cells that are rectangular solid volumes (Fig. 1b).


図1. 格子点と格子セルの捉え方。 (a)格子点の捉え方。 線と線が交差する場所が格子点であり、青丸で例示する (図中に多数存在する格子点のうちの1つである)。 (b)格子セルの捉え方。 直方体領域が格子セルであり、茶色の塗りつぶしで例示する (図中に多数存在する格子セルのうちの1つである)。
Fig. 1. Concepts of grid nodes and cells. (a) Grid nodes are the locations where lines intersect. The blue circle is an example of grid nodes. (b) Grid cells are volumes of rectangular shape. The brown filled region is an example of grid cells.

はじめに格子点を定義する。 \((x,y,z)\)直交座標系を考え、格子点の座標を \[\begin{eqnarray} x &=& x_0,x_1,x_2,\cdots,x_L \nonumber \\ &=& \{x_l; l=0,1,2,\cdots,L\} \label{eq.x.nodes} \end{eqnarray}\] \[\begin{eqnarray} y &=& y_0,y_1,y_2,\cdots,y_M \nonumber \\ &=& \{y_m; m=0,1,2,\cdots,M\} \label{eq.y.nodes} \end{eqnarray}\] \[\begin{eqnarray} z &=& z_0,z_1,z_2,\cdots,z_N \nonumber \\ &=& \{z_n; n=0,1,2,\cdots,N\} \label{eq.z.nodes} \end{eqnarray}\] とする。位置の関数として表される量\(f(x,y,z)\)を格子点での値を用いて与える場合には 3次元配列を用いて \[\begin{equation} \mbox{f[l][m][n]}=f(x_l,y_m,z_n) \label{eq.f.node} \end{equation}\] のように与える。格子点以外の場所での\(f(x,y,z)\)は 格子点での値の補間により求める。 位置とともに滑らかに変化する量を表現するにはこの表現方法が適している。 この3次元配列のサイズは\((L+1)\times (M+1)\times (N+1)\)である。 格子点と格子セルの両方を用いる場合を念頭において\(L\times M\times N\)にはしていない 点に留意。
First, let us define the grid nodes. The coordinates of the grid nodes in an \((x,y,z)\) cartesian system are expressed by Eqs. (\ref{eq.x.nodes})-(\ref{eq.z.nodes}). A quantity that is a function of position, \(f(x,y,z)\), can be given by a 3-D array of Eq. (\ref{eq.f.node}) using the values at the grid nodes. The values of \(f(x,y,z)\) at the locations other than the grid nodes are computed by interpolation. This representation method is advantageous to express quantities that smoothly change with the potision. The size of this array is \((L+1)\times (M+1)\times (N+1)\), not \(L\times M\times N\), because some problems use the both representations of the grid nodes and grid cells.

\(f(x,y,z)\)がある面を境に不連続に変化する場合には 不連続面に格子点を置いた上で\(f(x,y,z)\)自体は格子セルを用いて表現するのが良い。 1つの格子セル内では\(f(x,y,z)\)の値は一様であるものとし、3次元配列を用いて \[\begin{equation} \mbox{f[l][m][n]}=f(x,y,z); \hspace{1em} x_l<x<x_{l+1}, \hspace{1em} y_m<y<y_{m+1}, \hspace{1em} z_n<z<z_{n+1} \label{eq.f.cell} \end{equation}\] のように表現する。この場合の3次元配列のサイズは\(L\times M\times N\)となる。
If \(f(x,y,z)\) has discontinuities across planes, grid nodes are placed on the planes and the values of \(f(x,y,z)\) are expressed using grid cells. A 3-D array of Eq. (\ref{eq.f.cell}) realizes this expression, assuming that \(f(x,y,z)\) is uniform in each cell. The size of this array is \(L\times M\times N\).

格子点間隔が均一でない場合、 最初の格子点の位置\((x_0,y_0,z_0)\)と 格子セルサイズ\(\Delta x\), \(\Delta y\), \(\Delta z\) という形では3次元データを表現できない。 そこで
を組合せた構造体により3次元データを表現する。 格子点を用いた表現(\ref{eq.f.node}式)は struct irregular3Ddata_node型構造体、 格子セルを用いた表現(\ref{eq.f.cell}式)は struct irregular3Ddata_cell型構造体 により実装する。 また格子点配置のみを表現したい場合もあるので3次元配列を除いた struct irregular3Dnodes型構造体 も用意している。
The 3-D data on uneven grid nodes cannot be expressed using the coordinate of the initial grid node \((x_0,y_0,z_0)\) and the grid cell size \(\Delta x\), \(\Delta y\), and \(\Delta z\). Therefore, the 3-D data are expressed using structures composed of the following members:
The expressions based on the grid nodes (Eq. \ref{eq.f.node}) and cells (Eq. \ref{eq.f.cell}) are impremented by struct irregular3Ddata_node and struct irregular3Ddata_cell structures, respectively. To express only the arrangement of the grid nodes, a struct irregular3Dnodes structure is available, which does not contain the 3-D array.

3d_data_unevenヘッダファイルパッケージ内のヘッダファイルを以下に示す。 各ヘッダファイルの詳細はリンクをクリックして参照のこと。
Header files in 3d_data_uneven header file package are listed below. For details of individual header files, click the links.

◆特殊なヘッダファイル (Special header files)

ヘッダファイル名
Header file name
機能・用途
Purpose
3d_data_uneven/index.h 3d_data_unevenヘッダファイルパッケージ内の 他のヘッダファイル一式をインクルードするためのヘッダファイル。
A header file to include all the other header files in 3d_data_uneven header file package.
3d_data_uneven/structure.h 3d_data_unevenヘッダファイルパッケージ用の構造体の定義。
Definitions of structures for 3d_data_uneven header file package.
3d_data_uneven/prototype.h 3d_data_unevenヘッダファイルパッケージ内の関数のプロトタイプ。
Prototypes of functions in 3d_data_uneven header file package.

◆通常のヘッダファイル (Normal header files)

ヘッダファイル名
Header file name
機能・用途
Purpose
3d_data_uneven/check.h 等間隔でない3次元データのチェックを行う関数。
Functions to check unevenly sampled 3-D data.
3d_data_uneven/memory.h 等間隔でない3次元データの動的メモリの確保と解放を行う関数。
Functions to allocate and release dynamic memories for unevenly sampled 3-D data.