示例#1
0
        private static GradientScheme NewGradientScheme(string[] y)
        {
            GradientScheme x = null;
            if (y.Length < 2) return x;

            x = new GradientScheme();
            var i = 0;
            x.SetHeader(ref y[i++]);
            switch (y[i])
            {
                case "cellLimited":
                    x.limited = LimitedType.cellLimited;
                    i++;
                    break;
                case "faceLimited":
                    x.limited = LimitedType.faceLimited;
                    i++;
                    break;
            }
            x.discretisation = y[i++].ToEnum<DiscretisationType>();
            if (x.discretisation == DiscretisationType.Gauss)
            {
                x.interpolation = y[i++].ToEnum<InterpolationType>();
            }
            if (i < y.Length)
            {
                x.psi = Convert.ToDecimal(y[i]);
            }
            return x;
        }
示例#2
0
        private static GradientScheme NewGradientScheme(string[] y)
        {
            GradientScheme x = null;

            if (y.Length < 2)
            {
                return(x);
            }

            x = new GradientScheme();
            var i = 0;

            x.SetHeader(ref y[i++]);
            switch (y[i])
            {
            case "cellLimited":
                x.limited = LimitedType.cellLimited;
                i++;
                break;

            case "faceLimited":
                x.limited = LimitedType.faceLimited;
                i++;
                break;
            }
            x.discretisation = y[i++].ToEnum <DiscretisationType>();
            if (x.discretisation == DiscretisationType.Gauss)
            {
                x.interpolation = y[i++].ToEnum <InterpolationType>();
            }
            if (i < y.Length)
            {
                x.psi = Convert.ToDecimal(y[i]);
            }
            return(x);
        }