The order in which particles are stored in bi4 files

Dear All

I want to know the storage order of particles in the BI4 file, because I originally thought that particles were stored in the file according to the order of Idp, but when the CSV file was exported, the particles were not stored in the order of Idp, nor in the order of X coordinates. Could you please tell me in what order they were stored in the file?

The following two pictures are exported CSV. It can be seen that in the first picture, particles with Idp =7 are ranked in the first line of the file, but particles with Idp =0 are ranked in the 340th line. Besides, the x coordinate of particles with Idp =7 is larger than that of particles with dp =0.

Looking forward to your early reply

Comments

  • Particles are reordered (Ridp) according to the order cells were created. This follows a special order X,Y,Z.

    The CSV file follows the order of Ridp.

    In addition there is an array of cells with the first Ridp of the first particle in each cell, so that it is easy to know the particles inside each of the cells.

    If you need more information about this you can ask @jmdalonso

  • Does this arrangement mean that the line numbers of particles in the BI4 file output at each time step are not fixed?

  • How particles are ordered in the bi4 is not relevant, since you just need to read the idp array, then you will get an understanding of each particle.

    Do note that there is no guarantee that particles are stored in the same way in different bi4 files, therefore you must read the idp array for each bi4 file.

    You can look at some code here:

    https://github.com/AhmedSalih3d/PostSPH.jl/blob/develop/src/PostSPH.jl

    Function on line 65

    Kind regards

  • thank you for reply

    I have another question,If I want to draw the pressure time curve of a particular point directly from the BI4 file, do I have to look for this point according to IDP in the BI4 file of each time step output?My original idea was that if the position of this point was fixed in the bi4 file output for each time step, the job of finding this point would be much faster.

Sign In or Register to comment.