internal void SetEnergyOnInside(int size, int energyValue) { List <Point> gbPoints = GrainBoundary.GenereteAllGrainWithoutBoundaries(currentGrid, size); foreach (Point p in gbPoints) { currentGrid.Cells[p.X, p.Y].Energy = energyValue; } CalculateMinMaxEnergy(); }
internal void GenerateAllBoundaries(int size) { List <Point> gbPoints = GrainBoundary.GenerateAllGrainBoundaries(currentGrid, size); foreach (Point p in gbPoints) { currentGrid.Cells[p.X, p.Y].State = 2; currentGrid.Cells[p.X, p.Y].Id = -1; } }
internal void SetEnergyOnBoundaries(int size, int energyValue) { List <Point> gbPoints = GrainBoundary.GenerateAllGrainBoundaries(currentGrid, size); foreach (Point p in gbPoints) { currentGrid.Cells[p.X, p.Y].Energy = energyValue; } maxEnergy = maxEnergy < energyValue ? energyValue : maxEnergy; CalculateMinMaxEnergy(); }
internal void RandomPlacementRecrystallizationGrainBoundries(int nucleonsCount, int gbSize) { List <Point> gbPoints = GrainBoundary.GenerateAllGrainBoundaries(currentGrid, gbSize); gbPoints = gbPoints.Where(p => !currentGrid.Cells[p.X, p.Y].Recrystallized).ToList(); if (gbPoints.Count > 0) { int gbCount = Math.Min(gbPoints.Count, nucleonsCount); gbPoints.Shuffle(); for (int i = 0; i < gbCount; i++) { currentGrid.Cells[gbPoints[i].X, gbPoints[i].Y].Recrystallized = true; currentGrid.Cells[gbPoints[i].X, gbPoints[i].Y].Id = i; } } }
internal void GenerateCellBoundary(int x, int y, int size) { nextStepGrid.Copy(currentGrid); currentGrid = GrainBoundary.GenerateSelectedGrainCellBoundary(nextStepGrid, x, y, size); }