public void test_calculate_properties() { var sec = new UniformGeometric1DSection(); sec.Geometry = new PointYZ[] { new PointYZ(-1, -2), new PointYZ(-1, 2), new PointYZ(1, 2), new PointYZ(1, -2), new PointYZ(-1, -2) }; var t = sec.GetCrossSectionPropertiesAt(0); var b = 2.0; var h = 4.0; var iy = b * h * h * h / 12.0; var iz = h * b * b * b / 12.0; var qy = 0; var qz = 0; var a = b * h; var epsilon = 1e-6; Assert.IsTrue(Math.Abs(t.Iy - iy) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Iz - iz) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Qy - qy) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Qz - qz) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.A - a) < epsilon, "wrong value"); }
public static void Run1() { double h = 5; Node n1 = new Node(0, 0, 0); Node n2 = new Node(h, 0, 0); n1.Constraints = Constraints.Fixed; var section = new UniformGeometric1DSection(SectionGenerator.GetRectangularSection(1, 0.5)); var material = UniformIsotropicMaterial.CreateFromYoungShear(205e9, 81e9); BarElement e = new BarElement(n1, n2) { Section = section, Material = material }; e.Behavior = BarElementBehaviours.FullFrame; var lc1 = new LoadCase("C1", LoadType.Dead); var lc2 = new LoadCase("C2", LoadType.Live); var lc3 = new LoadCase("C3", LoadType.Live); var load = new UniformLoad() { Direction = Vector.FromXYZ(0, 0, -1), CoordinationSystem = CoordinationSystem.Global, Magnitude = 1, Case = lc1 }; var load2 = new UniformLoad() { Direction = Vector.FromXYZ(1, 0, 0), CoordinationSystem = CoordinationSystem.Global, Magnitude = 10, Case = lc2 }; var load3 = new ConcentratedLoad(new Force(0, 0, 0, 00, 10, 00), new IsoPoint(0.50), CoordinationSystem.Local); load3.Case = lc3; e.Loads.Add(load); e.Loads.Add(load2); e.Loads.Add(load3); Model model = new Model(); model.Nodes.Add(n1); model.Nodes.Add(n2); model.Elements.Add(e); model.Solve_MPC(); BarInternalForceVisualizer.VisualizeInNewWindow(e); }
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); }
public static void Run1() { var l = 10; var model = new Model(); model.Nodes.Add(new Node(0, 0, 0) { Label = "n0" }); model.Nodes.Add(new Node(l, 0, 0) { Label = "n1" }); //Fixed nodes model.Nodes["n0"].Constraints = Constraints.Fixed; model.Nodes["n1"].Constraints = Constraints.Fixed; var bar = new BarElement(model.Nodes["n0"], model.Nodes["n1"]) { Label = "e0" }; //Pinned bar releases bar.StartReleaseCondition = Constraints.MovementFixed; bar.EndReleaseCondition = Constraints.MovementFixed & Constraints.FixedRX; model.Elements.Add(bar); var sec = new UniformGeometric1DSection(SectionGenerator.GetISetion(0.24, 0.67, 0.01, 0.006)); var mat = UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3); (model.Elements["e0"] as BarElement).Material = mat; (model.Elements["e0"] as BarElement).Section = sec; var u1 = new UniformLoad(LoadCase.DefaultLoadCase, -Vector.K, 1, CoordinationSystem.Global); model.Elements["e0"].Loads.Add(u1); model.Solve_MPC(); var n0Force = model.Nodes["n0"].GetSupportReaction(); var n1Force = model.Nodes["n1"].GetSupportReaction(); Console.WriteLine("support reaction of n0: {0}, n1: {1}", n0Force, n1Force); var elm = model.Elements[0] as BarElement; BarInternalForceVisualizer.VisualizeInNewWindow(elm); }
public void test_reset_centroid() { var sec = new UniformGeometric1DSection(); sec.Geometry = new PointYZ[] { new PointYZ(-1, -2), new PointYZ(-1.23, 2.54), new PointYZ(1.75, 2.36), new PointYZ(1.2, -2.1), new PointYZ(-1, -2) }; var dy = 2.849;//random values var dz = 1.118; var sec2 = new UniformGeometric1DSection((PointYZ[])sec.Geometry.Clone()); //move section by random values dy dz //is ResetCentroid=true then values are regard centroid and should not change for (var i = 0; i < sec2.Geometry.Length; i++) { sec2.Geometry[i].Y += dy; sec2.Geometry[i].Z += dz; } sec2.ResetCentroid = true; sec.ResetCentroid = true; var t = sec.GetCrossSectionPropertiesAt(0); var t2 = sec2.GetCrossSectionPropertiesAt(0); var epsilon = 1e-6; Assert.IsTrue(Math.Abs(t.Iy - t2.Iy) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Iz - t2.Iz) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Qy - t2.Qy) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Qz - t2.Qz) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.A - t2.A) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Ay - t2.Ay) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Az - t2.Az) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.J - t2.J) < epsilon, "wrong value"); Assert.IsTrue(Math.Abs(t.Iyz - t2.Iyz) < epsilon, "wrong value"); }