def METHOD_NAME(tensor, tensorName):
    """Function to print components of a tensor.
    For now, assume a rank 1 or 2 tensor.
    """
    print("  Printing tensor %s" % tensorName)
    rank = tensor.rank()
    ndim = tensor.shape[0]
    simpTensor = sympy.simplify(tensor)
    for i in range(ndim):
        if (rank == 2):
            for j in range(ndim):
                line = tensorName + \
                    '_%d%d = %s\n' % (i + 1, j + 1, simpTensor[i, j])
                out.write(line)
        else:
            line = tensorName + '_%d = %s\n' % (i + 1, simpTensor[i])
            out.write(line)
    out.write('\n')
    return