예제 #1
0
        /// <summary>
        /// 测试用命令函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            string modelpath = Path.ChangeExtension(tb_mgt.Text, ".ga1");
            string path      = Path.ChangeExtension(tb_mgt.Text, ".nl");

            MidasGenModel.model.Bmodel mm = new Bmodel();
            //MidasGenModel.Application.ReadModelBinary(modelpath,ref mm);
            mm.ReadFromMgt(tb_mgt.Text);
            mm.ReadElemForces(path);

            //存储带内力的模型
            string modelpath2 = Path.ChangeExtension(modelpath, ".ga2");

            MidasGenModel.Application.WriteModelBinary(mm, modelpath2);

            //计算组合内力
            bool      tt   = mm.LoadCombTable.ContainsKey("gStr1");
            BLoadComb comb = mm.LoadCombTable["gStr1"];
            ElemForce ef   = mm.CalElemForceComb(comb, 4);

            MessageBox.Show("OK");
        }
예제 #2
0
        /// <summary>
        /// 输出指定单元指定截面的设计内力
        /// </summary>
        /// <param name="iEle">单元号</param>
        /// <param name="loc">截面位置</param>
        /// <param name="mm">模型数据</param>
        /// <param name="cm">设计数据</param>
        public void printDesignForcebyEle(int iEle, int loc, ref Bmodel mm, ref BCheckModel cm)
        {
            List <string> coms = mm.LoadCombTable.ComSteel;//钢结构设计组合表
            string        sLoc = null;

            switch (loc)
            {
            case 0: sLoc = "I"; break;

            case 1: sLoc = "1/8"; break;

            case 2: sLoc = "2/8"; break;

            case 3: sLoc = "3/8"; break;

            case 4: sLoc = "4/8"; break;

            case 5: sLoc = "5/8"; break;

            case 6: sLoc = "6/8"; break;

            case 7: sLoc = "7/8"; break;

            case 8: sLoc = "J"; break;
            }
            //指定地震工况
            string        LcEx = "SRSS3";
            string        LcEy = "SRSS4";
            string        LcEz = "Ez";
            List <string> LcEs = new List <string>()
            {
                LcEx, LcEy, LcEz
            };

            foreach (string com in coms)
            {
                BLoadComb curComb = mm.LoadCombTable.getLoadComb(LCKind.STEEL, com); //正常组合
                BLoadComb Comb_N  = curComb.Clone() as BLoadComb;
                BLoadComb Comb_M  = curComb.Clone() as BLoadComb;                    //弯矩调整组合
                BLoadComb Comb_V  = curComb.Clone() as BLoadComb;                    //剪力调整组合
                if (!curComb.bACTIVE)
                {
                    continue;
                }

                ElemForce          EFcom  = mm.CalElemForceComb(curComb, iEle);
                Xceed.Grid.DataRow curRow = gc_Table.DataRows.AddNew();           //添加数据行
                if (cm.QuakeAdjustFacors.ContainsKey(iEle) & curComb.hasLC(LcEs)) //如果为地震组合且有放大
                {
                    BQuakeAdjustFactor qaf = cm.QuakeAdjustFacors[iEle];          //放大系数
                    Comb_N.magnifyLc(LcEs, qaf.N_LC);                             //组合前放大
                    Comb_N.magnifyComb(qaf.N_COM);                                //组合后放大
                    Comb_M.magnifyLc(LcEs, qaf.M_LC);                             //组合前放大
                    Comb_M.magnifyComb(qaf.M_COM);                                //组合后放大
                    Comb_V.magnifyLc(LcEs, qaf.V_LC);                             //组合前放大
                    Comb_V.magnifyComb(qaf.V_COM);                                //组合后放大
                    curRow.BackColor = Color.AliceBlue;
                }
                ElemForce EFcom_N = mm.CalElemForceComb(Comb_N, iEle);
                ElemForce EFcom_M = mm.CalElemForceComb(Comb_M, iEle);
                ElemForce EFcom_V = mm.CalElemForceComb(Comb_V, iEle);

                curRow.Cells[0].Value = iEle;
                curRow.Cells[1].Value = sLoc;
                curRow.Cells[2].Value = com;
                curRow.Cells[3].Value = Math.Round(EFcom_N[loc].N / 1000, 1);
                curRow.Cells[4].Value = Math.Round(EFcom_V[loc].Vy / 1000, 1);
                curRow.Cells[5].Value = Math.Round(EFcom_V[loc].Vz / 1000, 1);
                curRow.Cells[6].Value = Math.Round(EFcom[loc].T / 1000, 1);
                curRow.Cells[7].Value = Math.Round(EFcom_M[loc].My / 1000, 1);
                curRow.Cells[8].Value = Math.Round(EFcom_M[loc].Mz / 1000, 1);
                curRow.EndEdit();//完成数据行编辑

                //if (cm.QuakeAdjustFacors.ContainsKey(iEle) & curComb.hasLC(LcEs))//如果为地震组合且有放大
                //{
                //    //调整前数据
                //    Xceed.Grid.DataRow curRowN = gc_Table.DataRows.AddNew();//添加数据
                //    curRowN.BackColor = Color.Red;
                //    curRowN.Cells[0].Value = iEle;
                //    curRowN.Cells[1].Value = sLoc;
                //    curRowN.Cells[2].Value = com;
                //    curRowN.Cells[3].Value = EFcom[loc].N / 1000;
                //    curRowN.Cells[4].Value = EFcom[loc].Vy / 1000;
                //    curRowN.Cells[5].Value = EFcom[loc].Vz / 1000;
                //    curRowN.Cells[6].Value = EFcom[loc].T / 1000;
                //    curRowN.Cells[7].Value = EFcom[loc].My / 1000;
                //    curRowN.Cells[8].Value = EFcom[loc].Mz / 1000;
                //    curRowN.EndEdit();//完成数据行编辑
                //}
            }
        }
