コード例 #1
0
        public void SetEndLoads(int sign, Joint joint, int GrassLCId, int GrassId, ResultOfInternalForces resLoadCase, ResultOnSection resSec)
        {
            //Pick EndLoads
            //API to IDEA UI, My, Vy and Vz are plotted negatively
            double N0  = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.N;
            double My0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.My;
            double Vz0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vz;
            double Vy0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vy;
            double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mz;
            double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mt;

            //From Karamba3D to Framework
            double N  = N0 * sign;
            double My = My0 * sign;
            double Vz = Vz0 * sign;
            double Vy = Vy0 * sign;
            double Mz = Mz0 * sign;
            double Mt = Mt0 * sign;

            resLoadCase.N  = N;
            resLoadCase.My = My;
            resLoadCase.Qz = Vz;
            resLoadCase.Qy = Vy;
            resLoadCase.Mz = Mz;
            resLoadCase.Mx = Mt;

            resSec.Results.Add(resLoadCase);
        }
コード例 #2
0
        private void CreateIDEAOpenModelResults()
        {
            openStructModelR = new OpenModelResult();
            openStructModelR.ResultOnMembers = new List <ResultOnMembers>();
            ResultOnMembers resIF = new ResultOnMembers();

            for (int ib = 0; ib < openStructModel.Member1D.Count; ib++)
            {
                Member1D mb = openStructModel.Member1D[ib];
                for (int iel = 0; iel < mb.Elements1D.Count; iel++)
                {
                    Element1D      elem      = openStructModel.Element1D.First(c => c.Id == mb.Elements1D[iel].Id);
                    ResultOnMember resMember = new ResultOnMember(new Member()
                    {
                        Id = elem.Id, MemberType = MemberType.Element1D
                    }, ResultType.InternalForces);
                    int numPoints = 10;
                    for (int ip = 0; ip <= numPoints; ip++)
                    {
                        ResultOnSection resSec = new ResultOnSection();

                        resSec.AbsoluteRelative = AbsoluteRelative.Relative;
                        resSec.Position         = (double)ip / (double)numPoints;
                        int count = openStructModel.LoadCase.Count;
                        for (int i = 1; i <= count; i++)
                        {
                            ResultOfInternalForces resLc = new ResultOfInternalForces();
                            int loadCaseNumber           = i;
                            resLc.Loading = new ResultOfLoading()
                            {
                                Id = loadCaseNumber, LoadingType = LoadingType.LoadCase
                            };
                            resLc.Loading.Items.Add(new ResultOfLoadingItem()
                            {
                                Coefficient = 1.0
                            });
                            resLc.N  = 15000;
                            resLc.Qy = 2;
                            resLc.Qz = 3;
                            resLc.Mx = 4;
                            resLc.My = (ip + 1) * 21000;
                            resLc.Mz = 6;
                            resSec.Results.Add(resLc);
                        }

                        resMember.Results.Add(resSec);
                    }

                    resIF.Members.Add(resMember);
                }
            }

            openStructModelR.ResultOnMembers.Add(resIF);
        }
