Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parallel"></param>
        /// <returns></returns>
        public GridScalarField2d GetLaplacian(bool parallel = false)
        {
            GridScalarField2d result = new GridScalarField2d(this);

            GetLaplacian(result.Values, parallel);
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parallel"></param>
        /// <returns></returns>
        public GridScalarField2d GetCurl(bool parallel = false)
        {
            GridScalarField2d result = new GridScalarField2d((Grid2d)this);

            GetCurl(result.Values, parallel);
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parallel"></param>
        /// <returns></returns>
        public GridScalarField2d GetDivergence(bool parallel = false)
        {
            GridScalarField2d result = new GridScalarField2d(this);

            GetDivergence(result.Values, parallel);
            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public GridScalarField2d Duplicate(bool copyValues)
        {
            var result = new GridScalarField2d(this);

            if (copyValues)
            {
                result.Set(this);
            }
            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bitmap"></param>
        /// <param name="mapper"></param>
        /// <param name="origin"></param>
        /// <param name="scale"></param>
        /// <returns></returns>
        public static GridScalarField2d CreateFromImage(Bitmap bitmap, Func <Color, double> mapper, Vec2d origin, Vec2d scale)
        {
            int nx = bitmap.Width;
            int ny = bitmap.Height;

            var result = new GridScalarField2d(origin, scale, nx, ny);

            FieldIO.ReadFromImage(bitmap, result, mapper);

            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bitmap"></param>
        /// <param name="mapper"></param>
        /// <param name="interval"></param>
        /// <returns></returns>
        public static GridScalarField2d CreateFromImage(Bitmap bitmap, Func <Color, double> mapper, Interval2d interval)
        {
            int nx = bitmap.Width;
            int ny = bitmap.Height;

            var result = new GridScalarField2d(interval, nx, ny);

            FieldIO.ReadFromImage(bitmap, result, mapper);

            return(result);
        }