Update to richti83 visualisation script for super quadric particles

Submitted by martin.kozakovic on Sat, 12/14/2019 - 10:20

Jan Evangelista Purkyně University in Ústí nad Labem, Faculty of Science, Pasteurova 3632/15, 400 96 Ústí nad Labem, Czech Republic https://prf.ujep.cz/en/

Team leader: Jaromir Havlica (havlica@icpf.cas.cz)

Superquadric visualiser:

******************************************
Changes:
v2.0
* Multiple types and sizes of superquadric particles in single file
* Automatically included variables
* Toroid representation switch - fixed height and surface area
* Optional data skipping
* Removed precision switch - decided by input data
v1.1
* GUI interface
* Two versions - custom/vtk source, custom lpp/vtk source
* Fixed height toroid representation
v1.0
* Initial release based on richti's code
******************************************
Requirements:
* Requires Paraview v4.0.1 and newer
******************************************
Notes:
* Liggghts vtk and lpp converted vtk files have different structure - use appropriate xml version
* Some parameters can have different names in older LIGGGHTS versions (TENSOR=M, etc. - check advanced settings in script to edit property names)
* You may need to change initial rotation of superquadric particle - in newer Paraview versions main axis is set to Y (default) instead of Z
* Tested on Paraview 5.5.0, 5.6.0 x64
******************************************
Sources:

* custom/vtk dump with defined values
dump dmp all custom/vtk 100 post/dump*.superq.vtk id type mass x y z vx vy vz fx fy fz omegax omegay omegaz radius shapex shapey shapez quat1 quat2 quat3 quat4 blockiness1 blockiness2 tqx tqy tqz angmomx angmomy angmomz

Minimal requirements: x y z blockiness1 blockiness2 shapex shapey shapez quat1 quat2 quat3 quat4

* custom dump with defined values
dump dmp all custom 100 post/dump*.superq id type mass x y z vx vy vz fx fy fz omegax omegay omegaz radius shapex shapey shapez quat1 quat2 quat3 quat4 blockiness1 blockiness2 tqx tqy tqz angmomx angmomy angmomz

Minimal requirements: x y z blockiness1 blockiness2 shapex shapey shapez quat1 quat2 quat3 quat4

Convert via lpp tool into vtk afterwards
cd post
lpp dump*.superq
******************************************
Usage:

* Paraview with VTK superquadric support and xml plugins support

-1) Load plugins - can be auto-loaded next time

Tools - Manage Plugins - Load New - LiggghtsSuperquadricVTK.xml
Tools - Manage Plugins - Load New - LiggghtsSuperquadricDUMP.xml

0) Open dump*.superq.vtk or superq*.vtk

1) Select dump

2) Filters -> Alphabetical -> LIGGGHTS - Superquadric visualiser (VTK) or LIGGGHTS - Superquadric visualiser (DUMP)

3) Done

* Paraview with VTK superquadric support

In case of incompatible version of Paraview for xml filter

0) Open dump*.superq.vtk or superq*.vtk

1) Select dump

2) Filters -> Alphabetical -> Programmable Filter

Select output as vtkUnstructuredGrid
Input python data from specified .py file

3) Done
******************************************

martin.kozakovic | Fri, 03/27/2020 - 18:08

We have updated the visualising scripts, to be even more easy to use and simply edited, when only few parameters have to be changed. We have also included correct height calculation for toroid representation. We have also find out, that custom/vtk and custom dump (when converted via lpp tool first to vtk) produces slightly different formats - therefore two versions are included.

Behradesk | Thu, 07/23/2020 - 22:42

Many thanks for your easy way to visualize the superquadrics in paraview.
I performed the mentioned steps, but when I apply the programmable python filter or the xml plugin in paraview 5.4.1, it gives this error :"NameError: global name 'sqrt' is not defined."
I checked the python script there were 5 'sqrt's which had been used for calculating the velocity, torque force and ... of the particles.
Can you guide me to solve this error?

Dheeraj420 | Tue, 08/11/2020 - 09:24

Hello experts,
I ran an example of cylinder with cubical particles using above filers, working completely fine. Even if i changed the particle shape i.e cylindrical that time also it is working fine. When i add the filter for my own case i.e predicting flow behavior of cylindrical particles inside screw feeder it is showing an error.

AttributeError: 'NoneType' object has no attribute 'GetComponent'
Traceback (most recent call last):
File "", line 22, in
File "", line 81, in RequestData
AttributeError: 'NoneType' object has no attribute 'GetValue'

Can someone please provide the assistance, help will be very much appreciated. If need any other file please comment.

Thanks

martin.kozakovic | Thu, 10/29/2020 - 19:47

Scripts updated to new versions. Missing sqrt should be fixed - not needed now, AttributeError: 'NoneType' object has no attribute 'GetValue' is caused, when requested field does not exist or its is badly named (id, type, ....), new scripts have less minimal dependence now.

Sherif | Sat, 06/05/2021 - 23:39

After I add the filter to my dump file I get this error:

ModuleNotFoundError: No module named 'paraview'

I appreciate any help.