Skip to content

Counters and Barycenters

particle_counter

Counts the number of particles per type in a region.

Parameter Description
name output file, default ParticleCounter.txt
types particle types, e.g. [0, 1, 2] (required)
region region, default the whole domain

Add it to the analyses batch (see example/polyhedra/analyses/particle_counter.msp):

1
2
3
4
5
6
7
8
global:
  simulation_analyses_frequency: 10000

analyses:
  - particle_counter:
     name: "ParticleTypes0And1.txt"
     types: [0, 1]
     region: BOX

With gnuplot:

1
2
3
set key autotitle columnhead
set style data lines
plot for [i=2:3] 'ExaDEMOutputDir/ExaDEMAnalyses/ParticleTypes0And1.txt' using 1:i smooth mcsplines

particle_barycenter

Computes the barycenter of the particles of each type in a region.

Parameter Description
name output file, default ParticleBarycenter.txt
types particle types, e.g. [0, 1, 2] (required)
region region, default the whole domain

Add it to the analyses batch (see example/polyhedra/analyses/particle_barycenter.msp):

global:
  simulation_analyses_frequency: 10000

analyses:
  - particle_barycenter:
     name: BaraycenterBox.txt
     types: [0, 1]
     region: BOX
  - particle_barycenter:
     name: Baraycenter.txt
     types: [0, 1]

With gnuplot:

set key autotitle columnhead
set style data lines
set title "Barycenter per particle type"
set xlabel "Position X"
set ylabel "Position Z"
plot "PolyhedraAnalysisBarycenterDir/ExaDEMAnalyses/Baraycenter.txt" u 2:4 w l title "Poly"
replot "PolyhedraAnalysisBarycenterDir/ExaDEMAnalyses/Baraycenter.txt" u 5:7 w l title "Octahedron"
set terminal png
set output "barycenter_plot.png"
replot