def nabla_div(ck, i, d):
    """
    Calculate the divergence

    Parameters
    ----------
    ck : np.array
        basis function coef. matrix.
    i : int
        which basis function to use.
    d : int
        which dimension.

    Returns
    -------
    float
        divergence.

    """
    # d = 0
    # case y-part 0 of basisfunc
    # d = 1
    # case x-part 0 of basisfunc
    return ck[1 + d, i]