I have a system that consists of two types of atoms. I am going to study the dynamics of the system for different initial configurations. So I need to control the initial configuration by setting certain seeds. But I have difficulties creating two types of atoms with the same seed. As you know “create_atom” for types 1 and 2 using the same seed leads to explosion.
I get the same result when I create all atoms from type 1 and change the type of a fraction of them using “set” (with the same seed).
Could you please guide me on how I can create two types of atoms with the same seed?
I really dont get why you need the same seed for the 2 atom types.
That does not make much sense, if you create atoms randomly, you don’t gain control over the situation just because you choose a certain seed value over another.
Thank you Simongravelle for your reply.
You are right. However, I am going to run the code for numerous initial configurations. The seed of the distribution is changed in a loop. If I only change the seed for creating type 1 and keep the seed for creating type 2 fixed, or if I use a formula to define seed for type 2 considering seed for type 1(e.g. seed2=a*seed1) always there are cases in which the system explodes. So the solution that came to my mind is that I should create all atoms with the same seed once. I will be thankful if you could help me with how can I deal with this problem.
The system explodes because there is always a risk of overlap when you create atoms randomly in space. I would either delete the overlapping atoms, or do a minimization of energy (which should work unless 2 atoms share the exact same spot, which is not likely to occur unless you use the same seed for both types).
Another alternative is to use fix deposit with the near option, this way you only place atoms where there is space. I use that in this tutorial.
As of LAMMPS version 2 June 2022 the create_atoms command has an option overlap that will accept added atoms only if they have a minimal distance - provided as argument to the option - is given. So, the “explosion” should be avoidable, if done correctly.
Also, another option to produce different configurations, is to run a simulation at fixed volume with a sufficiently high temperature, so the system is liquid and then collect simulation snapshots at regular intervals (a few 10s of picoseconds apart) and use those as starting coordinates. Those can be single atom type systems, or use a different potential (e.g soft), and then the actual composition can be determined with with set type/ratio later.
This all seems simpler and more common and applicable than those strange considerations with random number seeds.
After consideration, the best solution is most likely the one proposed by @akohlmey : using create_atoms with the overlap keyword as well as the maxtry keyword
This command will ensure that the system never explodes while always having the desired number of particles (unless you ask for an unreasonably large density together with a large value of Doverlap).
Thank you Axel for your technical and physical suggestions. Of course, I will try them.
However, now I should say that I have already tried “set type/ratio” and “set type/fraction” which they both require seed. I wonder if there is a way that can change the types of atoms while preserving their positions.
@Fatima this discussion is starting to go in circles and I think the main problem here is that it becomes evident that we are missing too much information about what you are trying to achieve and why. Your description at the beginning is very vague and I am now convinced that part of the problem is that you have drawn some conclusions about what you have to do and why that are incorrect and are now asking for some detail that we cannot give a satisfactory answer for, since it doesn’t exist or doesn’t make sense.
I thus suggest you take a big step back and start all over. Think about what it is that you are trying to do and give us a more concise and complete description, perhaps with some simple, small example input deck (it doesn’t have to be the exact system you are after, but demonstrate the principle of the problem you want to solve. In fact, the simpler, the better as it allows both, you and us, to understand the problem better).