Create_atoms STL file troubleshooting

Hello LAMMPS users,

I recently tried to use the create_atoms command to generate a complex geometry using an STL file (a mixer). I was unsuccessful in getting the geometry to render. For reference, I copied the command from the documentation

create_atoms 1 mesh open_box.stl meshmode qrand 0.1 units box

and inserted my own STL file. Does anyone know of some general troubleshooting tips to deal with an STL file that isn’t rendering (wrong command, wrong parameters, faulty STL file, etc.)? I’m not looking for anything specific, just some general tips for troubleshooting.

Thank you in advance for any assistance.

What do you mean by this?

Copying a command is rarely a good idea, instead you should study the documentation and look at what meaning individual parameters mean and how that would apply to your specific case.

There isn’t much that can be said along those lines. If the command has an incorrect syntax, you should get an error message. Whether the STL file is unsuitable cannot be said from remote. Whether parameters are incorrect is impossible to say at this general level, too.

The input file ran without issue, the geometry just didn’t appear, nor did any region present itself. For reference, I put the create_atoms line in the pour.drum example, so it’s possible something farther down the code is interfering.

I didn’t find too much in the documentation besides just a general explanation on how the mesh system worked, which I thought was represented well with the example line. I unfortunately don’t have the STL file on me.

At the very least, there should be a few lines in the output showing how many atoms were created, if any.
There are two examples in the examples/mesh folder.
The output of in.mesh_box has:

create_atoms    2 mesh open_box.stl meshmode qrand 0.1 units box
Reading STL object Open Box from text file open_box.stl
  read 10 triangles with 500.00 atoms per triangle added in quasi-random mode
Created 5000 atoms
  using box units in orthogonal box = (50 50 50) to (250 250 250)
  create_atoms CPU = 0.001 seconds

The output of in.marble_race has:

create_atoms    2 mesh race_track.stl units box
Reading STL object Georgs Murmelbahn from text file race_track.stl
  read 9472 triangles with 1.00 atoms per triangle added in recursive bisection mode
Created 9472 atoms
  using box units in orthogonal box = (-110 -30 -90) to (60 220 130)
  create_atoms CPU = 0.082 seconds

If there are no atoms created for your file, you need to check whether the STL geometry is inside the simulation box that you have defined.

Found the issue. I didn’t realize that the STL file had to be ASCII-formatted. Thanks for the assistance.

LAMMPS is supposed to be able to read read text-mode and binary STL files. Thus, please provide a copy of the file before and after you converted it, so we can debug the STL reader code and improve it.

Thanks.

Funnel.stl is the binary file, Funnelascii.stl is the ASCII version.

Funnel.stl (28.6 KB)
Funnelascii.stl (152.5 KB)

Conversion was done using SolidEdge.

1 Like

Thanks for the files. There was a bug in correctly detecting the binary file as binary file and thus LAMMPS was trying to read it as text and thus could not find any triangles.

This will be fixed in the next release of LAMMPS.

There is a converter (stl_bin2txt) also included in LAMMPS in the tools folder. Since the converter assumes binary STL files as input it is not subject to the bug in the create_atoms code in LAMMPS.