def boundary_conditions(cells, cell_data, phy_lin, nodes_array, bc_x, bc_y):
    """Impose nodal point boundary conditions as required by SolidsPy

    Parameters
    ----------
        cell : dictionary
            Dictionary created by meshio with cells information.
        cell_data: dictionary
            Dictionary created by meshio with cells data information.
        phy_lin : int
            Physical line where BCs are to be imposed.
        nodes_array : int
            Array with the nodal data and to be modified by BCs.
        bc_x, bc_y : int
            Boundary condition flag along the x and y direction:
                * -1: restrained
                * 0: free

    Returns
    -------
        nodes_array : int
            Array with the nodal data after imposing BCs according
            to SolidsPy.

    """
    lines = cells["line"]
    # Bounds contains data corresponding to the physical line.
    phy_line = cell_data["line"]["gmsh:physical"]
    id_frontera = [cont for cont in range(len(phy_line))
                   if phy_line[cont] == phy_lin]
    nodes_frontera = lines[id_frontera]
    nodes_frontera = nodes_frontera.flatten()
    nodes_frontera = list(set(nodes_frontera))
    nodes_array[nodes_frontera, 3] = bc_x
    nodes_array[nodes_frontera, 4] = bc_y
    return nodes_array