static void TestIssue22() { var model = new BriefFiniteElementNet.Model(); var n1 = new Node(-1, 0, 0) { Label = "n1", Constraints = BriefFiniteElementNet.Constraints.MovementFixed & BriefFiniteElementNet.Constraints.FixedRX }; var n2 = new Node(1, 0, 0) { Label = "n2", Constraints = BriefFiniteElementNet.Constraints.MovementFixed }; var loadPositionX = 0.5; var e1 = new BarElement(n1, n2) { Label = "e1" }; e1.Section = new BriefFiniteElementNet.Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.1d, 0.2d)); e1.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3); model.Nodes.Add(n1, n2); model.Elements.Add(e1); var force = new Force(0, 1, 1, 0, 0, 0); var elementLoad = new BriefFiniteElementNet.Loads.ConcentratedLoad { CoordinationSystem = CoordinationSystem.Global, Force = force, ForceIsoLocation = new IsoPoint(loadPositionX) }; e1.Loads.Add(elementLoad); model.Solve(); var eqv = e1.GetGlobalEquivalentNodalLoads(elementLoad); var data = e1.GetExactInternalForceAt(-0.99999999999); //e1.GetInternalForceAt(-0.99999999999); var func = new Func <double, double>(xi => e1.GetExactInternalForceAt(xi).My); FunctionVisualizer.VisualizeInNewWindow(func, -1 + 1e-10, 1 - 1e-10, 100); }
public static void SingleSpanBeamWithOverhang() { var model = new BriefFiniteElementNet.Model(); var pin = new Constraint(dx: DofConstraint.Fixed, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed, rx: DofConstraint.Fixed, ry: DofConstraint.Fixed, 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); elm1.Section = new BriefFiniteElementNet.Sections.UniformParametric1DSection(a: 0.01, iy: 8.3e-6, iz: 8.3e-6, j: 16.6e-6); //section's second area moments Iy and Iz = 8.3*10^-6, area = 0.01 elm1.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3); //Elastic mudule is 210e9 and poisson ratio is 0.3 var frc = new Force(); frc.Fz = 1000;// 1kN force in Z direction var elementLoad = new BriefFiniteElementNet.Loads.ConcentratedLoad(); elementLoad.CoordinationSystem = CoordinationSystem.Local; elementLoad.Force = frc; elementLoad.ForceIsoLocation = new IsoPoint(0); //frc, 5, CoordinationSystem.Local); elm1.Loads.Add(elementLoad); //is this possible? model.Solve_MPC(); //crashes here var val = elm1.GetExactInternalForceAt(-0.25); var d2 = n2.GetNodalDisplacement(); }