GetStressAtPoint() public method

Gets the stress at the point specified by (pt22, pt33) in the Line's contour local axes, given the internal forces diagrams for Axial and Moments in 2 and 3.
public GetStressAtPoint ( Model section, float s1, float m22, float m33, int pointIndex, float pt22, float pt33 ) : float
section Canguro.Model.Model
s1 float The axial internal forces diagram for the Line
m22 float The Moment in 2 internal forces diagram for the Line
m33 float The Moment in 3 internal forces diagram for the Line
pointIndex int The index of the diagram to use at the moment, /// corresponds to the position in the Local-1 Axis
pt22 float The point in the Local-2 Axis, corresponds to contour [.][1]
pt33 float The point in the Local-2 Axis, corresponds to contour [.][0]
return float
Esempio n. 1
0
        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);
        }
        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)
                {
                    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;
        }