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
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
ckloss | Sat, 06/16/2012 - 11:05
yes, or if you want to viz it
yes, or if you want to viz it you could do that in paraview with the "treshold" filter
Christoph
chrishewitt78 | Mon, 06/18/2012 - 16:51
Number vs time
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?
msbentley | Mon, 06/25/2012 - 15:18
You can also use pizza/python/matplotlib etc.
Don't forget that you can use pizza.py not only for converting to VTK, but to manipulate the dump files afterwards - you can filter and extract all sorts of information, and then directly plot it etc. from within python using e.g. matplotlib.