/// <summary> /// 计算节点相交处相应单元的轴力向量 /// </summary> /// <param name="node">节点号</param> /// <param name="ele">单元号(必须为FrameElement)</param> /// <param name="com">荷载组合</param> /// <returns>轴力向量</returns> public Vector3 GetNodeForceVec(int node, int ele, BLoadComb com) { Vector3 Res = new Vector3(); FrameElement fme = MM.elements[ele] as FrameElement; //如果节点不在单元上则返回0向量 if (fme.iNs.Contains(node) == false) { return(new Vector3()); } ElemForce Force = MM.CalElemForceComb(com, ele); if (fme.I == node) { Res = MM.getFrameVec(ele); Res.Normalize();//归一化 Res = Res * Force.Force_i.N; } else { Res = -MM.getFrameVec(ele); Res.Normalize();//归一化 Res = Res * Force.Force_j.N; } return(Res); }
private void 测试用命令ToolStripMenuItem_Click(object sender, EventArgs e) { #region 测试荷载组合功能 List <int> eles = SelectCollection.StringToList(this.cb_selectEle.Text); MidasGenModel.model.Bmodel cm; //如果单元选择数为0,作出提示 if (eles.Count == 0) { MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!"); return; } if (!this.HasToolWindow(_modelKey)) { MessageBox.Show("请先新建模型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } else { cm = ModelForm.CurModel; } string com = "SRSS3";//组合名 BLoadComb myCom = cm.LoadCombTable.getLoadComb(LCKind.STEEL, com); foreach (int ele in eles) { FrameElement cele = cm.elements[ele] as FrameElement; string outs = string.Format("++++++单元号:{0} 组合:{1}++++++", ele, com); MessageTool.Tb_out.AppendText(Environment.NewLine); MessageTool.Tb_out.AppendText(outs); ElemForce EFcom = cm.CalElemForceComb(myCom, ele); MessageTool.Tb_out.AppendText(Environment.NewLine + "[i]--" + EFcom.Force_i.ToString()); MessageTool.Tb_out.AppendText(Environment.NewLine + "[4/8]--" + EFcom.Force_48.ToString()); MessageTool.Tb_out.AppendText(Environment.NewLine + "[j]--" + EFcom.Force_j.ToString()); } #endregion }
//初始化荷载组合表 public void InitLoadComForm() { MainForm mf = this.Owner as MainForm; Bmodel mm = mf.ModelForm.CurModel; BLoadCombTable lct = mm.LoadCombTable;//荷载组合表 gv_LC.FixedColumnSplitter.Visible = false; gv_LC.Columns.Add(new Column("名称", typeof(string))); gv_LC.Columns.Add(new Column("激活", typeof(string))); gv_LC.Columns.Add(new Column("地震组合", typeof(string))); gv_LC.Columns.Add(new Column("说明", typeof(string))); List <string> GenCom = lct.ComGen; for (int i = 0; i < GenCom.Count; i++) { BLoadComb curCom = lct.getLoadComb(LCKind.GEN, GenCom[i]);//取得荷载组合 Xceed.Grid.DataRow Row = gv_LC.DataRows.AddNew(); Row.Cells[0].Value = GenCom[i]; Row.Cells[1].Value = curCom.bACTIVE ? "激活":"钝化"; Row.Cells[2].Value = curCom.bES ? "是":"否"; Row.Cells[3].Value = curCom.DESC; Row.BackColor = System.Drawing.Color.DarkSeaGreen; Row.EndEdit(); } //gv_LC.ReadOnly = false; //gv_LC.Columns[2].CellEditorManager = new CheckBoxEditor(); //gv_LC.Columns[2].CellEditorDisplayConditions = CellEditorDisplayConditions.Always; }
private void button5_Click(object sender, EventArgs e) { BLoadComb com = CurModel.LoadCombTable.getLoadComb(LCKind.STEEL, "sGen2"); ElemForce ef = CurModel.CalElemForceComb(com, 4); SecForce sf = ef.Force_i; FrameElement fe = CurModel.elements[4] as FrameElement; BSections sec = CurModel.sections[fe.iPRO]; double s1 = CodeCheck.CalPointStrength_YW(sf, sec, 1, fe.DPs); double s2 = CodeCheck.CalPointStrength_YW(sf, sec, 2, fe.DPs); double s3 = CodeCheck.CalPointStrength_YW(sf, sec, 3, fe.DPs); double s4 = CodeCheck.CalPointStrength_YW(sf, sec, 4, fe.DPs); return; }
/// <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"); }
/// <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();//完成数据行编辑 //} } }