예제 #1
0
        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();
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        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();
        }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
 internal void GenerateCellBoundary(int x, int y, int size)
 {
     nextStepGrid.Copy(currentGrid);
     currentGrid = GrainBoundary.GenerateSelectedGrainCellBoundary(nextStepGrid, x, y, size);
 }