コード例 #1
0
        private static DivergenceScheme NewDivergenceScheme(string[] y)
        {
            DivergenceScheme x = null;

            if (y.Length > 1)
            {
                x = new DivergenceScheme();
                x.SetHeader(ref y[0]);
                var idx = 1;
                if (y[1] == "Gauss")
                {
                    idx++;
                }
                else
                {
                    x.discretisation = DiscretisationType.none;
                }
                x.interpolation = y[idx++].ToEnum <InterpolationType>();
                if (y.Length > idx)
                {
                    x.psi = Convert.ToDecimal(y[idx]);
                }
            }
            return(x);
        }
コード例 #2
0
 private static DivergenceScheme NewDivergenceScheme(string[] y)
 {
     DivergenceScheme x = null;
     if (y.Length > 1)
     {
         x = new DivergenceScheme();
         x.SetHeader(ref y[0]);
         var idx = 1;
         if (y[1] == "Gauss")
         {
             idx++;
         }
         else
         {
             x.discretisation = DiscretisationType.none;
         }
         x.interpolation = y[idx++].ToEnum<InterpolationType>();
         if (y.Length > idx)
         {
             x.psi = Convert.ToDecimal(y[idx]);
         }
     }
     return x;
 }