def write_nonreflecting(BCFILE, segID):
    """write non-reflecting boundaries (set segments) to input file with segments

    This function assumes that segment file has already been written to and not
    terminated with *END.

    Args:
        BCFILE: file IO object
        segID (int): maximum segment ID #, assuming started at 1

    Returns:
        0 on success

    """
    BCFILE.write('*BOUNDARY_NON_REFLECTING\n')
    for i in range(1, segID):
        BCFILE.write(f'{i},0.0,0.0\n')
    BCFILE.write('*END\n')

    return 0