What is the output file format of grainextract?

Asked by Dion Weatherley


(A re-direction from this question thread:

> Could You also describe the file generated by grainextract command?

Question information

English Edit question
ESyS-Particle Edit question
No assignee Edit question
Solved by:
Dion Weatherley
Last query:
Last reply:
Revision history for this message
Dion Weatherley (d-weatherley) said :


Grainextract is a tool to identify clusters of DEM particles joined together via bonded interactions to form a "fragment" or "grain". Given a snapshot/checkpoint file for a specified timestep of an ESyS-Particle simulation, grainextract determines the number of such grains, their mass and effective radius. Statistics on these grains can be output in a large range of formats depending on the application of interest, as described here:

grainextract works on individual snapshots rather than a range of snapshots. It also has a wide range of output options. Two of the most common usages are the following:

1) add grain mass and grain ID to snapshot VTK files:
A) generate a grains list (identifying which particles belong to each grain/fragment) at timestep number 10000:

grainextract -i snapshot_t=10000_0.txt -list grains.list

B) generate VTK files using dump2vtk, providing the grains list as an argument:

dump2vtk -i snapshot -o snaps_ -rot -t 0 251 1000 -list grains.list

2) generate a list of grain masses (useful for constructing fragment size-distributions) at timestep number 10000:
grainextract -i snapshot_t=10000_0.txt -om grainMass_t=10K.txt

Herein I will describe the output formats for these two cases.

Firstly, the '-list' argument to grainextract, will result in an output file that looks similar to this:
39 1 60.8865
40 1 60.8865
41 1 60.8865
46 1 60.8865
47 1 60.8865
48 1 60.8865
49 1 60.8865
50 1 60.8865
51 1 60.8865
52 1 60.8865

The three columns of this file are:
[particle ID] [grain ID] [grain mass]

where [particle ID] is the unique ID assigned to each particle, [grain ID] is the unique ID assigned to each grain/fragment and [grain mass] is the sum of the masses of the particles comprising that grain/fragment.

The '-om' argument to grainextract produces a different output file that looks like this:
0 60.8865
1 0.567243
2 4.86614
3 1.6946
4 0.00552483
5 0.140438
6 0.390951
7 0.018753
8 0.00869684
9 0.0104138

where each line is in the format:
[grain ID] [grain mass]

This second format is useful for post-processing to produce graphs of grain/fragment size distributions, for example.

I hope this helps.