public static void SimplySupportedBeamUDL()
        {
            var model = new BriefFiniteElementNet.Model();

            var pin = new Constraint(
                dx: DofConstraint.Fixed, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed,
                rx: DofConstraint.Fixed, ry: DofConstraint.Released, rz: DofConstraint.Released);

            Node n1, n2;

            model.Nodes.Add(n1 = new Node(x: 0.0, y: 0.0, z: 0.0)
            {
                Constraints = pin
            });
            model.Nodes.Add(n2 = new Node(x: 10.0, y: 0.0, z: 0.0)
            {
                Constraints = pin
            });

            var elm1 = new BarElement(n1, n2);

            model.Elements.Add(elm1);

            double       height   = 0.200;
            double       width    = 0.050;
            double       E        = 7900;
            var          section  = new UniformGeometric1DSection(SectionGenerator.GetRectangularSection(height, width));
            BaseMaterial material = UniformIsotropicMaterial.CreateFromYoungPoisson(E, 1);

            elm1.Section  = section;
            elm1.Material = material;

            var u1 = new Loads.UniformLoad(LoadCase.DefaultLoadCase, new Vector(0, 1, 1), -1, CoordinationSystem.Global);

            elm1.Loads.Add(u1);

            model.Solve_MPC();

            double x;
            Force  reaction1 = n1.GetSupportReaction();

            x = reaction1.Fz;                                             //15000 = 3*10000/2 -> correct
            x = reaction1.My;                                             // 0 -> correct

            Force f1_internal = elm1.GetExactInternalForceAt(-1 + 1e-10); //-1 is start

            x = f1_internal.Fz;
            x = f1_internal.My;

            var delta = elm1.GetInternalDisplacementAt(0);
        }
Example #2
0
        public static void testInternalForce_Console()
        {
            var model = new Model();
            var ndes  = new Node[] { new Node(0, 0, 0), new Node(3, 0, 0) };

            var h = UnitConverter.In2M(4);
            var w = UnitConverter.In2M(4);

            var e = UnitConverter.Psi2Pas(20e4);

            var a  = h * w;
            var iy = h * h * h * w / 12;
            var iz = w * w * w * h / 12;
            var j  = iy + iz;

            var sec = new Sections.UniformParametric1DSection(a = 1, iy = 1, iz = 1, j = 1);
            var mat = UniformIsotropicMaterial.CreateFromYoungPoisson(e = 1, 0.25);

            var elm = new BarElement(ndes[0], ndes[1])
            {
                Material = mat, Section = sec, Behavior = BarElementBehaviours.FullFrame
            };

            //var elm2 = new BarElement(ndes[1], ndes[2]) { Material = mat, Section = sec, Behavior = BarElementBehaviours.FullFrame };

            model.Elements.Add(elm);
            model.Nodes.Add(ndes);

            ndes[0].Constraints = Constraints.Fixed;

            ndes[1].Loads.Add(new NodalLoad(new Force(1, 0, 1, 0, 0, 0)));

            model.Solve_MPC();

            var tr = elm.GetTransformationManager();

            var d1 = tr.TransformLocalToGlobal(elm.GetInternalDisplacementAt(1 - 1e-10, LoadCase.DefaultLoadCase));
            var d2 = ndes[1].GetNodalDisplacement(LoadCase.DefaultLoadCase);


            var frc = elm.GetInternalForceAt(-1, LoadCase.DefaultLoadCase);

            var gfrc = elm.GetTransformationManager().TransformLocalToGlobal(frc);

            var f0 = ndes[0].GetSupportReaction();
        }
Example #3
0
        public static void TestEndreleaseInternalForce()
        {
            /**/
            var m1 = new Model();



            var I = (0.1 * 0.1 * 0.1 * 0.1) / 12;
            var A = (0.1 * 0.1 * 0.1);
            var E = 210e9;

            var sec = new Sections.UniformParametric1DSection(A, I, I, I);
            var mat = new Materials.UniformIsotropicMaterial(E, 0.3);
            var p   = 1e3;

            /**/
            //var p0 = new Point(0, 0, 0);
            //var p1 = new Point(3, 4, 5);

            var l = 4.0;

            {//model 1
                var el1 = new BarElement(3);

                el1.Nodes[0] = new Node(0, 0, 0)
                {
                    Constraints = Constraints.Fixed & Constraints.FixedRX, Label = "n0"
                };;
                el1.Nodes[1] = new Node(l, 0, 0)
                {
                    Label = "n1"
                };
                el1.Nodes[2] = new Node(2 * l, 0, 0)
                {
                    Constraints = Constraints.Released, Label = "n2"
                };

                el1.Section  = sec;
                el1.Material = mat;

                m1.Nodes.Add(el1.Nodes);
                m1.Elements.Add(el1);
                m1.Nodes[1].Loads.Add(new NodalLoad(new Force(0, 0, p, 0, 0, 0)));

                var ep = 1e-10;

                m1.Solve_MPC();

                var frc = el1.GetInternalForceAt(1 - ep);

                var fnc = new Func <double, double>(i => el1.GetInternalDisplacementAt(i).DZ);

                Controls.FunctionVisualizer.VisualizeInNewWindow(fnc, -1 + ep, 1 - ep);

                var s2 = m1.Nodes["n2"].GetSupportReaction();
                var s0 = m1.Nodes["n0"].GetSupportReaction();

                var k = (el1 as BarElement).GetLocalStifnessMatrix();
            }



            //m1.Solve_MPC();
            // m2.Solve_MPC();

            // var d1 = m1.Nodes.Last().GetNodalDisplacement();
            // var d2 = m2.Nodes.Last().GetNodalDisplacement();
        }