def _generate_facet_normal_custom(gdim):
    """Generate code for setting facet normal in custom integrals"""
    code = format['comment'](
        'Set facet normal components for current quadrature point\n')
    for i in range(gdim):
        code += 'const double n_0%d =   facet_normals[%d*ip + %d];\n' % (i,
            gdim, i)
        code += 'const double n_1%d = - facet_normals[%d*ip + %d];\n' % (i,
            gdim, i)
    return code
