Exemplo n.º 1
0
        public void CheckSteelBasePart()
        {
            SteelColumnBase steelColumnBase = new SteelColumnBase();

            steelColumnBase.Width     = 1;
            steelColumnBase.Length    = 1;
            steelColumnBase.Thickness = 0.05;
            BarLoadSet columnLoadSet = new BarLoadSet(steelColumnBase);

            columnLoadSet.Force_Nz            = -100000;
            columnLoadSet.PartialSafetyFactor = 1;
            SteelBasePart steelBasePart = new SteelBasePart(steelColumnBase);

            steelBasePart.FixLeft   = true;
            steelBasePart.FixRight  = true;
            steelBasePart.FixTop    = false;
            steelBasePart.FixBottom = false;
            steelBasePart.Width     = 1;
            steelBasePart.Length    = 1;
            SteelColumnBaseProcessor columBaseProcessor = new SteelColumnBaseProcessor();
            ColumnBaseResult         columnResult       = columBaseProcessor.GetResult(steelColumnBase);
            ColumnBasePartResult     baseResult         = SteelColumnBasePartProcessor.GetResult(steelBasePart);

            Assert.AreEqual(300, baseResult.MaxStress / 1000000, 10);
        }
Exemplo n.º 2
0
        private ListViewItem NewItemFromColumnBasePart(SteelBasePart obj)
        {
            ListViewItem NewItem = new ListViewItem();

            EditItemFromColumnBasePart(NewItem, obj);
            lvDetails.Items.Add(NewItem);
            return(NewItem);
        }
Exemplo n.º 3
0
        private void EditItemFromColumnBasePart(ListViewItem Item, SteelBasePart basePart)
        {
            Item.SubItems.Clear();
            Item.Text = basePart.Name;
            Item.SubItems.Add(Convert.ToString(basePart.Width * 1000) + "x" + Convert.ToString(basePart.Length * 1000));
            ColumnBasePartResult result = SteelColumnBasePartProcessor.GetResult(basePart);
            double maxStress            = result.MaxStress;

            maxStress = Math.Round(maxStress / 1000) / 1000;
            Item.SubItems.Add(Convert.ToString(maxStress));
        }
 public WndSteelBasePart(SteelBasePart steelBasePart)
 {
     InitializeComponent();
     _steelBasePart = steelBasePart;
     #region Перенос значений из класса в контролы
     tbxName.Text              = _steelBasePart.Name;
     cbFixLeft.IsChecked       = _steelBasePart.FixLeft;
     cbFixRight.IsChecked      = _steelBasePart.FixRight;
     cbFixTop.IsChecked        = _steelBasePart.FixTop;
     cbFixBottom.IsChecked     = _steelBasePart.FixBottom;
     tbxWidth.Text             = Convert.ToString(_steelBasePart.Width * 1000);
     tbxLength.Text            = Convert.ToString(_steelBasePart.Length * 1000);
     tbxCenterX.Text           = Convert.ToString(_steelBasePart.Center[0] * 1000);
     tbxCenterY.Text           = Convert.ToString(_steelBasePart.Center[1] * 1000);
     cbAddSymmetricX.IsChecked = _steelBasePart.AddSymmetricX;
     cbAddSymmetricY.IsChecked = _steelBasePart.AddSymmetricY;
     _tmpSteelBasePart         = (SteelBasePart)_steelBasePart.Clone();
     #endregion
     DrawScetch(_tmpSteelBasePart);
 }
