コード例 #1
0
        private void BuildFESystem()
        {
            this.FEsystem = new StatSystem();
            this.FEsystem.PointMergeTolerance = this.systemSettings.mergeTolerance_m;

            this.FEsystem.MergeNewNodes = true;

            sStatConverter conv = new sStatConverter();

            foreach (IFrameSet bs in this.frameSets)
            {
                foreach (sFrame b in bs.frames)
                {
                    StatCrossSection cs = conv.ToStatCrossSection(b, bs.AsMinuteDensity);

                    StatNode n0 = this.FEsystem.AddNode(conv.ToCVector(b.node0));
                    StatNode n1 = this.FEsystem.AddNode(conv.ToCVector(b.node1));

                    C_vector uv = conv.ToCVector(b.upVector);

                    StatBeam sb = this.FEsystem.AddBeam(n0, n1, cs, uv);

                    b.extraData  = sb;
                    sb.ExtraData = b;
                }
            }

            foreach (sNode sn in this.nodes)
            {
                StatNode n = null;
                if (sn.boundaryCondition != null)
                {
                    //n = this.FEsystem.AddNode(sn.location.X, sn.location.Y, sn.location.Z);
                    n = FindStatNode(sn, this.systemSettings.mergeTolerance_m);
                    if (sn.boundaryCondition.supportType == eSupportType.FIXED)
                    {
                        n.SupportType = BOUNDARYCONDITIONS.ALL;
                    }
                    else if (sn.boundaryCondition.supportType == eSupportType.PINNED)
                    {
                        n.SupportType = BOUNDARYCONDITIONS.TRANSLATIONS;
                    }
                    else if (sn.boundaryCondition.supportType == eSupportType.CUSTOM)
                    {
                    }
                }

                if (sn.pointLoads != null && sn.pointLoads.Count > 0)
                {
                    n = FindStatNode(sn, this.systemSettings.mergeTolerance_m);
                }

                if (n != null)
                {
                    sn.extraData = n;
                    n.ExtraData  = sn;
                }
            }
        }
コード例 #2
0
        public void UpdateNodeResults()
        {
            sStatConverter conv = new sStatConverter();

            this.nodes.Clear();
            this.nodes = new List <sNode>();

            foreach (StatNode sn in this.FEsystem.Nodes)
            {
                int   count = 0;
                sNode n     = sn.ExtraData as sNode;
                if (n != null && sn.SupportType != BOUNDARYCONDITIONS.NONE)
                {
                    if (sn.ReactionForce.Length > 0.0)
                    {
                        count++;
                        n.boundaryCondition.reaction_force = conv.TosXYZ(sn.ReactionForce);
                    }
                    if (sn.ReactionMoment.Length > 0.0)
                    {
                        count++;
                        n.boundaryCondition.reaction_moment = conv.TosXYZ(sn.ReactionMoment);
                    }
                }

                if (n != null && n.pointLoads != null && n.pointLoads.Count > 0)
                {
                    count++;
                }

                if (count > 0)
                {
                    this.nodes.Add(n.DuplicatesNode());
                }
            }
        }
