/// <summary> /// 要素の節点数から要素形状区分と補間次数を取得する /// </summary> /// <param name="eNodeCnt">要素の節点数</param> /// <param name="elemShapeDv">要素形状区分</param> /// <param name="order">補間次数</param> /// <param name="vertexCnt">頂点数</param> public static void GetElementShapeDvAndOrderByElemNodeCnt(int eNodeCnt, out Constants.FemElementShapeDV elemShapeDv, out int order, out int vertexCnt) { elemShapeDv = Constants.FemElementShapeDV.Triangle; order = Constants.SecondOrder; vertexCnt = Constants.TriVertexCnt; if (eNodeCnt == Constants.TriNodeCnt_SecondOrder) { // 2次三角形 elemShapeDv = Constants.FemElementShapeDV.Triangle; order = Constants.SecondOrder; vertexCnt = Constants.TriVertexCnt; } else if (eNodeCnt == Constants.QuadNodeCnt_SecondOrder_Type2) { // 2次四角形 elemShapeDv = Constants.FemElementShapeDV.QuadType2; order = Constants.SecondOrder; vertexCnt = Constants.QuadVertexCnt; } else if (eNodeCnt == Constants.TriNodeCnt_FirstOrder) { // 1次三角形 elemShapeDv = Constants.FemElementShapeDV.Triangle; order = Constants.FirstOrder; vertexCnt = Constants.TriVertexCnt; } else if (eNodeCnt == Constants.QuadNodeCnt_FirstOrder) { // 1次四角形 elemShapeDv = Constants.FemElementShapeDV.QuadType2; order = Constants.FirstOrder; vertexCnt = Constants.QuadVertexCnt; } else { // 未対応 System.Diagnostics.Debug.Assert(false); } }
public MeshViewFrm(Constants.FemElementShapeDV elemShapeDv, int elemOrder, FemPostProLogic postPro) { InitializeComponent(); // データを受け取る ElemShapeDv = elemShapeDv; ElemOrder = elemOrder; PostPro = postPro; //this.DoubleBuffered = true; // ダブルバッファ制御用のプロパティを強制的に取得する System.Reflection.PropertyInfo p; p = typeof(System.Windows.Forms.Control).GetProperty( "DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); // ダブルバッファを有効にする p.SetValue(panelMesh, true, null); // メッシュ形状ラベル string shapeStr = ElemShapeDv == Constants.FemElementShapeDV.QuadType2? "四角形" : "三角形"; labelElemShape.Text = string.Format("{0}次{1}要素", ElemOrder, shapeStr); labelMeshInfo.Text = string.Format("節点数: {0} 要素数: {1}", PostPro.NodeCnt, PostPro.ElementCnt); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="elemShapeDv">要素形状区分</param> /// <param name="order">補間次数</param> /// <param name="text">表示テキスト</param> public ElemShapeStruct(Constants.FemElementShapeDV elemShapeDv, int order, string text) { ElemShapeDv = elemShapeDv; Order = order; Text = text; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="normalizedFreq1">計算開始規格化周波数</param> /// <param name="normalizedFreq2">計算終了規格化周波数</param> /// <param name="calcFreqCnt">計算点数</param> /// <param name="wgStructureDv">導波路構造区分</param> /// <param name="waveModeDv">モード区分</param> /// <param name="elemShapeDv">要素形状区分</param> /// <param name="elemOrder">要素次数</param> /// <param name="lsEqnSolverDv">線形方程式解法区分</param> /// <param name="waveguideWidthForEPlane">導波路幅(E面解析用)</param> public CalcSettingFrm(double normalizedFreq1, double normalizedFreq2, int calcFreqCnt, FemSolver.WGStructureDV wgStructureDv, FemSolver.WaveModeDV waveModeDv, Constants.FemElementShapeDV elemShapeDv, int elemOrder, FemSolver.LinearSystemEqnSoverDV lsEqnSolverDv, double waveguideWidthForEPlane) { InitializeComponent(); DialogResult = DialogResult.None; // フィールドに格納 NormalizedFreq1 = normalizedFreq1; NormalizedFreq2 = normalizedFreq2; CalcFreqCnt = calcFreqCnt; WGStructureDv = wgStructureDv; WaveModeDv = waveModeDv; ElemShapeDv = elemShapeDv; ElemOrder = elemOrder; LsEqnSolverDv = lsEqnSolverDv; if (CalcFreqCnt == 0) { // 既定値を設定 NormalizedFreq1 = Constants.DefNormalizedFreqRange[0]; NormalizedFreq2 = Constants.DefNormalizedFreqRange[1]; CalcFreqCnt = Constants.DefCalcFreqencyPointCount; } // GUIにセット // 計算範囲 textBoxMinFreq.Text = string.Format("{0:F3}", NormalizedFreq1); textBoxMaxFreq.Text = string.Format("{0:F3}", NormalizedFreq2); double delta = (NormalizedFreq2 - NormalizedFreq1) / CalcFreqCnt; textBoxDeltaFreq.Text = string.Format("{0:F3}", delta); // 計算モード RadioBtnModeDvs = new RadioButton[]{ radioBtnWaveModeDvTE, radioBtnWaveModeDvTM }; FemSolver.WaveModeDV[] waveModeDvOf_radioBtnModeDvs = { FemSolver.WaveModeDV.TE, FemSolver.WaveModeDV.TM }; for (int i = 0; i < RadioBtnModeDvs.Length; i++) { RadioBtnModeDvs[i].Tag = waveModeDvOf_radioBtnModeDvs[i]; if ((FemSolver.WaveModeDV)RadioBtnModeDvs[i].Tag == WaveModeDv) { RadioBtnModeDvs[i].Checked = true; } } // 導波路構造区分 WGStructureDVStruct[] wgStructureDvStructList = { new WGStructureDVStruct(FemSolver.WGStructureDV.HPlane2D, "H面導波管"), new WGStructureDVStruct(FemSolver.WGStructureDV.EPlane2D, "E面導波管"), new WGStructureDVStruct(FemSolver.WGStructureDV.ParaPlate2D, "平行平板導波路"), }; foreach (WGStructureDVStruct wgStructureDvStruct in wgStructureDvStructList) { cboxWGStructureDv.Items.Add(wgStructureDvStruct); if (wgStructureDvStruct.WGStructureDv == WGStructureDv) { cboxWGStructureDv.SelectedItem = wgStructureDvStruct; } } // 導波路幅(E面解析用) this.textBoxWaveguideWidthForEPlane.Text = string.Format("{0:F4}", waveguideWidthForEPlane); // 要素形状・次数 ElemShapeStruct[] esList = { new ElemShapeStruct(Constants.FemElementShapeDV.Triangle, Constants.SecondOrder, "2次三角形要素"), //new ElemShapeStruct(Constants.FemElementShapeDV.QuadType2, Constants.SecondOrder, "2次四角形要素"), //DelFEMでは四角形メッシュは非対応 new ElemShapeStruct(Constants.FemElementShapeDV.Triangle, Constants.FirstOrder, "1次三角形要素"), //new ElemShapeStruct(Constants.FemElementShapeDV.QuadType2, Constants.FirstOrder, "1次四角形要素"), //DelFEMでは四角形メッシュは非対応 }; foreach (ElemShapeStruct es in esList) { cboxElemShapeDv.Items.Add(es); if (es.ElemShapeDv == ElemShapeDv && es.Order == ElemOrder) { cboxElemShapeDv.SelectedItem = es; } } // 線形方程式解法 LinearSystemEqnSolverStruct[] lsList = { new LinearSystemEqnSolverStruct(FemSolver.LinearSystemEqnSoverDV.PCOCG, "PCOCG"), new LinearSystemEqnSolverStruct(FemSolver.LinearSystemEqnSoverDV.Zgbsv, "zgbsv(バンド行列)"), new LinearSystemEqnSolverStruct(FemSolver.LinearSystemEqnSoverDV.Zgesv, "zgesv(一般行列)"), }; foreach (LinearSystemEqnSolverStruct ls in lsList) { cboxLsEqnSolverDv.Items.Add(ls); if (ls.LsEqnSolverDv == LsEqnSolverDv) { cboxLsEqnSolverDv.SelectedItem = ls; } } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="normalizedFreq1">計算開始規格化周波数</param> /// <param name="normalizedFreq2">計算終了規格化周波数</param> /// <param name="calcFreqCnt">計算点数</param> /// <param name="elemShapeDv">要素形状区分</param> /// <param name="elemOrder">要素次数</param> /// <param name="lsEqnSolverDv">線形方程式解法区分</param> public CalcSettingFrm(double normalizedFreq1, double normalizedFreq2, int calcFreqCnt, Constants.FemElementShapeDV elemShapeDv, int elemOrder, FemSolver.LinearSystemEqnSoverDV lsEqnSolverDv) { InitializeComponent(); DialogResult = DialogResult.None; // フィールドに格納 NormalizedFreq1 = normalizedFreq1; NormalizedFreq2 = normalizedFreq2; CalcFreqCnt = calcFreqCnt; ElemShapeDv = elemShapeDv; ElemOrder = elemOrder; LsEqnSolverDv = lsEqnSolverDv; if (CalcFreqCnt == 0) { // 既定値を設定 NormalizedFreq1 = Constants.DefNormalizedFreqRange[0]; NormalizedFreq2 = Constants.DefNormalizedFreqRange[1]; CalcFreqCnt = Constants.DefCalcFreqencyPointCount; ElemShapeDv = Constants.DefElemShapeDv; ElemOrder = Constants.DefElementOrder; } // GUIにセット // 計算範囲 textBoxMinFreq.Text = string.Format("{0:F2}", NormalizedFreq1); textBoxMaxFreq.Text = string.Format("{0:F2}", NormalizedFreq2); double delta = (NormalizedFreq2 - NormalizedFreq1) / CalcFreqCnt; textBoxDeltaFreq.Text = string.Format("{0:F2}", delta); // 要素形状・次数 ElemShapeStruct[] esList = { new ElemShapeStruct(Constants.FemElementShapeDV.Triangle, Constants.SecondOrder, "2次三角形要素"), //new ElemShapeStruct(Constants.FemElementShapeDV.QuadType2, Constants.SecondOrder, "2次四角形要素"), //DelFEMでは四角形メッシュは非対応 new ElemShapeStruct(Constants.FemElementShapeDV.Triangle, Constants.FirstOrder, "1次三角形要素"), //new ElemShapeStruct(Constants.FemElementShapeDV.QuadType2, Constants.FirstOrder, "1次四角形要素"), //DelFEMでは四角形メッシュは非対応 }; foreach (ElemShapeStruct es in esList) { cboxElemShapeDv.Items.Add(es); if (es.ElemShapeDv == ElemShapeDv && es.Order == ElemOrder) { cboxElemShapeDv.SelectedItem = es; } } // 線形方程式解法 LinearSystemEqnSolverStruct[] lsList = { new LinearSystemEqnSolverStruct(FemSolver.LinearSystemEqnSoverDV.PCOCG, "PCOCG"), new LinearSystemEqnSolverStruct(FemSolver.LinearSystemEqnSoverDV.Zgbsv, "zgbsv(バンド行列)"), new LinearSystemEqnSolverStruct(FemSolver.LinearSystemEqnSoverDV.Zgesv, "zgesv(一般行列)"), }; foreach (LinearSystemEqnSolverStruct ls in lsList) { cboxLsEqnSolverDv.Items.Add(ls); if (ls.LsEqnSolverDv == LsEqnSolverDv) { cboxLsEqnSolverDv.SelectedItem = ls; } } }