Create 3 layers of particles

Submitted by bprasad on Fri, 02/24/2017 - 13:30

Hallo,

I have created one layer of particle by using the following statements:

region bc block -0.03 0.018 -0.000 0.025 0.038 0.050 units box
lattice sc 0.005
create_atoms 1 region bc
group bonded region bc
set group all density 25000 diameter 0.005
set group all vz -0.8 vx 0

Now i am interested in creating three layers of the particles of the same dimension, but i do not have any idea how i can do this. I am very new to LIGGGHTS software and i will grateful if anyone can help me out.

Thanking You
Braj

Rector | Fri, 03/03/2017 - 15:00

Hi Braj,

One approach that I found to work for me was using the create_atom command with the style set to single in which I added the coordinates of the single atom that I wanted to create. I then simply generated several lines in a script for all the atoms that I wanted to create and simply used the include command to include that file. In some cases I wanted to create thousands of particles so I simply generated the script to include in my main liggghts script using Matlab (any other language could work e.g. python, c, c++, etc). I found that this way of creating these atoms gave me complete control of where I wanted to place these atoms.

I do however realise that there might be other ways of achieving what you want without doing what I did. :) I simply failed to do what I wanted for my particular problem any other way. And since only a few lines of Matlab code helped me create the script I wanted to insert into my main script, it was simpler that way.

My scripts looked something like this:

create_atoms 1 single 0.039992 0.020328 0.000664
create_atoms 1 single 0.039948 0.021656 0.000664
create_atoms 1 single 0.039813 0.022977 0.000664
create_atoms 1 single 0.039590 0.024287 0.000664
create_atoms 1 single 0.039279 0.025578 0.000664
create_atoms 1 single 0.038881 0.026845 0.000664
create_atoms 1 single 0.038399 0.028083 0.000664
create_atoms 1 single 0.037834 0.029285 0.000664
create_atoms 1 single 0.037189 0.030447 0.000664
create_atoms 1 single 0.036468 0.031562 0.000664
create_atoms 1 single 0.035673 0.032626 0.000664
create_atoms 1 single 0.034807 0.033634 0.000664
create_atoms 1 single 0.033876 0.034581 0.000664
----
----
----
create_atoms 1 single 0.012270 0.038265 0.075435
create_atoms 1 single 0.011077 0.037680 0.075435
create_atoms 1 single 0.009927 0.037016 0.075435

Hopefully there will be better answers in this forum. :)

Best wishes,
Rector