Esempio n. 1
0
        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("");
        }
Esempio n. 2
0
        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]);
            }
        }
Esempio n. 3
0
 public void I_desire_to_recieve_fi(int i, int j, int k)
 {
     fi[0] = InsertedInfo.f(X[i], Y[j], Z[k]);
     fi[1] = InsertedInfo.f(X[i + 1], Y[j], Z[k]);
     fi[2] = InsertedInfo.f(X[i], Y[j], Z[k + 1]);
     fi[3] = InsertedInfo.f(X[i + 1], Y[j], Z[k + 1]);
     fi[4] = InsertedInfo.f(X[i], Y[j + 1], Z[k]);
     fi[5] = InsertedInfo.f(X[i + 1], Y[j + 1], Z[k]);
     fi[6] = InsertedInfo.f(X[i], Y[j + 1], Z[k + 1]);
     fi[7] = InsertedInfo.f(X[i + 1], Y[j + 1], Z[k + 1]);
 }
Esempio n. 4
0
        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]);
            }
        }