コード例 #3
0
        private void CreateIDEAOpenModelResultsOLD(Joint joint)
        {
            Project project = joint.project;

            openModelResult.ResultOnMembers = new List <ResultOnMembers>();
            ResultOnMembers resultIF = new ResultOnMembers();

            for (int ibeam = 0; ibeam < openModel.Member1D.Count; ibeam++)
            {
                //Continues Chord consist out of one member
                Member1D mb = openModel.Member1D[ibeam];
                for (int iele = 0; iele < mb.Elements1D.Count; iele++)
                {
                    //Continues chord consist out of two elements
                    Element1D elem = openModel.Element1D.First(a => a.Id == mb.Elements1D[iele].Id);

                    //results on members are constant in the framework
                    ResultOnMember resMember = new ResultOnMember(new Member()
                    {
                        Id = elem.Id, MemberType = MemberType.Element1D
                    }, ResultType.InternalForces);
                    int numPoints = 10;
                    for (int ip = 0; ip <= numPoints; ip++)
                    {
                        ResultOnSection resSec = new ResultOnSection();
                        resSec.AbsoluteRelative = AbsoluteRelative.Relative;
                        resSec.Position         = (double)ip / (double)numPoints;
                        //iterate over loadcases
                        int count = openModel.LoadCase.Count;
                        for (int i = 1; i <= count; i++)
                        {
                            ResultOfInternalForces resLoadCase = new ResultOfInternalForces();
                            int loadCaseNumber = i;
                            resLoadCase.Loading = new ResultOfLoading()
                            {
                                Id = loadCaseNumber, LoadingType = LoadingType.LoadCase
                            };
                            resLoadCase.Loading.Items.Add(new ResultOfLoadingItem()
                            {
                                Coefficient = 1.0
                            });


                            //Check if Startpoint is equal to centerpoint
                            int GrassId   = elem.Id - 1;//Element1D.Id - 1 == ElementRAZ.id
                            int GrassLCId = i - 1;


                            AttachedMember attached = joint.attachedMembers.Find(a => a.ElementRAZ.id == GrassId);
                            //The following if statements simulate that every member has a local coordinate system
                            //where the local z - axis points counterclockwise(shear force)
                            //and where the positive bending moment is clockwise
                            if (attached.isStartPoint == true)
                            {
                                //Pick startloads
                                // API to IDEA UI, My and Vz are plotted negatively
                                double N0  = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.N;
                                double My0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.My * -1;
                                double Vz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vz * -1;

                                double Vy0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vy;
                                double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mz;
                                double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mt;

                                //From Karamba3D to Framework
                                double N  = N0;
                                double My = My0;
                                double Vz = Vz0;

                                double Vy = Vy0;
                                double Mz = Mz0;
                                double Mt = Mt0;


                                //From Framework to IDEA
                                VectorRAZ unitvector = attached.ideaLine.vector.Unitize();//gaat niet op bij ColumnT-Joint want gebruikt globale asses ipv locale
                                if (unitvector.X < -10e-6)
                                {
                                    if (attached is BearingMember)  //exception
                                    {
                                        resLoadCase.N  = N;         //
                                        resLoadCase.My = My * (-1); // in case of start point M of the begin element of the chords needs to be flipped
                                        resLoadCase.Qz = Vz * (-1); //

                                        resLoadCase.Qy = Vy;
                                        resLoadCase.Mz = Mz0;
                                        resLoadCase.Mx = Mt;

                                        resSec.Results.Add(resLoadCase);
                                    }
                                    else//members where rule needs to be applied to
                                    {
                                        resLoadCase.N  = N;//
                                        resLoadCase.My = My * -1; //
                                        resLoadCase.Qz = Vz * -1; //

                                        resLoadCase.Qy = Vy;
                                        resLoadCase.Mz = Mz0;
                                        resLoadCase.Mx = Mt;

                                        resSec.Results.Add(resLoadCase);
                                    }
                                }
                                else
                                {
                                    resLoadCase.N  = N;  //
                                    resLoadCase.My = My; //
                                    resLoadCase.Qz = Vz; //

                                    resLoadCase.Qy = Vy;
                                    resLoadCase.Mz = Mz0;
                                    resLoadCase.Mx = Mt;

                                    resSec.Results.Add(resLoadCase);
                                }
                            }
                            else//isEndPoint
                            {
                                //Pick endloads
                                //API to IDEA UI, My and Vz are plotted negatively
                                double N0  = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.N;
                                double My0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.My * -1;
                                double Vz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vz * -1;
                                double Vy0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vy;
                                double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mz;
                                double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mt;

                                //From Karamba3D to Framework
                                double N  = N0;
                                double My = My0 * (-1); //*-1
                                double Vz = Vz0 * (-1); //*-1

                                double Vy = Vy0 * (-1); //*-1
                                double Mz = Mz0 * (-1); //*-1
                                double Mt = Mt0 * (-1); //*-1

                                //From Framework to IDEA
                                VectorRAZ unitvector = attached.ideaLine.vector.Unitize();//gaat niet op bij ColumnT-Joint want gebruikt globale asses ipv locale
                                if (unitvector.X < -10e-6)
                                {
                                    if (attached is BearingMember)  //exception
                                    {
                                        resLoadCase.N  = N;         //
                                        resLoadCase.My = My * (-1); // in case of start point M of the begin element of the chords needs to be flipped
                                        resLoadCase.Qz = Vz * (-1); //

                                        resLoadCase.Qy = Vy * (-1);
                                        resLoadCase.Mz = Mz0 * (-1);
                                        resLoadCase.Mx = Mt * (-1);

                                        resSec.Results.Add(resLoadCase);
                                    }
                                    else//members where rule needs to be applied to
                                    {
                                        resLoadCase.N  = N;//
                                        resLoadCase.My = My * (-1); // * (-1)
                                        resLoadCase.Qz = Vz * (-1); // * (-1)

                                        resLoadCase.Qy = Vy * (-1);
                                        resLoadCase.Mz = Mz0 * (-1);
                                        resLoadCase.Mx = Mt * (-1);

                                        resSec.Results.Add(resLoadCase);
                                    }
                                }
                                else
                                {
                                    resLoadCase.N  = N;  //
                                    resLoadCase.My = My; //
                                    resLoadCase.Qz = Vz; //

                                    resLoadCase.Qy = Vy;
                                    resLoadCase.Mz = Mz0;
                                    resLoadCase.Mx = Mt;

                                    resSec.Results.Add(resLoadCase);
                                }
                            }
                        }
                        resMember.Results.Add(resSec);
                    }
                    resultIF.Members.Add(resMember);
                }
            }
            openModelResult.ResultOnMembers.Add(resultIF);
        }
