"Bad mesh, cannot continue" in blend_mixer

Submitted by zhang947 on Thu, 02/04/2016 - 01:23

I am learning to use liggghts with tutorial examples.
The example of continuous blending mixer does not go through compiling and always gives an error of:

"WARNING: It is heavily recommended to use 'neigh_modify delay 0' with granular pair styles (../pair_gran.cpp:223)
Setting up run ...
Mesh cad1: 785 elements have high aspect ratio (soft limit: smallest angle > 0.500000 ° required)
WARNING: Fix mesh: Mesh contains highly skewed element, moving mesh (if used) will not parallelize well (../surface_mesh_I.h:575)
Mesh cad1: 221 mesh elements have a really unreasonably high aspect ratio (hard limit: smallest angle must be > 0.181185 °)
ERROR on proc 0: Fix mesh: Bad mesh, cannot continue. You will need to fix or remove these element. Remedies:
- You can use the 'element_exclusion_list' feature to remove elements with too many neighbors and elements with angles below the hard limit
(../surface_mesh_I.h:602)"
I added "heal auto_remove_duplicates" as suggested.
Please help. Any input is appreciated.
(The code is attached.)

Thanks.
Jing

Here is the displayed lines from running to error messages.
"
$ ./lmp_serial
LIGGGHTS (Version LIGGGHTS-PUBLIC 3.3.1, compiled 2016-01-15-10:28:32 by Administrator, git commit 99507f5217ad4fd4be5107d6262bd7274c9a5c03 based on LAMMPS 23 Nov 2013)
jump in.blend_mixer
Created orthogonal box = (-0.32 -1.96 -0.29) to (0.32 1.46 0.335)
1 by 1 by 1 MPI processor grid
Fix particledistribution/discrete (id pdd): distribution based on mass%:
pts: d=1.000000e-02 (max. bounding sphere) mass%=100.000000%
Fix particledistribution/discrete (id pdd): distribution based on number%:
pts: d=1.000000e-02 (max. bounding sphere) number%=100.000000%

Reading STL file 'meshes/trough2n.stl'

Reading STL file 'meshes/left_shaft2n.stl'

Reading STL file 'meshes/right_shaft2n.stl'
WARNING: It is heavily recommended to use 'neigh_modify delay 0' with granular pair styles (../pair_gran.cpp:223)
Setting up run ...
Mesh cad1: 785 elements have high aspect ratio (soft limit: smallest angle > 0.500000 ° required)
WARNING: Fix mesh: Mesh contains highly skewed element, moving mesh (if used) will not parallelize well (../surface_mesh_I.h:575)
Mesh cad1: 221 mesh elements have a really unreasonably high aspect ratio (hard limit: smallest angle must be > 0.181185 °)
ERROR on proc 0: Fix mesh: Bad mesh, cannot continue. You will need to fix or remove these element. Remedies:
- You can use the 'element_exclusion_list' feature to remove elements with too many neighbors and elements with angles below the hard limit
(../surface_mesh_I.h:602)
"

AttachmentSize
Plain text icon in.blend_mixer.txt3.09 KB

megoplay20 | Thu, 02/04/2016 - 04:00

When I was faced this problem I modified my STL files using some 3rd party software like MeshLab.
After using some filters from MeshLab these errors were gone.

P.S. Try to replace STL meshes with simpler ones and see wheather or not it will change your output errors. if it is then you can think of using MeshLab to modify your STLs.

zhang947 | Thu, 02/04/2016 - 05:09

I used a simple box to replace the trough and cylinders to replace the shafts. The code can run.
Then I used netfab to check the stl files provided with the example, the software did not detect any errors in the files.
Do you have any more ideas?
Thanks very much.

Jing

megoplay20 | Thu, 02/04/2016 - 10:44

My experience with netfab shows that it does not always detect errors in STLs (even if there are some errors).
So my advise is to try to smooth the surface (STL) using some filters from MeshLab or similar software.

zhang947 | Fri, 02/05/2016 - 06:39

I had smoothed the surface but the simulation still has errors. The remedy provided by the code is to use: " Remedies:
- You can use the 'element_exclusion_list' feature to remove elements with too many neighbors and elements with angles below the hard limit
".
Do you know how to apply the command of element_exclusion_list?
I could not find an example.

Thanks.

(Also, the manual says surface mesh quality check is stricter now. "Surface mesh import via fix mesh/surface has now stricter quality criteria and automated remedy: Now elements with a very small angle (< 0.18°) throw an error upon import. You can automatically take care of such cases by excluding such elements from the mesh using the element_exclusion_list feature. This exclusion list now works for both too many neighs per element and elements with angles < 0.18° which do not fulfill the quality criteria. See doc of fix mesh/surface for details")

Bruno.Brunel | Tue, 12/12/2017 - 15:44

Hi Jing,

I hope you have the answer by now, but writing it down for anyone who might face this in the future:

First run liggghts with:
# Import mesh from cad:
fix cad1 all mesh/surface file mesh/trough2.stl type 1 element_exclusion_list write mesh/trough2.exclude scale 0.001 curvature 1e-5
fix cad2 all mesh/surface file mesh/left_shaft2.stl type 1 element_exclusion_list write mesh/left_shaft2.exclude scale 0.001 curvature 1e-5
fix cad3 all mesh/surface file mesh/right_shaft2.stl type 1 element_exclusion_list write mesh/right_shaft2.exclude scale 0.001 curvature 1e-5

It will fail once for cad1, so you can now read the exclusion list as follows in the second run:
# Import mesh from cad:
fix cad1 all mesh/surface file mesh/trough2.stl type 1 element_exclusion_list read mesh/trough2.exclude scale 0.001 curvature 1e-5
fix cad2 all mesh/surface file mesh/left_shaft2.stl type 1 element_exclusion_list write mesh/left_shaft2.exclude scale 0.001 curvature 1e-5
fix cad3 all mesh/surface file mesh/right_shaft2.stl type 1 element_exclusion_list write mesh/right_shaft2.exclude scale 0.001 curvature 1e-5

Repeat the process until all exclusion lists are written and the final section will be:
# Import mesh from cad:
fix cad1 all mesh/surface file mesh/trough2.stl type 1 element_exclusion_list read mesh/trough2.exclude scale 0.001 curvature 1e-5
fix cad2 all mesh/surface file mesh/left_shaft2.stl type 1 element_exclusion_list read mesh/left_shaft2.exclude scale 0.001 curvature 1e-5
fix cad3 all mesh/surface file mesh/right_shaft2.stl type 1 element_exclusion_list read mesh/right_shaft2.exclude scale 0.001 curvature 1e-5

The example should then run fine. (Note that I have put the stl files in a mesh subdirectory).

Regards,

Bruno

Franklin Bettencourt | Tue, 11/15/2016 - 22:34

Hello I have the same/ a very similar problem as was posted at the beginning of this thread. I was wondering which Meshlab filters you utilize to fix your geometry? I have heard Meshlab is a very good tool for solving this problem but was hoping to get a little more insight into your methods of using it to correct your mesh.