private void button1_Click(object sender, EventArgs e) { CFEM_CALC obj_Calc = new CFEM_CALC(); // MessageBox.Show("Calculation was successful!", "Solver Message" /*, MessageBoxButtons.OK, MessageBoxIcon.Exclamation*/); // Auxialiary string - result data int iDispDecPrecision = 3; // Precision of numerical values of displacement and rotations string sDOFResults = null; for (int i = 0; i < obj_Calc.m_V_Displ.FVectorItems.Length; i++) { int iNodeNumber = obj_Calc.m_fDisp_Vector_CN[i, 1]+1; // Incerase index (1st member "0" to "1" int iNodeDOFNumber = obj_Calc.m_fDisp_Vector_CN[i, 2]+1; sDOFResults += "Node No:" + "\t" + iNodeNumber + "\t" + "Node DOF No:" + "\t" + iNodeDOFNumber + "\t" + "Value:" + "\t" + String.Format("{0:0.000}" ,Math.Round(obj_Calc.m_V_Displ.FVectorItems[i], iDispDecPrecision)) + "\n"; } // Main String string sMessageCalc= "Calculation was successful!" +"\n\n"+ "Result - vector of calculated values of unrestraint DOF displacement or rotation" + "\n\n" + sDOFResults; // Display Message MessageBox.Show(sMessageCalc, "Solver Message", MessageBoxButtons.OK); }
private void menuItemExample3D_50_Click(object sender, RoutedEventArgs e) { model = new sw_en_GUI.EXAMPLES._3D.CExample_3D_50(); Window2 win = new Window2(model, m_bDebugging); list_trackports.Add(win._trackport); Container.Children.Add(new MdiChild { Content = (UIElement)win.Content, Title = "Example 3D 50" + " - Window " + (Container.Children.Count + 1) }); FEM_CALC_1Din3D.CFEM_CALC obj_Calc = new FEM_CALC_1Din3D.CFEM_CALC(model, m_bDebugging); // Nove vypoctove jadro win.Close(); }
// Calculation private void menuItemCalculate_Click(object sender, RoutedEventArgs e) { /* // Create calculation object and run calculation FEM_CALC_BASE.CFEM_CALC obj_Calc = new FEM_CALC_BASE.CFEM_CALC(); // Nove vypoctove jadro if (model.m_eSLN == ESLN.e2DD_1D) { FEM_CALC_1Din2D.CFEM_CALC obj_Calc_2D = new FEM_CALC_1Din2D.CFEM_CALC(model, m_bDebugging); obj_Calc = (FEM_CALC_BASE.CFEM_CALC)(obj_Calc_2D); // Change to basic type } else if (model.m_eSLN == ESLN.e3DD_1D) { FEM_CALC_1Din3D.CFEM_CALC obj_Calc_3D = new FEM_CALC_1Din3D.CFEM_CALC(model, m_bDebugging); obj_Calc = (FEM_CALC_BASE.CFEM_CALC)(obj_Calc_3D); // Change to basic type } else { // Not implemented } */ FEM_CALC_1Din3D.CFEM_CALC obj_Calc = new FEM_CALC_1Din3D.CFEM_CALC(); // Povodny priklad - zadanie c 4 // Auxialiary string - result data int iDispDecPrecision = 3; // Precision of numerical values of displacement and rotations string sDOFResults = null; for (int i = 0; i < obj_Calc.m_V_Displ.FVectorItems.Length; i++) { int iNodeNumber = obj_Calc.m_fDisp_Vector_CN[i, 1] + 1; // Incerase index (1st member "0" to "1" int iNodeDOFNumber = obj_Calc.m_fDisp_Vector_CN[i, 2] + 1; sDOFResults += "Node No:" + "\t" + iNodeNumber + "\t" + "Node DOF No:" + "\t" + iNodeDOFNumber + "\t" + "Value:" + "\t" + String.Format("{0:0.000}", Math.Round(obj_Calc.m_V_Displ.FVectorItems[i], iDispDecPrecision)) + "\n"; } // Main String string sMessageCalc = "Calculation was successful!" + "\n\n" + "Result - vector of calculated values of unrestraint DOF displacement or rotation" + "\n\n" + sDOFResults; // Display Message MessageBox.Show(sMessageCalc, "Solver Message", MessageBoxButton.OK); }