正交网格数据源
상속: HexahedronGridderSource
        public static CatesianGrid DumpCatesianGrid(this SimulationInputData inputData,
            float minColorCode, float maxColorCode)
        {
            GridDimens dimens = inputData.RootDataFile.GetDIMENS();
            if (dimens == null)
            { throw new ArgumentException("Missing DIMENS or SPECGRID"); }
            float[] dx = inputData.RootDataFile.GetDX();
            if (dx == null)
            { throw new ArgumentException("Missing DX or related description"); }
            float[] dy = inputData.RootDataFile.GetDY();
            if (dy == null)
            { throw new ArgumentException("Missing DY or related description"); }
            float[] dz = inputData.RootDataFile.GetDZ();
            if (dy == null)
            { throw new ArgumentException("Missing DZ or related description"); }

            var dataSource = new CatesianGridderSource();
            dataSource.NX = dimens.NI;
            dataSource.NY = dimens.NJ;
            dataSource.NZ = dimens.NK;
            dataSource.DX = dx;
            dataSource.DY = dy;
            dataSource.DZ = dz;
            dataSource.TOPS = inputData.RootDataFile.GetTOPS();
            dataSource.ActiveBlocks = inputData.RootDataFile.GetACTNUM();
            dataSource.IBlocks = SimLab.ArrayHelper.CreateAllSlices(dimens.NI);
            dataSource.JBlocks = SimLab.ArrayHelper.CreateAllSlices(dimens.NJ);
            dataSource.KBlocks = SimLab.ArrayHelper.CreateAllSlices(dimens.NK);
            dataSource.Init();
            List<GridBlockProperty> gridProps = inputData.RootDataFile.GetGridProperties();
            var grid = new CatesianGrid(dataSource, gridProps, minColorCode, maxColorCode);

            return grid;
        }
예제 #2
0
 /// <summary>
 /// base model for gridview.
 /// </summary>
 /// <param name="dataSource"></param>
 /// <param name="gridProps"></param>
 /// <param name="minColorCode"></param>
 /// <param name="maxColorCode"></param>
 /// <param name="defaultBlockPropertyIndex"></param>
 public GridViewModel(CatesianGridderSource dataSource, List<GridBlockProperty> gridProps,
     float minColorCode, float maxColorCode, int defaultBlockPropertyIndex = 0)
 {
     this.DataSource = dataSource;
     this.GridBlockProperties = gridProps;
     this.MinColorCode = minColorCode;
     this.MaxColorCode = maxColorCode;
     this.defaultBlockPropertyIndex = defaultBlockPropertyIndex;
 }
예제 #3
0
 public CatesianGrid(CatesianGridderSource dataSource, List<GridBlockProperty> gridProps,
     float minColorCode, float maxColorCode, int defaultBlockPropertyIndex = 0)
     : base(dataSource, gridProps, minColorCode, maxColorCode, defaultBlockPropertyIndex)
 {
 }