def return_index(lbound, ubound, cells, position):
    """
    Give the position of a node on a 1D mesh this function will return the corresponding index
        of that node in an array that holds the node positions.

    lbound: Lower bound of mesh domain.
    ubound: Upper bound of mesh domain.
    cells: Number of cells along axis in mesh domain.
    position: Position of mesh node to find corresponding index for.

    returns
     Integer
    """

    index = (position - lbound) * cells / (ubound - lbound)

    return int(index)