Exemplo n.º 1
0
        public SGrid(SGrid grid, bool deep_copy)
        {
            if (grid == null || _initialized) throw new System.Exception();

            _initialized = true;
            this._device = grid._device;
            this._d = grid.d;
            this._nx = grid.nx;
            this._nr = grid.nr;
            this._ni = grid.ni;
            this._dt0 = grid.dt0;
            this._x0 = grid._x0;
            this._r0 = grid._r0;
            this._y0 = grid._y0;
            this._today = grid._today;

            if (deep_copy)
            {
                this._t_i = new DateTime[ni]; grid.t_i.CopyTo(this.t_i, 0);
                this._host_d_xval_y = new double[d]; grid._host_d_xval_y.CopyTo(this._host_d_xval_y, 0);
                set_invm(grid._host_d_invm);
            }
            else
            {
                this._t_i = grid.t_i;
                this._host_d_xval_y = grid._host_d_xval_y;
                this._host_d_invm = grid._host_d_invm;
            }
        }
Exemplo n.º 2
0
        public CModel(Types.SGrid grid, string name)
        {
            _grid = grid;

            if (grid.fpu == EFloatingPointUnit.device)
            {
                device_grid_init();
            }
        }