コード例 #3
0
        private void AwaresBeamResult(sFrame sb, ref sResultRange bsRe, double dataLenTol)
        {
            StatBeamResults br   = new StatBeamResults();
            sStatConverter  conv = new sStatConverter();

            StatBeam b = sb.extraData as StatBeam;

            b.RecoverForces();

            sb.beamWeight = b.Weight;
            sb.results    = new List <sFrameResult>();

            double len   = sb.axis.length;
            int    count = (int)(len / dataLenTol);

            if (count < 1)
            {
                count = 1;
            }

            double step = 1.0 / (double)(count);

            for (int i = 0; i < count + 1; ++i)
            {
                double tNow = step * i;
                br.t = tNow;
                b.GetInterpolatedResultsAt(new C_vector(0, 0, -1), this.FEsystem.DeadLoadFactor, br);

                sFrameResult bre = new sFrameResult();
                bre.moment             = new sXYZ(br.MomentL.x, br.MomentL.y, br.MomentL.z);
                bre.force              = new sXYZ(-br.ForceL.x, br.ForceL.y, br.ForceL.z); /// force X negate?????????
                bre.deflection_mm      = conv.TosXYZ(b.Csys.LocalToGlobalVector(br.DeflL * 1000));
                bre.deflectionLocal_mm = conv.TosXYZ(br.DeflL * 1000);

                bre.parameterAt = tNow;


                sPlane secPlane = new sPlane(sb.axis.PointAt(tNow), sb.localPlane.Xaxis, sb.localPlane.Yaxis);

                List <sXYZ> secVertices = new List <sXYZ>();
                if (sb.crossSection.sectionType == eSectionType.AISC_I_BEAM)
                {
                    secVertices = sb.crossSection.GetWbeamFaceVertices(secPlane).ToList();
                }
                else if (sb.crossSection.sectionType == eSectionType.HSS_REC)
                {
                    secVertices = sb.crossSection.GetHSSRecFaceVertices_Simple(secPlane).ToList();
                }
                else if (sb.crossSection.sectionType == eSectionType.HSS_ROUND)
                {
                    secVertices = sb.crossSection.GetHSSRoundFaceVertices_Simple(secPlane).ToList();
                }
                else if (sb.crossSection.sectionType == eSectionType.SQUARE)
                {
                    secVertices = sb.crossSection.GetSquareFaceVertices_Simple(secPlane).ToList();
                }
                else if (sb.crossSection.sectionType == eSectionType.RECTANGLAR)
                {
                    secVertices = sb.crossSection.GetRecFaceVertices_Simple(secPlane).ToList();
                }
                else if (sb.crossSection.sectionType == eSectionType.ROUND)
                {
                    secVertices = sb.crossSection.GetRoundFaceVertices_Simple(secPlane).ToList();
                }

                if (secVertices != null)
                {
                    for (int j = 0; j < secVertices.Count; ++j)
                    {
                        sXYZ svp      = secVertices[j];
                        sXYZ localDir = svp - sb.axis.PointAt(tNow);

                        sXYZ ToLocalZ = localDir.ProjectTo(secPlane.Zaxis);
                        sXYZ ToLocalY = localDir.ProjectTo(secPlane.Yaxis);

                        double len_ToLocalZ = ToLocalZ.Z; // vertical like
                        double len_ToLocalY = ToLocalY.Y; // horizontal like

                        br.zL = len_ToLocalZ;             // vertical like
                        br.yL = len_ToLocalY;             // horizontal like

                        double axialStress_X = (br.ForceL.x / b.CrossSection.Area);
                        //double axialStress_Y = ??;
                        //double axialStress_Z = ??;

                        double MyStress = ((br.MomentL.y * br.zL) / b.CrossSection.Iyy);
                        double MzStress = ((br.MomentL.z * br.yL) / b.CrossSection.Izz);
                        //double MxStress = ??

                        double stressTest = axialStress_X + MyStress - MzStress; //why negate?...(StatBeamResult does this)

                        //do I need?
                        //b.GetSectionPointResult(br);

                        sFrameSectionResult secRe = new sFrameSectionResult();
                        secRe.location      = svp;
                        secRe.deflection_mm = conv.TosXYZ(b.Csys.LocalToGlobalVector(br.DeflL * 1000));

                        secRe.stress_Combined = Math.Abs(stressTest);
                        secRe.stress_Axial_X  = axialStress_X;
                        secRe.stress_Moment_Y = MyStress;
                        secRe.stress_Moment_Z = MzStress;

                        bre.sectionResults.Add(secRe);
                    }
                }

                bsRe.UpdateMaxValues(bre);
                sb.results.Add(bre);
            }
        }