関数get_3d_data_index_increment マニュアル

(The documentation of function get_3d_data_index_increment)

Last Update: 2025/8/7


◆機能・用途(Purpose)

格子点1つ分の位置の増分に伴う struct _3d_data型構造体のメンバindexの値の増分を計算する。
Compute the increment of member index of a struct _3d_data-type structure caused by an increment of the location by 1 grid node.


◆形式(Format)

#include <3d_data/differentiate.h>
inline int get_3d_data_index_increment(struct _3d_data data,int direction)


◆引数(Arguments)

data 処理対象の3次元データ。
The 3-D data to treat.
direction 位置の増分の方向。 \(x\)方向なら0、\(y\)方向なら1、\(z\)方向なら2を与える。
The direction of the increment of the location: 0 for \(x\)-direction, 1 for \(y\)-direction, and 2 for \(z\)-direction.


◆戻り値(Return value)

引数directionで指定された方向に1グリッド分だけ位置をずらしたときの 引数data.indexの値の増分であり、以下の通り。
The increment of the value of argument data.index corresponding to the increment of the location by 1 grid along the direction specified by argument direction. Explicitly, the return value is as below.

引数directionの値
The value of argument direction
位置をずらす方向
The direction of the increment of the location
戻り値
Return value
0 \(x\) data.N[1]∗data.N[2]
1 \(y\) data.N[2]
2 \(z\) 1


◆使用例(Example)

struct _3d_data data;
int n,index_increment;
double difference[3];
for(n=0;n<=2;n++){
     index_increment=get_3d_data_index_increment(data,n);
     difference[n]=data.value[data.index[i][j][k]] -data.value[data.index[i][j][k]-index_increment];
}