def elements_by_node(tris, nodes):
    """
    Get list of elements connected to a given node
    Args:
        tris: zero indexed df of elements
        nodes: list of zero indexed node number, int

    Returns:
        elements: set of elements zero indexed
    """
    # create an empty list for the elements
    elements = set()
    for node in nodes:
        # loop over all the materials given
        for vert in ['v0', 'v1', 'v2']:
            # get the subset of this material
            # df = tris.loc[tris['mat'] == mat]
            df = tris.loc[tris[vert] == node]
            # add the indices to the df to elements
            elements.update(df.index.values.astype(int))

    return elements