//public static void PropFw2dCLR(WaveField2Df wfs1, ref WaveField2Df wfs2)
        //{
        //    ClsNac.WaveOpticsCLR.Prop2D(
        //        wfs1.lambda,
        //        wfs1.x, wfs1.y, wfs1.z, wfs1.re, wfs2.im,
        //        wfs2.x, wfs2.y, wfs2.z, wfs2.re, wfs2.im);
        //}
        public static void PropFw2dCudaf(WaveField2Df wfs1, ref WaveField2Df wfs2)
        {
            IntPtr ptr_u2re = new IntPtr();
            ptr_u2re = Marshal.AllocHGlobal(wfs2.div * sizeof(float));
            IntPtr ptr_u2im = new IntPtr();
            ptr_u2im = Marshal.AllocHGlobal(wfs2.div * sizeof(float));

            PropFw2dCuda_f(wfs1.lambda,
                wfs1.div, wfs1.x, wfs1.y, wfs1.z, wfs1.re, wfs1.im,
                wfs2.div, wfs2.x, wfs2.y, wfs2.z, ref ptr_u2re, ref ptr_u2im);

            Marshal.Copy(ptr_u2re, wfs2.re, 0, wfs2.div);
            Marshal.Copy(ptr_u2im, wfs2.im, 0, wfs2.div);
            Marshal.FreeHGlobal(ptr_u2re);
            Marshal.FreeHGlobal(ptr_u2im);

            for (int i = 0; i < wfs2.div; i++)
            {
                wfs2.u[i] = new Complex(wfs2.re[i], wfs2.im[i]);
            }
        }
 public FresnelKirchhoff2Df(ref WaveField2Df[] _wfs)
 {
     wfs = _wfs;
     n_wfs = wfs.Length;
 }