def wulff(st, miller_list=None, e_surf_list=None, show=0): from pymatgen.core.structure import Structure stpm = st.convert2pymatgen() lat = stpm.lattice recp_lattice = stpm.lattice.reciprocal_lattice_crystallographic recp = Structure(recp_lattice, ["H"], [[0, 0, 0]]) dire = Structure(stpm.lattice, ["H"], [[0, 0, 0]]) print(dire.get_space_group_info()) print(recp.get_space_group_info()) # print(lat) from pymatgen.analysis.wulff import WulffShape WS = WulffShape(lat, miller_list, e_surf_list) # print(dir(WS)) anisotropy = WS.anisotropy weighted_surface_energy = WS.weighted_surface_energy if show: WS.show() return anisotropy, weighted_surface_energy
(1, 1, 1): 1.9235 } miller_list = surface_energies_Ni.keys() e_surf_list = surface_energies_Ni.values() # We can now construct a Wulff shape with an accuracy up to a max Miller index of 3 wulffshape = WulffShape(Ni.lattice, miller_list, e_surf_list) # Let's get some useful information from our wulffshape object print("shape factor: %.3f, anisotropy: \ %.3f, weighted surface energy: %.3f J/m^2" % (wulffshape.shape_factor, wulffshape.anisotropy, wulffshape.weighted_surface_energy)) # If we want to see what our Wulff shape looks like wulffshape.show() # Lets try something a little more complicated, say LiFePO4 from pymatgen.util.testing import PymatgenTest # Get the LiFePO4 structure LiFePO4 = PymatgenTest.get_structure("LiFePO4") # Let's add some oxidation states to LiFePO4, this will be # important when we want to take surface polarity into consideration LiFePO4.add_oxidation_state_by_element({"Fe": 2, "Li": 1, "P": 5, "O": -2}) slabgen = SlabGenerator(LiFePO4, (0, 0, 1), 10, 10) all_slabs = slabgen.get_slabs(bonds={("P", "O"): 2}) # any bond between P and O less than 2 Angstroms cannot be broken when generating slabs print("For the (001) slab of LiFePO4, there are %s terminations." % (len(all_slabs))) for slab in all_slabs: print(slab.is_polar(), slab.is_symmetric())
'Energy': -609.24, 'Label': '1 Species' } data = [Adsorbant_1] Surface_111_1 = wulff.calculate_surface_energy(stoich, data, SE, adsorbant, thermochem, 298, 0) #Declare the lattic paramter lattice = Lattice.cubic(5.411) ceo = Structure(lattice, ["Ce", "O"], [[0, 0, 0], [0.25, 0.25, 0.25]]) surface_energies_ceo = { (1, 1, 1): np.amin(Surface_111_1), (1, 1, 0): np.amin(Surface_110_1), (1, 0, 0): np.amin(Surface_100_1) } miller_list = surface_energies_ceo.keys() e_surf_list = surface_energies_ceo.values() # We can now construct a Wulff shape with an accuracy up to a max Miller index of 3 wulffshape = WulffShape(ceo.lattice, miller_list, e_surf_list) # Let's get some useful information from our wulffshape object print("shape factor: %.3f, anisotropy: \ %.3f, weighted surface energy: %.3f J/m^2" % (wulffshape.shape_factor, wulffshape.anisotropy, wulffshape.weighted_surface_energy)) # If we want to see what our Wulff shape looks like wulffshape.show(color_set="RdBu", direction=(1.00, 0.25, 0.25))