What is real Legacy vtk mesh that region mesh/tet supports?

Submitted by keepfit on Fri, 11/22/2013 - 02:07

Hi Chris,

as the command "region ID mest/tet xx.vtk ..." needs a volume legacy VTK file. What I am really confused is that, what is a real legacy vtk mesh that LIGGGHTS supports? And how to make/convert STL mesh to this type of mesh?

Importing STL file into paraview, and save as Legacy VTK, but it is

# vtk DataFile Version 3.0

and using gmsh -2 xxx.stl -o xxx.vtk, it's

# vtk DataFile Version 2.0.
region inReg mesh/tet file file.vtk scale 1 move 0. 0. 0. rotate 0. 0. 0. units box
-------------------
......
Note: Skipping empty line in VTK mesh file
Note: Skipping empty line in VTK mesh file
Note: Skipping empty line in VTK mesh file
WARNING: VTK file contains other types than tetrahedra - only tets are currently supported in LIGGGHTS, other cells are discarded (input_mesh_tet.cpp:276)
Setting up run ...
INFO: Resetting random generator for region inReg
ERROR: Unable to calculate region volume. Possible sources of error:
(a) region volume is too small or out of domain
(b) particles for insertion are too large when using all_in yes
(c) region is 2d, but should be 3d (region.cpp:600)
........
---------------------
The vtk(2.0) mesh is a closed (volume) 3D surface Mesh, and inserting particle is small enough, but why there are so many errors? (please take a look at the attached vtk mesh)

So could you please give me an example of "real" legacy VTK file?

Kind regards,

David

AttachmentSize
Binary Data file.vtk_.tar_.gz31.78 KB

litomec | Wed, 03/11/2015 - 16:27

I'm new, and I'm really at a loss as to how to transform files. I tried Christoph program, but I failed to use the program.

Kind regards

Guillermo

richti83's picture

richti83 | Thu, 03/12/2015 - 16:19

in unix you can often help your self with man PROGRAMMNAME or PROGRAMMNAME -h
I can realy better help you when you provide some outputinfo, the mesh itself and the things you allready tried. (edit: ok I found a mesh in the initial question, but from keepfit ..).

Keep in mind that it may be impossible to generate a volume out of a unclosed surface mesh because the programm can not know where the tetraeder should start and end.
A good idea is to start with a simple testcase.
Create a Source->Box in paraview, Save Data as VTK***. (this will result in a SURFACE mesh, because for PV a box consits of six quadratic planes and not of two tetrateder ! so from vtk point of view it is a surface and not a volume).
Than tetgen the box.vtk .(this should produce a volume mesh you can use in liggghts).
When this works you can make the body more complex (add a source->Zylinder, Fiter->append datasets, save & tetgen) ..
when you are familar with the procedure you can start using a complex volume made by CAD or whatever.

edit: I downloaded the tar archive and run it with tetgen 1.5.1. beta. Something seems wrong with the mesh, I got only 0 tets generated. I remeshed it with gmsh to a STL file to make sure only triangles are in it.

gmsh -2 -o file.stl file.vtk #means: mesh 2D -output file.STL input file.VTK

and that used
tetgen -k file.stl
result:

dem@T7611:~/sandbox$ /home/dem/Downloads/tetgen1.5.1-beta1/tetgen -k file.stl
Opening file.stl.
Delaunizing vertices...
Delaunay seconds: 0.04
Creating surface mesh ...
Jettisoning redundant points.
Surface mesh seconds: 0
Constrained Delaunay...
Constrained Delaunay seconds: 0
Removing exterior tetrahedra ...
Exterior tets removal seconds: 0
Optimizing mesh...
Optimization seconds: 0
Writing file.1.node.
Writing file.1.ele.
Writing file.1.face.
Writing file.1.edge.
Writing file.1.smesh.
Writing file.1.vtk.
Output seconds: 0.03
Total running seconds: 0.07
Statistics:
Input points: 9216
Input facets: 3072
Input segments: 4566
Input holes: 0
Input regions: 0
Mesh points: 1709
Mesh tetrahedra: 5709
Mesh faces: 13125
Mesh faces on exterior boundary: 3414
Mesh faces on input facets: 3414
Mesh edges on input segments: 4737
Steiner points on input segments: 171

And now opening the file in PV, create new view spreadsheet, select Attribute->cell Data and tada: Cell type is Tetrahedron

you can DL the result here:
http://www.richtisoft.de/transfer/surface2volume.zip

I would be happy about a small donation to christian@richtisoft.de for solving this issue for you.

Best Christian

***It is not a good idea to store STL from PV-sources, because the writer only exports half of the mesh because of a bug, in 4.3.1 you simply can not export quad elements to stl.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

hunger's picture

hunger | Wed, 12/02/2015 - 18:09

Hi all!

I tried to use the region mesh/tet command for particle generation. However, an error already occurs when LIGGGHTS is reading the VTK file:

Note: Skipping empty line in VTK Mesh file
Note: Skipping empty line in VTK Mesh file
Note: Skipping empty line in VTK Mesh file
Note: Skipping empty line in VTK Mesh file
ERROR on proc 1: unrecognized (../region_mesh_tet.cpp:591)

I have generated the VTK file using tetgen as explained above. The command I used to create the region is:

region Vol mesh/tet file mesh/Volume.1.vtk scale 0.001 move 0. 0. 0. rotate 0. 0. 0. units box

I am running out of ideas how to solve the problem. I appreciate any recommendation! (if some important information to find a solution is missing please just let me know!)

Best regards
Harald

Best regards
Harald

ckloss's picture

ckloss | Thu, 12/10/2015 - 22:18

Hi Harald,

I am aware that "unrecognized" is not the best feed-back of a code :-)
I would suggest you compare your file structure with the one from the public tutorial!
This should make it clear where the problem is...

best wishes
Christoph