Ejemplo n.º 1
0
        public Dense_Straight_Solver(ref GlobalMatrix _GM)
        {
            F_list = new List <double>(new double[Size]);
            if (InsertedInfo.Dense)
            {
                Console.WriteLine(this.ToString() + " initiated");

                GM = _GM;
                gg = GM.gg;
                fe = GM.fe;
                lm = GM.lm;

                if (InsertedInfo.Test_another_matrix)
                {
                    Size    = GM.Test_Size;
                    A       = Shared_Field.CopyMatrixFrom(GM.Test_dense);
                    F_local = Shared_Field.CopyVectorFrom(GM.F_test);
                }
                else
                {
                    Size    = fe.Size;
                    A       = Shared_Field.CopyMatrixFrom(GM.A_dense);
                    F_local = Shared_Field.CopyVectorFrom(GM.F_dense);
                }

                Solve();

                Shared_Field.Save_vector(Answer, "dd84ai_RGR_output_X0_dense_Straight_LU.txt");
                Shared_Field.Show_three_elements_from_vector(Answer);
            }
        }
Ejemplo n.º 2
0
        public Sparse_MSG_Solver(ref GlobalMatrix _GM)
        {
            F_list = new List <double>(new double[Size]);
            if (InsertedInfo.Sparse && InsertedInfo.Sparse_MSG)
            {
                Console.WriteLine(this.ToString() + " initiated");

                GM = _GM;
                gg = GM.gg;
                fe = GM.fe;
                lm = GM.lm;

                if (!InsertedInfo.Test_another_matrix)
                {
                    Size     = fe.Size;
                    al       = Shared_Field.CopyListCC(GM.al);
                    au       = Shared_Field.CopyListCC(GM.au);
                    F_sparse = Shared_Field.CopyVectorFromToDouble(GM.F_sparse);
                }
                else
                {
                    Size     = GM.Test_Size;
                    al       = Shared_Field.CopyListCC(GM.Test_al);
                    au       = Shared_Field.CopyListCC(GM.Test_au);
                    F_sparse = Shared_Field.CopyVectorFromToDouble(GM.F_test);
                }

                Solve();

                Shared_Field.Save_vector(Answer, "dd84ai_RGR_output_X0_sparse_MSG.txt");
                Shared_Field.Show_three_elements_from_vector(Answer);
            }
        }
Ejemplo n.º 3
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("");
        }
Ejemplo n.º 4
0
        public void Save_and_Show(List <InsertedInfo.Point3D> Points, string name)
        {
            List <double> Answer = new List <double>();

            foreach (var point in Points)
            {
                Answer.Add(Calculate(point));
            }
            Console.WriteLine(name);
            foreach (var value in Answer)
            {
                Console.WriteLine($"Precise value = {value}");
            }
            Shared_Field.Save_vector(Answer, name);
        }