예제 #3
0
        /// <summary>
        /// 验算单个单元
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="iElem">单元号</param>
        public void CheckElemByNum(ref Bmodel mm, int iElem)
        {
            EleCheckResData EleData = new EleCheckResData(iElem); //单元组合验算表

            List <string> coms = mm.LoadCombTable.ComSteel;

            foreach (string com in coms)
            {
                double gamma_re = 1.0;//承载力抗震调整系数
                //如果未激活则不验算
                if (mm.LoadCombTable[com].bACTIVE == false)
                {
                    continue;
                }
                FrameElement ele = mm.elements[iElem] as FrameElement;

                //若为地震组合则取存储的承载力抗震调整系数
                if (mm.LoadCombTable[com].hasLC_ANAL(ANAL.ES) ||
                    mm.LoadCombTable[com].hasLC_ANAL(ANAL.RS))
                {
                    gamma_re = ele.DPs.Gamma_re;
                }

                //先进行单元内力组合
                ElemForce EFcom = mm.CalElemForceComb(mm.LoadCombTable[com], iElem);

                //计算强度
                double Strength_i = CodeCheck.CalSecMaxStrength_YW(EFcom.Force_i,
                                                                   mm.sections[ele.iPRO],
                                                                   ele.DPs) * gamma_re;//i截面计算强度
                double Strength_2 = CodeCheck.CalSecMaxStrength_YW(EFcom.Force_48,
                                                                   mm.sections[ele.iPRO],
                                                                   ele.DPs) * gamma_re;
                double Strength_j = CodeCheck.CalSecMaxStrength_YW(EFcom.Force_j,
                                                                   mm.sections[ele.iPRO],
                                                                   ele.DPs) * gamma_re;
                //计算稳定性强度
                //double Stability_i = CodeCheck.CalStability_YW(EFcom.Force_i, mm.sections[ele.iPRO],
                //    ele.DPs, mm.mats[ele.iMAT].Elast)*gamma_re;
                //double Stability_2 =CodeCheck. CalStability_YW(EFcom.Force_48, mm.sections[ele.iPRO],
                //    ele.DPs, mm.mats[ele.iMAT].Elast)*gamma_re;
                //double Stability_j =CodeCheck. CalStability_YW(EFcom.Force_j, mm.sections[ele.iPRO],
                //    ele.DPs, mm.mats[ele.iMAT].Elast)*gamma_re;
                double Stability_i = CodeCheck.CalSecMaxStability_YW(EFcom.Force_i, mm.sections[ele.iPRO],
                                                                     ele.DPs, mm.mats[ele.iMAT].Elast) * gamma_re;
                double Stability_2 = CodeCheck.CalSecMaxStability_YW(EFcom.Force_48, mm.sections[ele.iPRO],
                                                                     ele.DPs, mm.mats[ele.iMAT].Elast) * gamma_re;
                double Stability_j = CodeCheck.CalSecMaxStability_YW(EFcom.Force_j, mm.sections[ele.iPRO],
                                                                     ele.DPs, mm.mats[ele.iMAT].Elast) * gamma_re;

                double Ratio   = Math.Max(Strength_i, Stability_i) / ele.DPs.fy;
                double Ratio_2 = Math.Max(Strength_2, Stability_2) / ele.DPs.fy;
                double Ratio_j = Math.Max(Strength_j, Stability_j) / ele.DPs.fy;

                //加入到数据库
                SingleEleCheckResData Secrd =
                    new SingleEleCheckResData("I", com, EFcom.Force_i.N, EFcom.Force_i.My, EFcom.Force_i.Mz,
                                              Strength_i, Stability_i, Ratio);
                SingleEleCheckResData Secrd_2 =
                    new SingleEleCheckResData("1/2", com, EFcom.Force_48.N, EFcom.Force_48.My, EFcom.Force_48.Mz,
                                              Strength_2, Stability_2, Ratio_2);
                SingleEleCheckResData Secrd_j =
                    new SingleEleCheckResData("J", com, EFcom.Force_j.N, EFcom.Force_j.My, EFcom.Force_j.Mz,
                                              Strength_j, Stability_j, Ratio_j);

                Secrd = Secrd.TheMaxRatio(Secrd_2);//取得控制内力
                Secrd = Secrd.TheMaxRatio(Secrd_j);

                EleData.Add(com, Secrd);//添加到单元验算结果数据中
            }

            //添加到数据表
            if (this._CheckResTable.ContainsKey(iElem))
            {
                this._CheckResTable.Remove(iElem);
                this._CheckResTable.Add(iElem, EleData);
            }
            else
            {
                this._CheckResTable.Add(iElem, EleData);
            }
        }