コード例 #4
0
        private void CreateIDEAOpenModelResults(Joint joint)
        {
            Project project = joint.project;

            openModelResult.ResultOnMembers = new List <ResultOnMembers>();
            ResultOnMembers resultIF = new ResultOnMembers();

            for (int ibeam = 0; ibeam < openModel.Member1D.Count; ibeam++)
            {
                //Continues Chord consist out of one member
                Member1D mb = openModel.Member1D[ibeam];
                //Loop is needed in case of a continuous member
                for (int iele = 0; iele < mb.Elements1D.Count; iele++)
                {
                    //Continues chord consists out of two elements
                    Element1D elem = openModel.Element1D.First(a => a.Id == mb.Elements1D[iele].Id);//wordt hier de link met het verkeerde element gelegd?
                    //word de verkeerde id toegekent?

                    //results on members are constant in the framework
                    ResultOnMember resMember = new ResultOnMember(new Member()
                    {
                        Id = elem.Id, MemberType = MemberType.Element1D
                    }, ResultType.InternalForces);
                    int numPoints = 10;
                    for (int ip = 0; ip <= numPoints; ip++)
                    {
                        ResultOnSection resSec = new ResultOnSection();
                        resSec.AbsoluteRelative = AbsoluteRelative.Relative;
                        resSec.Position         = (double)ip / (double)numPoints;
                        //iterate over loadcases
                        int count = openModel.LoadCase.Count;
                        for (int i = 1; i <= count; i++)
                        {
                            ResultOfInternalForces resLoadCase = new ResultOfInternalForces();
                            int loadCaseNumber = i;
                            resLoadCase.Loading = new ResultOfLoading()
                            {
                                Id = loadCaseNumber, LoadingType = LoadingType.LoadCase
                            };
                            resLoadCase.Loading.Items.Add(new ResultOfLoadingItem()
                            {
                                Coefficient = 1.0
                            });


                            //Check if Startpoint is equal to centerpoint
                            int GrassId   = elem.Id - 1;//Element1D.Id - 1 == ElementRAZ.id
                            int GrassLCId = i - 1;


                            AttachedMember attached = joint.attachedMembers.Find(a => a.ElementRAZ.id == GrassId);
                            //The following if statements simulate that every member has a local coordinate system
                            //where the local z-axis points counterclockwise (shear force)
                            //and where the positive bending moment is clockwise
                            if (attached.isStartPoint == true)
                            {
                                //Pick startloads
                                //API to IDEA UI, My, Vy and Vz are plotted negatively
                                double N0  = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.N;
                                double My0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.My;
                                double Vz0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vz;
                                double Vy0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vy;
                                double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mz;
                                double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mt;

                                //From Karamba3D to Framework
                                double N  = N0;
                                double My = My0;
                                double Vz = Vz0;

                                double Vy = Vy0;
                                double Mz = Mz0;
                                double Mt = Mt0;

                                resLoadCase.N  = N;  //
                                resLoadCase.My = My; //
                                resLoadCase.Qz = Vz; //

                                resLoadCase.Qy = Vy;
                                resLoadCase.Mz = Mz;
                                resLoadCase.Mx = Mt;

                                resSec.Results.Add(resLoadCase);
                            }
                            else//isEndPoint
                            {
                                //Pick endloads
                                //API to IDEA UI, My, Vy and Vz are plotted negatively
                                double N0  = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.N;
                                double My0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.My;
                                double Vz0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vz;
                                double Vy0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vy;
                                double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mz;
                                double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mt;

                                //From Karamba3D to Framework
                                double N  = N0 * (-1);
                                double My = My0 * (-1); //

                                double Vz = Vz0 * (-1);
                                double Vy = Vy0 * (-1);

                                double Mz = Mz0 * (-1); //
                                double Mt = Mt0 * (-1);

                                resLoadCase.N  = N;  //
                                resLoadCase.My = My; //
                                resLoadCase.Qz = Vz; //

                                resLoadCase.Qy = Vy;
                                resLoadCase.Mz = Mz;
                                resLoadCase.Mx = Mt;

                                resSec.Results.Add(resLoadCase);
                            }
                        }
                        resMember.Results.Add(resSec);
                    }
                    resultIF.Members.Add(resMember);
                }
            }
            openModelResult.ResultOnMembers.Add(resultIF);
        }
