             int threads = 512;
             int blocks = min((N + threads - 1) / threads, 1024);
 
-            scalarfield ret(1, 0);
+            static scalarfield ret(1, 0);
             cu_sum<<<blocks, threads>>>(sf.data(), ret.data(), N);
             cudaDeviceSynchronize();
             ret[0] = ret[0]/N;

			v_out = v * std::cos(angle) + axis.cross(v) * std::sin(angle);
		}



		/////////////////////////////////////////////////////////////////

        scalar dot(const vectorfield & vf1, const vectorfield & vf2)
        {
            int n = vf1.size();
            static scalarfield sf(n);
            scalar ret;

            // Dot product
