void Bounaries_activate_sparse() { int index; foreach (var boundary in fe.elems_which_bounders) { al[boundary.fe_number].Clear(); for (int i = 0; i < au.Count(); i++) { index = au[i].FindIndex(x => x.position == boundary.fe_number); if (index != -1) { if (i == au[i][index].position) { au[i][index].value = 1; } else { au[i].RemoveAt(index); } } } int x_index = Reverse_global_number_to_x_index(boundary.fe_number); int y_index = Reverse_global_number_to_y_index(boundary.fe_number); int z_index = Reverse_global_number_to_z_index(boundary.fe_number); F_sparse[boundary.fe_number] = InsertedInfo.U_analit(gg.OS_X[x_index], gg.OS_Y[y_index], gg.OS_Z[z_index]); } }
public New_FEM() { InsertedInfo II = new InsertedInfo(); //for (int i = 0; i < DSS.Answer.Count() && i < 6; i++) Console.WriteLine($"F[{i}] = {DSS.Answer[i]}"); //Console.WriteLine("----------"); //for (int i = 0; i < SSS.Answer.Count() && i < 6; i++) Console.WriteLine($"F[{i}] = {SSS.Answer[i]}"); if (!InsertedInfo.Test_another_matrix) { if (InsertedInfo.Dense) { TBF_dense = new Trilinear_Basis_Functions(ref GM, new List <double>(DSS.Answer), II.Points, "dd84ai_DSS_precise_points.txt"); } if (InsertedInfo.Sparse && InsertedInfo.Sparse_Straight) { TBF_sparse_straight = new Trilinear_Basis_Functions(ref GM, new List <double>(SSS.Answer), II.Points, "dd84ai_SSS_precise_points.txt"); //if (InsertedInfo.Visualisation) TBF_sparse_straight.Visialize(SSS.Answer); } if (InsertedInfo.Sparse && InsertedInfo.Sparse_MSG) { TBF_sparse_MSG = new Trilinear_Basis_Functions(ref GM, new List <double>(SMS.Answer), II.Points, "dd84ai_SMS_precise_points.txt"); //if (InsertedInfo.Visualisation) TBF_sparse_MSG.Visialize(SSS.Answer); } List <double> analitical_answer = new List <double>(); foreach (var point in II.Points) { analitical_answer.Add(InsertedInfo.U_analit(point.x, point.y, point.z)); } Shared_Field.Save_vector(analitical_answer, "dd84ai_AAA.txt"); } Console.Write(""); }
void Bounaries_activate_dense() { foreach (var boundary in fe.elems_which_bounders) { for (int i = 0; i < A_dense[boundary.fe_number].Count(); i++) { if (i == boundary.fe_number) { A_dense[boundary.fe_number][i] = 1; } else { A_dense[boundary.fe_number][i] = 0; } } int x_index = Reverse_global_number_to_x_index(boundary.fe_number); int y_index = Reverse_global_number_to_y_index(boundary.fe_number); int z_index = Reverse_global_number_to_z_index(boundary.fe_number); F_dense[boundary.fe_number] = InsertedInfo.U_analit(gg.OS_X[x_index], gg.OS_Y[y_index], gg.OS_Z[z_index]); } }