def find_constraints(mol, facet):
    """
    Find the constraints for the calculation, by fixing a facet and the cation.

    In order to make sure the Molecule does not rotate, the script fixes an
    entire facet of the Molecule. The cation is assumed to be the last element
    in the molecule.

    :return:
    """
    # Find the corresponding atom numbers in string format
    site_numbers = []
    for i in range(len(mol.sites)):
        if mol.sites[i] in facet.sites:
            site_numbers.append(str(i + 1) + " ")

    # Add the cation site
    site_numbers.append(str(len(mol.sites) + 1))

    # Join the strings of the site numbers
    site_numbers = "".join(site_numbers)

    # Return the constraints on the atoms
    return {"fix atom": site_numbers}