Exemplo n.º 1
0
        public sFrameResult DuplicatesFrameResult()
        {
            sFrameResult newre = new sFrameResult();

            newre.parameterAt = this.parameterAt;
            if (this.force != null)
            {
                newre.force = this.force.DuplicatesXYZ();
            }
            if (this.moment != null)
            {
                newre.moment = this.moment.DuplicatesXYZ();
            }
            if (this.deflection_mm != null)
            {
                newre.deflection_mm = this.deflection_mm.DuplicatesXYZ();
            }
            if (this.deflectionLocal_mm != null)
            {
                newre.deflectionLocal_mm = this.deflectionLocal_mm.DuplicatesXYZ();
            }
            if (this.sectionResults != null)
            {
                newre.sectionResults = new List <sFrameSectionResult>();
                foreach (sFrameSectionResult vr in this.sectionResults)
                {
                    newre.sectionResults.Add(vr.DuplicatesFrameSectionResult());
                }
            }

            return(newre);
        }
        public void UpdateMaxValues(sFrameResult bre)
        {
            if (bre.force.X < 0.0)
            {
                if (bre.force.X < this.forceMax_Negative.X)
                {
                    this.forceMax_Negative.X = bre.force.X;
                }
            }
            else
            {
                if (bre.force.X > this.forceMax_Positive.X)
                {
                    this.forceMax_Positive.X = bre.force.X;
                }
            }
            if (bre.force.Y < 0.0)
            {
                if (bre.force.Y < this.forceMax_Negative.Y)
                {
                    this.forceMax_Negative.Y = bre.force.Y;
                }
            }
            else
            {
                if (bre.force.Y > this.forceMax_Positive.Y)
                {
                    this.forceMax_Positive.Y = bre.force.Y;
                }
            }
            if (bre.force.Z < 0.0)
            {
                if (bre.force.Z < this.forceMax_Negative.Z)
                {
                    this.forceMax_Negative.Z = bre.force.Z;
                }
            }
            else
            {
                if (bre.force.Z > this.forceMax_Positive.Z)
                {
                    this.forceMax_Positive.Z = bre.force.Z;
                }
            }

            if (bre.moment.X < 0.0)
            {
                if (bre.moment.X < this.momentMax_Negative.X)
                {
                    this.momentMax_Negative.X = bre.moment.X;
                }
            }
            else
            {
                if (bre.moment.X > this.momentMax_Positive.X)
                {
                    this.momentMax_Positive.X = bre.moment.X;
                }
            }
            if (bre.moment.Y < 0.0)
            {
                if (bre.moment.Y < this.momentMax_Negative.Y)
                {
                    this.momentMax_Negative.Y = bre.moment.Y;
                }
            }
            else
            {
                if (bre.moment.Y > this.momentMax_Positive.Y)
                {
                    this.momentMax_Positive.Y = bre.moment.Y;
                }
            }
            if (bre.moment.Z < 0.0)
            {
                if (bre.moment.Z < this.momentMax_Negative.Z)
                {
                    this.momentMax_Negative.Z = bre.moment.Z;
                }
            }
            else
            {
                if (bre.moment.Z > this.momentMax_Positive.Z)
                {
                    this.momentMax_Positive.Z = bre.moment.Z;
                }
            }

            double defx = Math.Abs(bre.deflection_mm.X);

            if (defx > this.deflectionMax_Abs_mm.X)
            {
                this.deflectionMax_Abs_mm.X = defx;
            }
            double defy = Math.Abs(bre.deflection_mm.Y);

            if (defy > this.deflectionMax_Abs_mm.Y)
            {
                this.deflectionMax_Abs_mm.Y = defy;
            }
            double defz = Math.Abs(bre.deflection_mm.Z);

            if (defz > this.deflectionMax_Abs_mm.Z)
            {
                this.deflectionMax_Abs_mm.Z = defz;
            }
            double defLocalz = Math.Abs(bre.deflectionLocal_mm.Z);

            if (defLocalz > this.deflectionLocalMax_Abs_mm.Z)
            {
                this.deflectionLocalMax_Abs_mm.Z = defLocalz;
            }

            foreach (sFrameSectionResult vr in bre.sectionResults)
            {
                if (vr.stress_Combined > this.stressCombinedAbs)
                {
                    this.stressCombinedAbs = vr.stress_Combined;
                }
            }
        }
Exemplo n.º 3
0
        public sMesh ConstructBeamColorMesh(sRange dataRange, eColorMode colorMode, sRange threshold, double du)
        {
            sMesh sm = new sMesh();

            int vertexID = 0;

            for (int i = 0; i < this.results.Count; ++i)
            {
                sFrameResult br = this.results[i];

                for (int j = 0; j < br.sectionResults.Count; ++j)
                {
                    sFrameSectionResult sr = br.sectionResults[j];
                    sColor vcol            = this.GetBeamResultColor(dataRange, colorMode, i, j, 255, threshold);
                    sXYZ   deflectionVec   = du * (sr.deflection_mm * 0.001);
                    sXYZ   deflectedPt     = sr.location + deflectionVec;
                    sm.SetVertex(vertexID, deflectedPt, vcol);
                    //or
                    //sm.SetVertex(vertexID, sr.point, vcol);

                    sr.ID = vertexID;

                    vertexID++;
                }
            }

            int vertexCountPerFace = this.results[0].sectionResults.Count;
            int faceIndex          = 0;

            for (int i = 0; i < this.results.Count - 1; ++i)
            {
                sFrameResult br_this = this.results[i];
                sFrameResult br_next = this.results[i + 1];

                for (int j = 0; j < br_this.sectionResults.Count; ++j)
                {
                    int id0 = 0;
                    int id1 = 0;
                    int id2 = 0;
                    int id3 = 0;
                    if (j < br_this.sectionResults.Count - 1)
                    {
                        id0 = br_this.sectionResults[j].ID;
                        id1 = br_next.sectionResults[j].ID;
                        id2 = br_next.sectionResults[j + 1].ID;
                        id3 = br_this.sectionResults[j + 1].ID;
                    }
                    else
                    {
                        id0 = br_this.sectionResults[j].ID;
                        id1 = br_next.sectionResults[j].ID;
                        id2 = br_next.sectionResults[0].ID;
                        id3 = br_this.sectionResults[0].ID;
                    }

                    sm.SetFace(faceIndex, faceIndex + 1, id0, id1, id2, id3);
                    faceIndex += 2;
                }
            }

            sm.ComputeNormals();
            return(sm);
        }