Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print "Original coordinates: ", test_case
print "------------------------------"
# Do the single substitution first, it is trivial as all Ba sites are equivalent we will choose the first Ba
subs_site = [0.0, 0.0, 0.0] # Fractional coordinates of the site to substitute
single_substitution = distort.make_substitution(test_case,subs_site,"Sr")
print "Single: ", single_substitution
#Build a sub-lattice you wish to disorder [test case do the Ba sub-lattice]
sub_lattice = distort.build_sub_lattice(single_substitution,"Ba")
# Enumerate the inequivalent sites
inequivalent_sites = distort.get_inequivalent_sites(sub_lattice,single_substitution)
# Replace Ba at inequivalent sites with Sr
i = 0
for inequivalent_site in inequivalent_sites:
print "------------------------------"
print " Substituted coordinates"
#print test_case,inequivalent_site
distorted = distort.make_substitution(single_substitution,inequivalent_site,"Sr")
io.write('POSCAR-%s'%i,distorted,format='vasp')
i = i + 1
# print distorted
print "------------------------------"
print "------------------------------"
print "------------------------------"
# Do the single substitution first, it is trivial as all Ba
# sites are equivalent we will choose the first Ba
subs_site = [0.0, 0.0, 0.0]
single_substitution = distort.make_substitution(test_case,subs_site,"Sr")
print "Single: ", single_substitution
#Build a sub-lattice you wish to disorder [test case do the Ba sub-lattice]
sub_lattice = distort.build_sub_lattice(single_substitution,"Ba")
# Enumerate the inequivalent sites
inequivalent_sites = distort.get_inequivalent_sites(sub_lattice,single_substitution)
# Replace Ba at inequivalent sites with Sr
for inequivalent_site in inequivalent_sites:
print "------------------------------"
print " Substituted coordinates"
#print test_case,inequivalent_site
distorted = distort.make_substitution(single_substitution,inequivalent_site,"Sr")
print distorted
print "------------------------------"
print "------------------------------"
print "Original coordinates: "
pretty_print_atoms(test_case)
print ('-' * hlinewidth)
# Do the single substitution first, it is trivial as all Ba
# sites are equivalent we will choose the first Ba
subs_site = [0.0, 0.0, 0.0]
single_substitution = distort.make_substitution(test_case, subs_site, "Sr")
print "Single: "
pretty_print_atoms(single_substitution)
# Build a sub-lattice you wish to disorder [test case do the Ba sub-lattice]
sub_lattice = distort.build_sub_lattice(single_substitution, "Ba")
# Enumerate the inequivalent sites
inequivalent_sites = distort.get_inequivalent_sites(sub_lattice,
single_substitution)
# Replace Ba at inequivalent sites with Sr
for i, inequivalent_site in enumerate(inequivalent_sites):
print ('-' * hlinewidth)
print "Substituted coordinates {0}".format(i)
# print test_case,inequivalent_site
distorted = distort.make_substitution(single_substitution,
inequivalent_site,
"Sr")
pretty_print_atoms(distorted)
print('='*hlinewidth)