Pizza.py WWW Site - Pizza.py Documentation - Pizza.py Tools

lpp tool

Purpose:

This is lpp (liggghts post processing), an update to pizza.py offering better visualization of granular (DEM) LIGGGHTS or LAMMPS simulations using pizza.py via VTK files


Description:

This update provides the possibilty to convert LIGGGHTS/LAMMPS dump files to VTK exporting:

  • particle radius,
  • particle velocity and rotational velocity vector,
  • particle force and torque vector,
  • customized vectors (e.g. calculated by a fix, compute or variable)
  • customized scalars (e.g. calculated by a fix, compute or variable)

    where the names are automatically assigned.

    The lpp tool runs in parallel (shared-memory) using the python "multiprocessing" tool. The number of processors can be controlled via command line args (see below).

    Additionally, the simulation box is also exported into VTK format and stored in an "*_boundingBox.vtk" file


    Prerequisites for Usage:

    To be able to use the lpp tool, please use a dump custom command like the following in your LIGGGHTS/LAMMPS input script:

    dump d0 all custom 100 dump*.example id type x y z ix iy iz vx vy vz fx fy fz 
    omegax omegay omegaz radius (customScalars) (customVectors) 
    

    It is mandatory to use "x y z" in the dump custom command. The dump file generated by LIGGGHTS/LAMMPS will look like this:

    ITEM: TIMESTEP
    5000
    ITEM: NUMBER OF ATOMS
    2988
    ITEM: BOX BOUNDS
    -0.05 0.05
    -0.05 0.05
    0 0.6
    ITEM: ATOMS id type x y z vx vy vz fx fy fz omegax omegay omegaz radius 
    

    The last line contains the name strings for the per-atom quanitites. If the syntax of a name string triple of names meets one of the following specifications this triple is recognized as a vector:

  • f_vectorname[i] f_vectorname[i+1] f_vectorname[i+2]
  • c_vectorname[i] c_vectorname[i+1] c_vectorname[i+2]
  • v_vectorname[i] v_vectorname[i+1] v_vectorname[i+2]
  • vectornamex vectornamey vectornamez

    "vectorname" can be any name (e.g. "v" for velocity, "tq" for torque, etc., a fix or compute id, or a per-atom variable name.)

    All other quantities are recognized as scalars.


    Usage:

    After the simulation is finished, type "lpp dump.mySimulation" where "dump.mySimulation" has to be replaced the name of your dump file or type "lpp dump*.mySimulation"

    For more command line options, see below.

    Now open paraview (www.paraview.org) and import the VTK files. To display the particles correctly, you should first create a glyph by clicking on the "glyph" button and then in the object inspector:

  • Choose Scalars -->"radius"
  • Glyph type -->"Sphere"
  • Radius -->"1"
  • Scale mode -->"Scalar"
  • Set Scale Factor -->"1"

    In a similar fashion, you can set up vector glyphs to visualize velocity etc.


    Command Line Options:

    A few command line options are avaliable to control lpp:

    -o fname : define output file names (default is liggghts + timestep number). This option can also be used to write to a specified folder, eg. "lpp -o foo/bar dump*" will create files bar1000.vtk, bar2000.vtk etc. in the directory ./foo while "lpp -o foo/ dump*" will create files named liggghts1000.vtk, ligggghts2000.vtk etc. in ./foo (providing the directory exists, lpp will not create any directories for you!)

    --chunksize : sets the amount of dumpfiles processed per chunk, the default is 8. Increasing the chunksize can improve performance, but the chunksize is limited by the amount of RAM on your system. Also keep in mind that multiple chunks may be processed depending on your --cpunum settings, and thus RAM demand is multiplied.

    --cpunum : sets the number of processes to start, default (and maximum) is the amount of cpu cores avaliable at your system.

    --debug : prints debug information, usually not needed

    --help : writes a help message and exits

    --no-overwrite : if set lpp does not process dump-files that have already been converted, i.e. where the vtk-file already exists.

    --quiet : suppresses all output but error messages (also discards --debug)


    Related tools:

    vtk, dump,


    Prerequisites:

    Python multiprocessing library (new in python 2.6)