def _write_xyz_results_block(tecplot_file, nodes, nodal_results, nresults,
    ivars, ndim=3, word='xyz'):
    """TODO: hasn't been tested for 2d?"""
    for ivar in range(ndim):
        vals = nodes[:, (ivar)].ravel()
        msg = ''
        for ival, val in enumerate(vals):
            msg += ' %15.9E' % val
            if (ival + 1) % 3 == 0:
                tecplot_file.write(msg)
                msg = '\n'
        tecplot_file.write(msg.rstrip() + '\n')
    if nresults:
        for ivar in ivars:
            vals = nodal_results[:, (ivar)].ravel()
            msg = ''
            for ival, val in enumerate(vals):
                msg += ' %15.9E' % val
                if (ival + 1) % 5 == 0:
                    tecplot_file.write(msg)
                    msg = '\n'
            tecplot_file.write(msg.rstrip() + '\n')