Exemplo n.º 5
0
        private void tsbNew_Click(object sender, EventArgs e)
        {
            ProgrammSettings.IsDataChanged = true;
            switch (_formType) //
            {
            case "Buildings":
            {
                break;
            }

            case "Levels":
            {
                Level level = new Level((Building)_parentObject);
                NewItemFromLevel(level);
                break;
            }

            //Add new Opening
            case "OpeningPlacings":
            {
                OpeningPlacing openingPlacing = new OpeningPlacing((Wall)_parentObject);
                NewItemFromOpeningPlacing(openingPlacing);
                break;
            }

            //Add new OpeningType
            case "OpeningTypes":
            {
                OpeningType openingType = new OpeningType((Building)_parentObject);
                NewItemFromOpeningType(openingType);
                break;
            }

            case ObjColumnBaseParts:
            {
                SteelBasePart basePart = new SteelBasePart((SteelColumnBase)_parentObject);
                NewItemFromColumnBasePart(basePart);
                break;
            }

            case ObjBarForses:
            {
                BarLoadSet columnLoadSet = new BarLoadSet((SteelColumnBase)_parentObject);
                NewItemFromColumnLoadSet(columnLoadSet);
                break;
            }

            case ObjSteelColumnBases:
            {
                SteelColumnBase steelColumnBase = new SteelColumnBase((Level)_parentObject);
                NewItemFromSteelColumnBase(steelColumnBase);
                #region Вложенные объекты по умолчанию
                //Нагрузка
                BarLoadSet columnLoadSet = new BarLoadSet(steelColumnBase);
                columnLoadSet.LoadSet.Name = "Постоянная";
                //Участок №1
                SteelBasePart basePart1 = new SteelBasePart(steelColumnBase);
                basePart1.Name          = "1";
                basePart1.Width         = 0.290;
                basePart1.Length        = 0.200;
                basePart1.Center[0]     = 0.155;
                basePart1.Center[1]     = 0.350;
                basePart1.FixLeft       = true;
                basePart1.FixRight      = false;
                basePart1.FixTop        = false;
                basePart1.FixBottom     = true;
                basePart1.AddSymmetricX = true;
                basePart1.AddSymmetricY = true;
                //Участок №2
                SteelBasePart basePart2 = new SteelBasePart(steelColumnBase);
                basePart2.Name          = "2";
                basePart2.Width         = 0.290;
                basePart2.Length        = 0.480;
                basePart2.Center[0]     = 0.155;
                basePart2.Center[1]     = 0;
                basePart2.FixLeft       = true;
                basePart2.FixRight      = false;
                basePart2.FixTop        = true;
                basePart2.FixBottom     = true;
                basePart2.AddSymmetricX = false;
                basePart2.AddSymmetricY = true;
                #endregion
                break;
            }

            case "Walls":
            {
                Wall wall = new Wall((Level)_parentObject);
                NewItemFromWall(wall);
                break;
            }

            case "WallTypes":
            {
                WallType wallType = new WallType((Building)_parentObject);
                NewItemFromWallType(wallType);
                break;
            }
            }
        }
        //метод отрисовки участков базы
        private void DrawBasePart(SteelBasePart basePart, double[] columnBaseCenter, double scale_factor, int koeffX, int koeffY, double opacity, bool showName)
        {
            double[] basePartCenter = new double[2] {
                cvScetch.Width / 2 + basePart.Center[0] * scale_factor * koeffX, cvScetch.Height / 2 - basePart.Center[1] * scale_factor * koeffY
            };
            Rectangle basePartRect = new Rectangle();

            basePartRect.Width   = basePart.Width * scale_factor;
            basePartRect.Height  = basePart.Length * scale_factor;
            basePartRect.Fill    = Brushes.LightBlue;
            basePartRect.Opacity = opacity;
            cvScetch.Children.Add(basePartRect);
            Canvas.SetLeft(basePartRect, basePartCenter[0] - basePartRect.Width / 2);
            Canvas.SetTop(basePartRect, basePartCenter[1] - basePartRect.Height / 2);
            Ellipse centerEllipse = new Ellipse();

            centerEllipse.Width   = 5;
            centerEllipse.Height  = 5;
            centerEllipse.Fill    = Brushes.Red;
            centerEllipse.Opacity = opacity;
            cvScetch.Children.Add(centerEllipse);
            Canvas.SetLeft(centerEllipse, basePartCenter[0] - centerEllipse.Width / 2);
            Canvas.SetTop(centerEllipse, basePartCenter[1] - centerEllipse.Height / 2);
            #region Если требуются закрепления по сторонам, рисуем соответствующие линии
            if (basePart.FixLeft)
            {
                Line borderLeft = new Line();
                borderLeft.X1              = basePartCenter[0] - basePartRect.Width / 2 * koeffX;
                borderLeft.Y1              = basePartCenter[1] + basePartRect.Height / 2 * koeffY;
                borderLeft.X2              = basePartCenter[0] - basePartRect.Width / 2 * koeffX;
                borderLeft.Y2              = basePartCenter[1] - basePartRect.Height / 2 * koeffY;
                borderLeft.Stroke          = Brushes.Blue;
                borderLeft.StrokeThickness = 2;
                borderLeft.StrokeDashArray = new DoubleCollection {
                    5, 2
                };
                cvScetch.Children.Add(borderLeft);
            }
            if (basePart.FixRight)
            {
                Line borderLeft = new Line();
                borderLeft.X1              = basePartCenter[0] + basePartRect.Width / 2 * koeffX;
                borderLeft.Y1              = basePartCenter[1] + basePartRect.Height / 2 * koeffY;
                borderLeft.X2              = basePartCenter[0] + basePartRect.Width / 2 * koeffX;
                borderLeft.Y2              = basePartCenter[1] - basePartRect.Height / 2 * koeffY;
                borderLeft.Stroke          = Brushes.Blue;
                borderLeft.StrokeThickness = 2;
                borderLeft.StrokeDashArray = new DoubleCollection {
                    5, 2
                };
                cvScetch.Children.Add(borderLeft);
            }
            if (basePart.FixTop)
            {
                Line borderLeft = new Line();
                borderLeft.X1              = basePartCenter[0] - basePartRect.Width / 2 * koeffX;
                borderLeft.Y1              = basePartCenter[1] - basePartRect.Height / 2 * koeffY;
                borderLeft.X2              = basePartCenter[0] + basePartRect.Width / 2 * koeffX;
                borderLeft.Y2              = basePartCenter[1] - basePartRect.Height / 2 * koeffY;
                borderLeft.Stroke          = Brushes.Blue;
                borderLeft.StrokeThickness = 2;
                borderLeft.StrokeDashArray = new DoubleCollection {
                    5, 2
                };
                cvScetch.Children.Add(borderLeft);
            }
            if (basePart.FixBottom)
            {
                Line borderLeft = new Line();
                borderLeft.X1              = basePartCenter[0] - basePartRect.Width / 2 * koeffX;
                borderLeft.Y1              = basePartCenter[1] + basePartRect.Height / 2 * koeffY;
                borderLeft.X2              = basePartCenter[0] + basePartRect.Width / 2 * koeffX;
                borderLeft.Y2              = basePartCenter[1] + basePartRect.Height / 2 * koeffY;
                borderLeft.Stroke          = Brushes.Blue;
                borderLeft.StrokeThickness = 2;
                borderLeft.StrokeDashArray = new DoubleCollection {
                    5, 2
                };
                cvScetch.Children.Add(borderLeft);
            }
            #endregion
            //Если требуется указать имя участка, рисуем его
            if (showName)
            {
                TextBlock basePartNameText = new TextBlock();
                basePartNameText.Text       = basePart.Name;
                basePartNameText.Foreground = Brushes.Black;
                cvScetch.Children.Add(basePartNameText);
                Canvas.SetLeft(basePartNameText, basePartCenter[0] - basePartNameText.FontSize);
                Canvas.SetTop(basePartNameText, basePartCenter[1] - basePartNameText.FontSize);
            }
        }
        private void DrawScetch(SteelBasePart steelBasePart)
        {
            double zoom_factor_X = cvScetch.Width / steelBasePart.ColumnBase.Width / 1.2;
            double zoom_factor_Y = cvScetch.Height / steelBasePart.ColumnBase.Length / 1.2;
            double scale_factor;

            double[] columnBaseCenter = new double[2] {
                cvScetch.Width / 2, cvScetch.Height / 2
            };
            if (zoom_factor_X < zoom_factor_Y)
            {
                scale_factor = zoom_factor_X;
            }
            else
            {
                scale_factor = zoom_factor_Y;
            }
            #region  исуем прямоугольник для базы
            Rectangle columnBaseRect = new Rectangle();
            columnBaseRect.Width           = steelBasePart.ColumnBase.Width * scale_factor;
            columnBaseRect.Height          = steelBasePart.ColumnBase.Length * scale_factor;
            columnBaseRect.Fill            = Brushes.Gray;
            columnBaseRect.Opacity         = 0.3;
            columnBaseRect.Stroke          = Brushes.Black;
            columnBaseRect.StrokeThickness = 3;
            cvScetch.Children.Add(columnBaseRect);
            Canvas.SetLeft(columnBaseRect, columnBaseCenter[0] - columnBaseRect.Width / 2);
            Canvas.SetTop(columnBaseRect, columnBaseCenter[1] - columnBaseRect.Height / 2);
            #endregion
            #region  исуем оси координат
            //Рисуем ось X
            Line axisX = new Line();
            axisX.X1              = columnBaseCenter[0] - columnBaseRect.Width / 2 * 1.2;
            axisX.Y1              = columnBaseCenter[1];
            axisX.X2              = columnBaseCenter[0] + columnBaseRect.Width / 2 * 1.2;
            axisX.Y2              = columnBaseCenter[1];
            axisX.Stroke          = Brushes.Red;
            axisX.StrokeThickness = 1;
            axisX.StrokeDashArray = new DoubleCollection {
                10, 4
            };
            cvScetch.Children.Add(axisX);
            //Рисуем ось Y
            Line axisY = new Line();
            axisY.X1              = columnBaseCenter[0];
            axisY.Y1              = columnBaseCenter[1] - columnBaseRect.Height / 2 * 1.2;
            axisY.X2              = columnBaseCenter[0];
            axisY.Y2              = columnBaseCenter[1] + columnBaseRect.Height / 2 * 1.2;
            axisY.Stroke          = Brushes.Red;
            axisY.StrokeThickness = 1;
            axisY.StrokeDashArray = new DoubleCollection {
                10, 4
            };
            cvScetch.Children.Add(axisY);
            #endregion
            //Рисуем участки
            foreach (SteelBasePart basePart in steelBasePart.ColumnBase.SteelBaseParts)
            {
                SteelBasePart locBasePart = basePart;
                if (basePart.Equals(_steelBasePart))
                {
                    locBasePart = _tmpSteelBasePart;
                }
                DrawBasePart(locBasePart, columnBaseCenter, scale_factor, 1, 1, 0.8, true);
                //Если требуется отражение
                if (locBasePart.AddSymmetricX)
                {
                    DrawBasePart(locBasePart, columnBaseCenter, scale_factor, 1, -1, 0.6, false);
                }
                if (locBasePart.AddSymmetricY)
                {
                    DrawBasePart(locBasePart, columnBaseCenter, scale_factor, -1, 1, 0.6, false);
                }
                if (locBasePart.AddSymmetricX && basePart.AddSymmetricY)
                {
                    DrawBasePart(locBasePart, columnBaseCenter, scale_factor, -1, -1, 0.6, false);
                }
            }
        }
