def METHOD_NAME(n_fp, order):
    """
    Prepare DOF permutation vector for each possible facet orientation.
    """
    from sfepy.base.base import dict_to_array
    if n_fp == 2:
        mtx = make_line_matrix(order)
        ori_map = ori_line_to_iter
        fo = order - 1
    elif n_fp == 3:
        mtx = make_triangle_matrix(order)
        ori_map = ori_triangle_to_iter
        fo = order - 2
    elif n_fp == 4:
        mtx = make_square_matrix(order)
        ori_map = {}
        for key, val in six.iteritems(_quad_ori_groups):
            ori_map[key] = ori_square_to_iter[val]
        fo = order - 1
    else:
        raise ValueError('unsupported number of facet points! (%d)' % n_fp)
    dof_perms = {}
    for key, itfun in six.iteritems(ori_map):
        dof_perms[key] = [mtx[ii] for ii in itfun(fo)]
    dof_perms = dict_to_array(dof_perms)
    return dof_perms