diff --git a/lessons/15_Step_12.ipynb b/lessons/15_Step_12.ipynb index 30d1a927..9c957653 100644 --- a/lessons/15_Step_12.ipynb +++ b/lessons/15_Step_12.ipynb @@ -221,7 +221,7 @@ "outputs": [], "source": [ "def pressure_poisson_periodic(p, dx, dy):\n", - " pn = numpy.empty_like(p)\n", + " pn[:] = numpy.empty_like(p)\n", " \n", " for q in range(nit):\n", " pn = p.copy()\n", @@ -313,10 +313,10 @@ "stepcount = 0\n", "\n", "while udiff > .001:\n", - " un = u.copy()\n", - " vn = v.copy()\n", + " un[:] = u.copy()\n", + " vn[:] = v.copy()\n", "\n", - " b = build_up_b(rho, dt, dx, dy, u, v)\n", + " b[:] = build_up_b(rho, dt, dx, dy, u, v)\n", " p = pressure_poisson_periodic(p, dx, dy)\n", "\n", " u[1:-1, 1:-1] = (un[1:-1, 1:-1] -\n",