Exemplo n.º 8
0
        public static ColumnBasePartResult GetResult(SteelBasePart basePart)
        {
            /*Алгоритм расчета основан на подходе из учебника Белени по
             * таблицам Галеркина
             * Момент определяется в зависимости от количества сторон, по которым имеется опора
             * Если опора имеется только по одной стороне, то считается что участок консольный
             * Иначе считаетася, что участок оперт шарнирно
             * Для участка, опертого по трем сторонам в учебнике есть некоторая нелогичность
             * При соотношении сторон менее 0,5 происходит резкий скачок в определении момента
             * Так как данный скачок в запас несущей способности, то решили оставить так
             */
            #region Исходные списки для интерполяции коэффициентов
            //Для участков, опертых по 2-м и 3-м сторонам
            List <double> xValues23 = new List <double>()
            {
                0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 2
            };
            List <double> yValues23 = new List <double>()
            {
                0.06, 0.074, 0.088, 0.097, 0.107, 0.112, 0.120, 0.126, 0.132
            };
            //Для участков, опертых по 4-м сторонам
            List <double> xValues4 = new List <double>()
            {
                1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2
            };
            List <double> yValues4 = new List <double>()
            {
                0.048, 0.055, 0.063, 0.069, 0.075, 0.081, 0.086, 0.091, 0.094, 0.098, 0.1
            };
            #endregion
            #region Описание переменных
            SteelColumnBaseProcessor columBaseProcessor = new SteelColumnBaseProcessor();
            ColumnBaseResult         baseResult         = columBaseProcessor.GetResult(basePart.ColumnBase);
            RectCrossSection         baseRect           = new RectCrossSection(basePart.ColumnBase.Width, basePart.ColumnBase.Length);
            MassProperty             massProperty       = RectProcessor.GetRectMassProperty(baseRect);
            double maxStress = double.NegativeInfinity;
            double maxStressTmp;
            foreach (BarLoadSet LoadCase in baseResult.LoadCases)
            {
                List <double> dxList = new List <double>();
                List <double> dyList = new List <double>();
                dxList.Add(basePart.Center[0] + basePart.Width / 2);
                dxList.Add(basePart.Center[0] - basePart.Width / 2);
                dyList.Add(basePart.Center[1] + basePart.Length / 2);
                dyList.Add(basePart.Center[1] - basePart.Length / 2);


                foreach (double dx in dxList)
                {
                    foreach (double dy in dyList)
                    {
                        double stress = BarLoadSetProcessor.StressInBarSection(LoadCase, massProperty, dx, dy);
                        if (stress < 0)
                        {
                            maxStressTmp = stress * (-1D);
                        }
                        else
                        {
                            maxStressTmp = 0;
                        }
                        if (maxStressTmp > maxStress)
                        {
                            maxStress = maxStressTmp;
                        }
                    }
                }
            }

            ColumnBasePartResult result = new ColumnBasePartResult();
            double width         = basePart.Width;
            double length        = basePart.Length;
            double thickness     = basePart.ColumnBase.Thickness;
            double Wx            = thickness * thickness / 6;
            double maxMoment     = 0;
            int    countFixSides = 0;
            #endregion
            #region Определение количества сторон, по которым имеются опоры
            if (basePart.FixLeft)
            {
                countFixSides++;
            }
            if (basePart.FixRight)
            {
                countFixSides++;
            }
            if (basePart.FixTop)
            {
                countFixSides++;
            }
            if (basePart.FixBottom)
            {
                countFixSides++;
            }
            #endregion
            //Если ни одна из опор не задана, то это ошибка
            if (countFixSides == 0)
            {
                MessageBox.Show("Неверное закрепление сторон", "Ошибка");
                return(result);
            }
            //База целиком отрывается
            if (maxStress < 0)
            {
                result.MaxMoment = 0;
                result.MaxStress = 0;
                return(result);
            }
            //Если опора только по одной стороне, считаем как консоль
            if (countFixSides == 1)
            {
                //Если опора слева или справа
                if (basePart.FixLeft || basePart.FixRight)
                {
                    maxMoment = maxStress * width * width / 2;
                }
                //Если опора сверху или снизу
                if (basePart.FixTop || basePart.FixBottom)
                {
                    maxMoment = maxStress * length * length / 2;
                }
            }
            //Если опора с двух сторон
            if (countFixSides == 2)
            {
                //Если опора слева и справа
                if (basePart.FixLeft && basePart.FixRight)
                {
                    maxMoment = maxStress * width * width / 8;
                }
                else
                {
                    //Если опора снизу и сверху
                    if (basePart.FixTop && basePart.FixBottom)
                    {
                        maxMoment = maxStress * length * length / 8;
                    }
                    //Иначе плита оперта по двум смежным сторонам, неважно каким
                    else
                    {
                        double koeff_a1 = Math.Sqrt(width * width + length * length);
                        double koeff_b1 = width * length * 0.25 / koeff_a1;
                        double ratio    = koeff_b1 / koeff_a1;
                        double koeff_betta;

                        if (ratio > 2)
                        {
                            koeff_betta = 0.133;
                        }
                        else
                        {
                            if (ratio < 0.5)
                            {
                                koeff_betta = 0.06;
                            }
                            else
                            {
                                koeff_betta = MathOperation.InterpolateList(xValues23, yValues23, ratio);
                            }
                        }
                        maxMoment = maxStress * koeff_a1 * koeff_a1 * koeff_betta;
                    }
                }
            }
            //Если опора с трех сторон
            if (countFixSides == 3)
            {
                double koeff_a1;
                double koeff_b1;
                #region //Если закрепления слева и справа
                if (basePart.FixLeft && basePart.FixRight)
                {
                    koeff_a1 = width;
                    koeff_b1 = length;
                }
                //иначе закрепления сверху и снизу
                else
                {
                    koeff_a1 = length;
                    koeff_b1 = width;
                }
                #endregion
                double ratio = koeff_b1 / koeff_a1;
                double koeff_betta;

                if (ratio < 0.5)
                {
                    koeff_betta = 0.5;
                    maxMoment   = maxStress * koeff_b1 * koeff_b1 * koeff_betta;
                    //Console.WriteLine("Три стороны - консоль");
                    //Console.WriteLine("maxMoment = " + Convert.ToString(maxMoment));
                    //Console.ReadLine();
                }
                else
                {
                    koeff_betta = MathOperation.InterpolateList(xValues23, yValues23, ratio);
                    maxMoment   = maxStress * koeff_a1 * koeff_a1 * koeff_betta;
                    //Console.WriteLine("ratio = " + Convert.ToString(ratio));
                    //Console.WriteLine("Три стороны - П-образная");
                    //Console.WriteLine("koeff_a1 = " + Convert.ToString(koeff_a1));
                    //Console.WriteLine("koeff_betta = " + Convert.ToString(koeff_betta));
                    //Console.WriteLine("maxMoment = " + Convert.ToString(maxMoment));
                    //Console.ReadLine();
                }
            }
            //Если опора с 4-х сторон
            if (countFixSides == 4)
            {
                double koeff_b;
                double koeff_a;
                if (width > length)
                {
                    koeff_b = width;
                    koeff_a = length;
                }
                else
                {
                    koeff_b = length;
                    koeff_a = width;
                }
                double ratio = koeff_b / koeff_a;
                double koeff_betta;
                if (ratio > 2)
                {
                    koeff_betta = 0.125; Console.WriteLine("Четыре стороны - по двум сторонам");
                }
                else
                {
                    koeff_betta = MathOperation.InterpolateList(xValues4, yValues4, ratio);
                    //Console.WriteLine("Четыре стороны - по контуру");
                }
                maxMoment = maxStress * koeff_a * koeff_a * koeff_betta;

                //Console.WriteLine("maxMoment = " + Convert.ToString(maxMoment));
                //Console.ReadLine();
            }
            result.MaxMoment = maxMoment;
            result.MaxStress = maxMoment / Wx;
            //Console.WriteLine("Time = " + DateTime.Now);
            //Console.WriteLine("maxMoment = " + Convert.ToString(maxMoment));
            //Console.WriteLine("MaxStress = " + Convert.ToString(result.MaxStress));
            //Console.ReadLine();
            return(result);
        }