Format for Particle


Panels for format setting is shown in property panel by clicking format icon.



File format for particle data is assumed to be composed of two parts, header and body. Header has information about the entire file, particle number and time etc. Body has information for each particle, position x,y,z or particle size etc.

Format.Main

Main panel is for basic settings for file format.

Type

File type must be ascii or binary.

Interpolate

Interpolation between snapshots. Most common interpolation is linear. In step interpolation, particles would be not interpolated between snapshots and particles jump between snapshots.
The most smooth interpolation is Hermite interpolation. It uses postion and velocity at each snapshots.
Bezier interpolation uses position data of 4 snapshots instead of 2. Bzeier (smooth) add some modification to basic Bezier way to interpolate more smoothly for particles that changes its velocity steeply.

Hermite (red) and Bezier (blue) interpolation for particle that rotates in circular way, with sparse snapshots.

Hermite is better for such situations, but it require additional velocity information.

Array Direction

In the body part, particle data is stored in loops of data component and particle indices.
But there can be two possible way in the order of loop. This parameter determines the order of loops.

We assuming that x0 indicates x of particle 0.
Data may be stored as x0, y0, z0, x1, y1, z1, x2, y2, z2, and so on.
We call this type of loop as horizontal. Sometimes, data is stored in different way.
For example, x0, x1, x2, ....., y0, y1, y2, ..... z0, z1, z2, and so on.
We call this type of loop as vertical.

Disappear

A way for a particle to disappear when no particle with same ID exists in next snapshot data.
Three way of dissapearing is implemented. One way is to show the particles until nest snapshot, another way is to remove them imidiately (or set size to 0), and final way is to decrease their size linearly to 0.
Since position of particle can not be interpolated, (since no data exist in next time step), you must select the way to extrapolate the location of particle. One way is to show them statisticly, and another way is to extrapolate them linearly.

Sort by ID

To handle particles by ID instead of its index, the data should be sorted by ID. Otherwise, it takes very long time to search particles with same ID, which affects performance severely.
If data is not sorted, you can sort them when reading data. Sorting takes some time, but much better than taking time for searcing ID in interpolation process repeatedly. If data is sorted beforehand, you should not check this.

Remove Dupli ID

Particle ID should not have overlapping. But I noticed that some data have duplicated ID particles for some reason, perhaps due to bugs in their simulation.
When this checkbox is checked, particles with duplicated ID would be removed when reading. This process saves movie from severe artifact some times.

Editing Header/Body

You can select the components of data by dropdown combobox. [+] button inserts a new component, and [x] button deletes the component.
These items can be moved by the upward and downward triangle buttons.

Format items



The types of format items is shown in the above image.
Value0-2 are arbitrary valiables used for coloring. Typically, temperature or other physical parameters. Three data slots are perpared.

Dummy is used for for skip data reading. Often, pysical parameters that are not necessary for visualize is stored in simulation data. This dummy items are used to skip them.

ID and variable particle number

If particle number for each step is variable, i.e. particles are generated or deleted between steps, we can not assume that particle with index 0 in step 0 and particle index 0 in step 1 is identical one.
In such a case, ID is necessary for interpolation. ID is used to search which particle is which.

In Zindaij4, particles larger than maximum integer (about 2.1 Billion) can not be handled. However ID can be greather than the maximum in large simulations even if total number is less than the maximum.
Thus, ID (long long) slot is prepared for special case.

Format Sample

Binary



This is a sample of format of binary data. Assumte that array direction is horizontal.
In binary data, data is packed seamlessly. Thus, the data is binary sequence as following.
Particle number (integer), Time (float), x0 (float), y0 (float), z0(float), type0(int), size0(float), x1 (float), y1 (float), y1(float), type1(float), size1(float) ... reapeat for particle number.

If particle number is omitted, it woule be estimated from file size. If time is omitted, it is assumed to be equal to file sequence index.

Ascii



In ascii files, data is split by space, and each particle is split by line feed.
Thus, the data format corresponds to above sample is
number
time
x0 y0 z0 type0 size0
x1 y1 z1 type1 size1
... repat for particlce number
If particle nuber is omitted, it would be estimated from total line number.

Vertical case

In the case that array direction is set vertical, the format corresponds to above sample is
number
time
x0 y0 z0
x1 y1 z1
... repat for particlce number
type0
type1
... repat for particlce number
size0
size1
... repat for particlce number

return
inserted by FC2 system