Counting the number of particles experiencing a force greater than 10N

Submitted by chrishewitt78 on Fri, 06/15/2012 - 17:10

Hi I've created a simulation where a small fraction of the overall number of particle in the simulation experience a large force relative to the other particle in the simulation. Does anyone know if it is possible to get LIGGGHTS to count the number of particles experiencing a force greater than say fior example 10N? I guess this could be done using a logic statment but i'm not sure how to go about it.

moritzhoefert | Fri, 06/15/2012 - 18:53

You could do that in a post-processing step. If you use dump custom and dump the force components as, say, 13th, 14th and 15th item into files called state* you can count the particles as follows:

cat state1000 | awk '/^ *[0-9]+ +[0-9]+/ {if($13*$13+$14*$14+$15*$15 > 100) print "something"}' | wc -l

Cheers,
Moritz

chrishewitt78 | Mon, 06/18/2012 - 16:51

Thanx for you suggestions, on balance I'd prefer to use paraview as this would allow me to make a good jugment of the threshold based on the visulisation, prior to post processing. Also really I want to plot the number of particle over a threshold vs time to ensure i've reached a steady state. Can I do this with the "treshold" filter in paraview?