Closed c-uiiin closed 10 months ago
Dear Sir,
I was able to run your script and reproduce what you describe. It all boils down to the way data is written in LAMMPS data file.
In your script, you manipulate V and W atoms. But when writing the final file (in LAMMPS data format *.lmp), this format does not allow writing atomic numbers, only atom "types". Since you did not specify what type to assign for each atom, then Atomsk creates new types on-the-fly, and then proceeds to write the LAMMPS data file.
In most cases, the first atom is your "element1", i.e. tungsten (W). So Atomsk assigns type 1 to W, and type 2 to V.
However in some cases, the first atom is substituted, so that it becomes vanadium (V). In such cases, Atomsk assigns type 1 to V, and type 2 to W. You do not end up with inverted ratios, but the atom types that are generated are no longer the same.
If you output the results to another file format that supports atomic numbers, like CFG, then you will see that all the systems are W with 5% V.
Solution: Write in a text file the "type" that you want to assign to atoms, with the following format:
type
W 1
V 2
Save it as a text file (for instance "types.txt"). Then at the end of your command, after substituting atoms, add the option:
-properties types.txt
This way Atomsk will always assign type 1 to W and type 2 to V.
I hope this helps you
Best regards
Thanks, I have tried your method. I think this perfectly solved my problem.
Hi,
I'm trying to generate dozens of the binary alloys with the same composition by a shell script like this:
`
!/bin/bash
export PATH=$PATH:~/atomsk_b0.12.1_Linux-amd64
lattice=3.165 element1='W' element2='V'
ratio='5%'
structure_size_x=20 structure_size_y=20 structure_size_z=20 structure_file_name='data.lmp'
for i in
seq 1 1 20
do mkdir $i cd $i atomsk --create bcc $lattice $element1 -duplicate $structure_size_x $structure_size_y $structure_size_z -select random $ratio $element1 -substitute $element1 $element2 $structure_file_name cd .. done `
The output structure should be WV alloy with 5% V content. But sometime the output structure become WV alloy with 5% W content.
This situation occurred approximately 1 to 2 times in 20 iterations.
I'm not sure what's going here.
Thanks for your help!
Best regards, Cui