コード例 #5
0
        private void CreateIDEAOpenModelResults(Joint joint)
        {
            Project project = joint.project;

            openModelResult.ResultOnMembers = new List <ResultOnMembers>();
            ResultOnMembers resultIF = new ResultOnMembers();

            for (int ibeam = 0; ibeam < openModel.Member1D.Count; ibeam++)
            {
                //Continues Chord consist out of one member
                Member1D mb = openModel.Member1D[ibeam];
                //Loop is needed in case of a continuous member
                for (int iele = 0; iele < mb.Elements1D.Count; iele++)
                {
                    //Continouos chord consists out of two elements
                    Element1D elem = openModel.Element1D.First(a => a.Id == mb.Elements1D[iele].Id);//wordt hier de link met het verkeerde element gelegd?
                    //word de verkeerde id toegekent?

                    //results on members are constant in the framework
                    ResultOnMember resMember = new ResultOnMember(new Member()
                    {
                        Id = elem.Id, MemberType = MemberType.Element1D
                    }, ResultType.InternalForces);
                    int numPoints = 1;
                    for (int ip = 0; ip <= numPoints; ip++)
                    {
                        ResultOnSection resSec = new ResultOnSection();
                        resSec.AbsoluteRelative = AbsoluteRelative.Relative;
                        resSec.Position         = (double)ip / (double)numPoints;
                        //iterate over loadcases
                        int count = openModel.LoadCase.Count;
                        for (int i = 1; i <= count; i++)
                        {
                            ResultOfInternalForces resLoadCase = new ResultOfInternalForces();
                            int loadCaseNumber = i;
                            resLoadCase.Loading = new ResultOfLoading()
                            {
                                Id = loadCaseNumber, LoadingType = LoadingType.LoadCase
                            };
                            resLoadCase.Loading.Items.Add(new ResultOfLoadingItem()
                            {
                                Coefficient = 1.0
                            });


                            //Check if Startpoint is equal to centerpoint
                            int GrassId   = elem.Id - 1; //Element1D.Id - 1 == ElementRAZ.id
                            int GrassLCId = i - 1;       //Loadcase grasshopper starts at 0, Loadcase IDEA starts at 1.

                            List <BearingMember> BM = joint.attachedMembers.OfType <BearingMember>().ToList();

                            //Find the element to check: isStartpoint true or false
                            AttachedMember attached = joint.attachedMembers.Find(a => a.ElementRAZ.id == GrassId);
                            if (attached.isStartPoint == true) //
                            {
                                SetStartLoads(1, joint, GrassLCId, GrassId, resLoadCase, resSec);
                            }
                            else//isEndPoint
                            {
                                if (attached is BearingMember && BM.Count == 2)
                                {
                                    SetEndLoads(1, joint, GrassLCId, GrassId, resLoadCase, resSec);
                                }
                                else
                                {
                                    SetEndLoads(-1, joint, GrassLCId, GrassId, resLoadCase, resSec);
                                }
                            }
                        }
                        resMember.Results.Add(resSec);
                    }
                    resultIF.Members.Add(resMember);
                }
            }
            openModelResult.ResultOnMembers.Add(resultIF);
        }