関数read_snapshot マニュアル

(The documentation of function read_snapshot)

Last Update: 2025/8/7


◆機能・用途(Purpose)

一定の時間間隔でサンプリングされた、 各時刻での3次元データファイルから成るファイル群(スナップショット)を struct _3d_data型構造体から成る配列に読み込む。
Read a series of files representing 3-D data at individual time samples that are evenly sampled, called “snapshots”, to an array of struct _3d_data-type structures.


◆形式(Format)

##include <3d_data/readwrite.h>
inline struct _3d_data ∗read_snapshot
(const char ∗inputfileName_format,
 const int size,const double t0,const double dt)


◆引数(Arguments)

inputfileName_format 読み込むスナップショットのファイル名。 時刻部分はフォーマット文字列("%.4f"など)として指定する。
Name of the snapshot files to read, where time is specified as a format string (e.g., "%.4f").
size 読み込むスナップショットの時刻サンプル数。
The number of time samples of the snapshots to read.
t0 読み込むスナップショットの先頭時刻。
The beginning time of the snapshots to read.
dt 読み込むスナップショットの時間間隔。
Time interval of the snapshots to read.


◆戻り値(Return value)

読み込んだスナップショットを 時刻順に(早い時刻のスナップショットほど前の要素に)並べた配列。
An array composed of the snapshots ordered along time; snapshots at earlier time samples are stored into earlier array components.


◆使用例(Example)

struct _3d_data ∗snapshot=read_snapshot("snapshot/t%.1f.3db",11,0.0,0.2);

上の例では以下のように読み込まれる。
In the example above, the snapshots are read into the array components as follows.

ファイル
File
データの読み込み先の配列要素
Array component where the data is to be read
snapshot/t0.0.3dbsnapshot[0]
snapshot/t0.2.3dbsnapshot[1]
snapshot/t0.4.3dbsnapshot[2]


snapshot/t2.0.3dbsnapshot[10]