Closed yanwenliao closed 1 month ago
I have the same problem............
I wrote it directly in the bash script:
infile=struct_enum.in.ex5 outfile=struct_enum.out
../../src/enum.x $infile
last_line=$(tail -n 1 $outfile) total=$(echo $last_line | awk '{print $1}' | tr -d ' ')
python makeStr.py 1 $total -flags
for ((j=1; j<=$total; j++)); do filename="vasp.$j" sed -i '6i Nb U' "$filename" mv "$filename" poscar/"$j.vasp" done
I wrote it directly in the bash script:
infile=struct_enum.in.ex5 outfile=struct_enum.out
../../src/enum.x $infile
last_line=$(tail -n 1 $outfile) total=$(echo $last_line | awk '{print $1}' | tr -d ' ')
python makeStr.py 1 $total -flags
for ((j=1; j<=$total; j++)); do filename="vasp.$j" sed -i '6i Nb U' "$filename" mv "$filename" poscar/"$j.vasp" done
此外,为了实现连续置换,我是在16个原子里置换别的原子,从1置换到16,下面是脚本的完整内容:
mkdir poscar
atoms=16
infile=struct_enum.in.ex5
outfile=struct_enum.out
for ((i=1; i<=$atoms; i++)); do
sed -i "$(($(wc -l < $infile) - 1))s/.*/$i $i $atoms/" $infile
sed -i "$(($(wc -l < $infile)))s/.*/$(($atoms-$i)) $(($atoms-$i)) $atoms/" $infile
../../src/enum.x $infile
last_line=$(tail -n 1 $outfile)
total=$(echo $last_line | awk '{print $1}' | tr -d ' ')
python makeStr.py 1 $total -flags
for ((j=1; j<=$total; j++)); do
filename="vasp.$j"
sed -i '6i Nb U' "$filename"
mv "$filename" poscar/"$i-$j.vasp"
done
#
done
在命令行直接输入: “bash 脚本名” 就可以了
------------------ 原始邮件 ------------------ 发件人: "msg-byu/enumlib" @.>; 发送时间: 2024年3月26日(星期二) 下午4:21 @.>; @.**@.>; 主题: Re: [msg-byu/enumlib] How to match elements to a created structure (Issue #121)
I have the same problem............
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Below is a POSCAR file of a structure that I exported through "python makeStr.py" Nb str #: 1 1.000 0.000000000 6.641040000 0.000000000 0.000000000 0.000000000 6.641040000 6.641040000 0.000000000 0.000000000 2 14
Direct 0.000000000 0.000000000 0.000000000 0.000000000 0.500000000 0.000000000 0.500000000 0.000000000 0.000000000 0.500000000 0.500000000 0.000000000 0.000000000 0.000000000 0.500000000 0.000000000 0.500000000 0.500000000 0.500000000 0.000000000 0.500000000 0.500000000 0.500000000 0.500000000 0.250000000 0.250000000 0.250000000 0.250000000 0.750000000 0.250000000 0.750000000 0.250000000 0.250000000 0.750000000 0.750000000 0.250000000 0.250000000 0.250000000 0.750000000 0.250000000 0.750000000 0.750000000 0.750000000 0.250000000 0.750000000 0.750000000 0.750000000 0.750000000
But how do I export with attaching the elements Nb and U as shown in line 6 Nb str #: 1 1.000 0.000000000 6.641040000 0.000000000 0.000000000 0.000000000 6.641040000 6.641040000 0.000000000 0.000000000 Nb U 2 14
Direct 0.000000000 0.000000000 0.000000000 0.000000000 0.500000000 0.000000000 0.500000000 0.000000000 0.000000000 0.500000000 0.500000000 0.000000000 0.000000000 0.000000000 0.500000000 0.000000000 0.500000000 0.500000000 0.500000000 0.000000000 0.500000000 0.500000000 0.500000000 0.500000000 0.250000000 0.250000000 0.250000000 0.250000000 0.750000000 0.250000000 0.750000000 0.250000000 0.250000000 0.750000000 0.750000000 0.250000000 0.250000000 0.250000000 0.750000000 0.250000000 0.750000000 0.750000000 0.750000000 0.250000000 0.750000000 0.750000000 0.750000000 0.750000000
I tried add "-elements Nb U" after "python makeStr.py " like " python makeStr.py -elements Nb U 1 -flags ",but it didn't work.