How to use the smact.distorter.make_substitution function in SMACT

To help you get started, we’ve selected a few SMACT examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WMD-group / SMACT / tests / Example_distort.py View on Github external
#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 "------------------------------"
github WMD-group / SMACT / examples / cation_mutation.py View on Github external
#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 "------------------------------"