Example #1
0
        public static void TestPixels(int x = 7, int y = 5)
        {
            Model model2d = new Cantilever2D(ElementType.PixelElement, x + 1, y + 1).Model;
            var   _Filter = new ALFE.TopOpt.Filter(model2d.Elements, 2.0, 2);

            _Filter.PreFlt();

            FESystem sys = new FESystem(model2d);

            sys.Solve();
            FEPrint.PrintSystemInfo(sys);

            ////FEPrint.PrintDisplacement(sys);
            ////var disp = sys.GetDisplacement();
            ////FEPrint.PrintCSR(KG);
            ////FEIO.WriteCOOMatrix(KG.ToCOO(), "C:/Users/alber/Desktop/matA.mtx");
            Console.WriteLine("------------------- Result Info -------------------");
            Console.WriteLine("Displacement[2].Y = " + sys.GetDisplacement()[2, 1].ToString());
            //FEPrint.PrintDisplacement(sys);
        }
Example #2
0
        public void Initialize()
        {
            // Write basic info
            solvingInfo = PreprocessingInfo();

            foreach (var elem in Model.Elements)
            {
                elem.Xe = 1.0;
            }

            // Filtering
            Stopwatch sw = new Stopwatch();

            sw.Start();
            _Filter = new Filter(Model.Elements, FilterRadius, Dim);
            _Filter.PreFlt();
            sw.Stop();

            solvingInfo += "Prefiltering: " + sw.Elapsed.TotalMilliseconds.ToString() + " ms";
            solvingInfo += '\n';

            FEIO.WriteInvalidElements(0, Path, Model.Elements);
        }