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.
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.
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 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.
Hello,
As the create_atoms with mesh style will become an immobile or rigid object that would not be time-integrated or moved by “fix move” or “fix rigid”, so is there someway that we can use a moving mesh (stl file) in LAMMPS?
Thank you.
That is not correct. The command creates atoms. Once the atoms are created, there is no knowledge in LAMMPS how they were created, so they can be treated just as any atoms. That includes fix move and fix rigid.
Emmm, I’m more confused now.
However, it would be amazing if the particles created from the STL file could be treated as other atoms like you said.
I hope the documentation is wrong. Can you look through it, please?
Thanks a lot.
There is no contradiction here. The note is a hint that for typical use cases, where you don’t need to compute the forces between the created atoms and thus you can save a lot of CPU time. https://youtube.com/watch?v=STsJQrncw8s is one such example where there are more atoms in the mesh created part than the rest. Yet those (gray) atoms are still subject to fix move to have the rotation.