Пример #1
0
def wulff(st, miller_list=None, e_surf_list=None):

    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())
Пример #2
0
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
Пример #3
0
def structure_parser_wrapper(structure:Structure,
                             is_primitive_cell=True,
                             fractional=True,
                             remove_unused_parameters=True) -> typing.Dict:
    """
    Same as above but expects pymatgen.core.structure.Structure object

    """

    if is_primitive_cell:
        structure = structure.get_primitive_structure()

    if fractional:
        position_key = 'fractional'
        positions = structure.frac_coords.tolist()
    else:
        position_key = 'xyz'
        positions = structure.cart_coords.tolist()

    sg = structure.get_space_group_info()
    bravais = space_groups.space_group_to_bravais(sg[1])
    lattice_parameters = lattice_parameters_from_cif(structure)

    # Required for qCore input
    if remove_unused_parameters:
        lattice_parameters = remove_superflous_parameters(lattice_parameters, bravais)
    species = [element_enum.value for element_enum in structure.species]
    assert len(species) == len(positions)

    crystal_data = {position_key: positions,
                    'species': species,
                    'lattice_parameters': lattice_parameters,
                    'space_group': sg,
                    'bravais': bravais,
                    'n_atoms': len(species)}

    return crystal_data