Esempio n. 1
0
            //Output geometry and force in cable. Force in [kN] and stress in [MPa]
            public override object Output(List <KangarooSolver.Particle> p)
            {
                double force = Weighting[0] * Move[0].Length;

                //Create bar data object to store output information
                DataTypes.BarData barData = new DataTypes.BarData(new Line(p[PIndex[0]].Position, p[PIndex[1]].Position), force / 1000.0, force / area);

                return(barData);
            }
Esempio n. 2
0
            //Output geometry and force in bar. Force in [kN] and stress in [MPa]
            public override object Output(List <KangarooSolver.Particle> p)
            {
                double factor = 1.0;

                if (isCompressionMember)
                {
                    factor = -1.0;
                }

                double force = factor * Weighting[0] * Move[0].Length;          //Units: [N]

                //Create bar data object to store output information
                DataTypes.BarData barData = new DataTypes.BarData(PIndex[0], PIndex[1], new Line(p[PIndex[0]].Position, p[PIndex[1]].Position), force / 1000.0, force / area);
                return(barData);
            }
Esempio n. 3
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //Input
            DataTypes.BarData barData = new DataTypes.BarData();
            DA.GetData(0, ref barData);

            //Extract properties
            Line   ln     = barData.BarLine;
            double force  = barData.Force;
            double stress = barData.Stress;

            //Output
            DA.SetData(0, ln);
            DA.SetData(1, Math.Round(force, 6));
            DA.SetData(2, Math.Round(stress, 3));
        }
Esempio n. 4
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //Input
            DataTypes.BarData barData = new DataTypes.BarData();
            DA.GetData(0, ref barData);

            //Extract properties
            int pIndexStart = barData.Index1;
            int pIndexEnd   = barData.Index2;

            Line ln = barData.BarLine;

            double force  = barData.Force;
            double stress = barData.Stress;

            //Output
            DA.SetData(0, pIndexStart);
            DA.SetData(1, pIndexEnd);
            DA.SetData(2, ln);
            DA.SetData(3, Math.Round(force, 6));
            DA.SetData(4, Math.Round(stress, 3));
        }