public void CompundSec_Test()
        {
            SectionDefinition sec = new SectionDefinition(nameof(CompundSec_Test));

            sec.SolutionSettings = new SolutionSettings(0.01);

            (List <Point2D> outer, List <Point2D> inner) = helper.CreateRhsShape(150, 100, 6, 15, 8);
            sec.Contours.Add(new SectionContour(outer, false, defaultMat));
            sec.Contours.Add(new SectionContour(inner, true, defaultMat));

            List <Point2D> points = new List <Point2D>();

            points.Add(new Point2D(0, 0));
            points.Add(new Point2D(50, 0));
            points.Add(new Point2D(25, 50));
            var triangle = new SectionContour(points, false, defaultMat);

            triangle.ShiftPoints(25, 150);
            sec.Contours.Add(triangle);

            var angle = new SectionContour(helper.CreateAngleShape(100, 100, 6, 8, 5, 8), false, defaultMat);

            angle.ShiftPoints(100, 25);
            sec.Contours.Add(angle);

            _solver.Solve(sec);
            Compare(nameof(CompundSec_Test), sec);
        }
        public void CustomSec3_Test()
        {
            SectionDefinition sec = new SectionDefinition(nameof(CustomSec3_Test));

            sec.SolutionSettings = new SolutionSettings(0.002);

            sec.Contours.Add(new SectionContour(helper.CreateRectangle(300, 180), false, defaultMat));

            var c1 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c1.ShiftPoints(30, 30);
            var c2 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c2.ShiftPoints(150, 30);
            var c3 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c3.ShiftPoints(150, 270);
            var c4 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c4.ShiftPoints(30, 270);

            sec.Contours.Add(c1);
            sec.Contours.Add(c2);
            sec.Contours.Add(c3);
            sec.Contours.Add(c4);

            _solver.Solve(sec);
            Compare(nameof(CustomSec3_Test), sec);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starting...");


            Stopwatch sw = new Stopwatch();

            sw.Start();

            Solver _solver = new Solver();
            ShapeGeneratorHelper helper = new ShapeGeneratorHelper();

            SectionMaterial defaultMat = new SectionMaterial("dummy", 1, 1.0, 0.0, 1.0);

            SectionDefinition sec = new SectionDefinition();

            sec.SolutionSettings = new SolutionSettings(0.002);

            sec.Contours.Add(new SectionContour(helper.CreateRectangle(300, 180), false, defaultMat));

            var c1 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c1.ShiftPoints(30, 30);
            var c2 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c2.ShiftPoints(150, 30);
            var c3 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c3.ShiftPoints(150, 270);
            var c4 = new SectionContour(helper.CreateCircle(15, 50), true, defaultMat);

            c4.ShiftPoints(30, 270);

            sec.Contours.Add(c1);
            sec.Contours.Add(c2);
            sec.Contours.Add(c3);
            sec.Contours.Add(c4);

            _solver.Solve(sec);

            Console.WriteLine(sec.Output.SectionProperties.j.ToString());

            sw.Stop();

            Console.WriteLine("Elapsed={0}", sw.Elapsed);

            Console.ReadLine();
        }
        public void CompositeSec_Test()
        {
            //Note that because of using more than one material, some output need to be mapped to eq. material (e.g. Sx output represents Mpx and Sx= Mpx/fy)

            SectionMaterial steel  = new SectionMaterial("Steel", 1, 200e3, 0.3, 500);
            var             timber = new SectionMaterial("Timber", 2, 8e3, 0.35, 20);

            SectionDefinition sec = new SectionDefinition(nameof(CompositeSec_Test));

            sec.SolutionSettings = new SolutionSettings(0.01);
            sec.Contours.Add(new SectionContour(helper.CreateIShape(304, 165, 10.2, 6.1, 11.4, 8), false, steel));
            var panel = new SectionContour(helper.CreateRectangle(50, 600), false, timber);

            panel.ShiftPoints(-217.5, 304);
            sec.Contours.Add(panel);

            _solver.Solve(sec);
            Compare(nameof(CompositeSec_Test), sec);
        }