Exemple #1
0
        public void AlreadySplitGridsThrowsExceptionWhenDividedByN()
        {
            var grid = new Grid1d();

            grid.SplitAtParameter(0.25);
            var ex = Assert.Throws <Exception>(() => grid.DivideByCount(10));

            Assert.Equal("This grid already has subdivisions. Maybe you meant to select a subgrid to divide?", ex.Message);
        }
Exemple #2
0
        public void SplitGridAtParameters()
        {
            var grid = new Grid1d(new Domain1d(50, 100));

            grid.SplitAtParameter(0.25);
            var subCell = grid.Cells[1];

            subCell.DivideByCount(5);
            subCell.Cells[3].DivideByApproximateLength(1.2, EvenDivisionMode.Nearest);
            var allCells     = grid.GetCells();
            var cellGeometry = allCells.Select(c => c.GetCellGeometry());

            Assert.Equal(11, allCells.Count);
        }