Пример #1
0
        /// <summary>
        /// Converts one area load applied on a BarElement with a series of equivalent ConcentratedLoads
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="load">The load.</param>
        /// <param name="cse">The cse.</param>
        public static void AreaLoad2ConcentratedLoads(BarElement element, PartialNonUniformLoad load, LoadCase cse)
        {
            var n = 1000;

            var d = element.EndNode.Location - element.StartNode.Location;

            var l = d.Length;

            for (var i = 0; i < n; i++)
            {
                var dx = l / n;

                var x = i * dx + 0.5 * dx;

                var cn = new ConcentratedLoad();

                var xi = (2 * x - l) / l;

                cn.ForceIsoLocation = new IsoPoint(xi, 0, 0);

                var mag = load.GetMagnitudeAt(element, cn.ForceIsoLocation);

                var f = load.Direction * mag * dx;

                cn.Force = new Force(f, Vector.Zero);
                cn.Case  = cse;

                cn.CoordinationSystem = load.CoordinationSystem;

                if (mag != 0.0)
                {
                    element.Loads.Add(cn);
                }
            }
        }
Пример #2
0
        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);
        }