Canguro.Analysis.StressHelper.recalculateMinMaxStressesOfSelection C# (CSharp) Метод

recalculateMinMaxStressesOfSelection() приватный Метод

private recalculateMinMaxStressesOfSelection ( Canguro model ) : bool
model Canguro
Результат bool
        private bool recalculateMinMaxStressesOfSelection(Canguro.Model.Model model)
        {
            if (!model.HasResults || model.Results.ActiveCase == null) return false;

            Model.Load.AbstractCase ac = model.Results.ActiveCase.AbstractCase;
            int numPoints = Properties.Settings.Default.ElementForcesSegments;

            LineStressCalculator lsc = new LineStressCalculator();
            Model.Section.FrameSection section;
            StraightFrameProps sfProps;
            Vector2[][] contour;
            float stress;
            float[,] s1, m22, m33;

            foreach (LineElement line in model.LineList)
                if (line != null && line.IsVisible)
                {
                    sfProps = line.Properties as StraightFrameProps;
                    if (sfProps != null)
                    {
                        s1  = lsc.GetForcesDiagram(ac, line, Canguro.Model.Load.LineForceComponent.Axial, numPoints);
                        m22 = lsc.GetForcesDiagram(ac, line, Canguro.Model.Load.LineForceComponent.Moment22, numPoints);
                        m33 = lsc.GetForcesDiagram(ac, line, Canguro.Model.Load.LineForceComponent.Moment33, numPoints);

                        section = sfProps.Section;
                        contour = section.Contour;
                        for (int j = 0; j < numPoints; j++)
                            for (int i = 0; i < contour[0].Length; i++)
                            {
                                stress = lsc.GetStressAtPoint(section, s1, m22, m33, j, contour[0][i].X, contour[0][i].Y);
                                if (stress > maxStress) maxStress = stress;
                                if (stress < minStress) minStress = stress;
                            }
                    }
                }
            return true;
        }