Read in the electrode positions and return the indices of the electrodes

    # TODO: Check if you find all electrodes

def write_elec_file(filename, mesh):
    """
    Read in the electrode positions and return the indices of the electrodes

    # TODO: Check if you find all electrodes
    """
    elecs = []
    # print('Write electrodes')
    electrodes = np.loadtxt(filename)
    for i in electrodes:
        # find
        for nr, j in enumerate(mesh['nodes']):
            if np.isclose(j[1], i[0]) and np.isclose(j[2], i[1]):
                elecs.append(nr + 1)

    fid = open('elec.dat', 'w')
    fid.write('{0}\n'.format(len(elecs)))
    for i in elecs:
        fid.write('{0}\n'.format(i))
    fid.close()