Ejemplo n.º 1
0
        public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(double xi)
        {
            var buf = new _1DCrossSectionGeometricProperties();

            {
                var lastPoint = this._geometry[this._geometry.Length - 1];

                if (lastPoint != _geometry[0])
                {
                    throw new InvalidOperationException("First point and last point ot PolygonYz should put on each other");
                }



                double a = 0.0, iz = 0.0, iy = 0.0, ixy = 0.0;


                var x = new double[this._geometry.Length];
                var y = new double[this._geometry.Length];

                for (int i = 0; i < _geometry.Length; i++)
                {
                    x[i] = _geometry[i].Y;
                    y[i] = _geometry[i].Z;
                }

                var l = _geometry.Length - 1;

                var ai = 0.0;

                for (var i = 0; i < l; i++)
                {
                    ai  = x[i] * y[i + 1] - x[i + 1] * y[i];
                    a  += ai;
                    iy += (y[i] * y[i] + y[i] * y[i + 1] + y[i + 1] * y[i + 1]) * ai;
                    iz += (x[i] * x[i] + x[i] * x[i + 1] + x[i + 1] * x[i + 1]) * ai;

                    ixy += (x[i] * y[i + 1] + 2 * x[i] * y[i] + 2 * x[i + 1] * y[i + 1] + x[i + 1] * y[i]) * ai;
                }

                a   = a * 0.5;
                iz  = iz * 1 / 12.0;
                iy  = iy * 1 / 12.0;
                ixy = ixy * 1 / 24.0;
                var j = iy + iz;
                //not sure which one is correct j = ix + iy or j = ixy >:)~

                buf.A  = Math.Abs(a);
                buf.Iz = Math.Abs(iz);
                buf.Iy = Math.Abs(iy);
                buf.J  = Math.Abs(j);
                buf.Ay = Math.Abs(a); //TODO: Ay is not equal to A, this is temporary fix
                buf.Az = Math.Abs(a); //TODO: Az is not equal to A, this is temporary fix
            }

            return(buf);
        }
Ejemplo n.º 2
0
        public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(double xi)
        {
            var buf = new _1DCrossSectionGeometricProperties();

            buf.A  = this._a;
            buf.Ay = this._ay;
            buf.Az = this._az;
            buf.Iy = this._iy;
            buf.Iz = this._iz;

            return(buf);
        }
Ejemplo n.º 3
0
        public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(double xi)
        {
            var target = new _1DCrossSectionGeometricProperties();

            var s1 = sectionAtStart;
            var s2 = sectionAtStart;

            {
                var f1 = (1.0 - xi) / 2.0;
                var f2 = (1.0 + xi) / 2.0;

                var pt = new PointYZ();

                target.A  = s1.A * f1 + s2.A * f2;
                target.Ay = s1.Ay * f1 + s2.Ay * f2;
                target.Az = s1.Az * f1 + s2.Az * f2;
                target.J  = s1.J * f1 + s2.J * f2;
                target.Iy = s1.Iy * f1 + s2.Iy * f2;
                target.Iz = s1.Iz * f1 + s2.Iz * f2;
            }

            return(target);
        }
Ejemplo n.º 4
0
 public NonUniformParametric1DSection(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     sectionAtStart = (_1DCrossSectionGeometricProperties)info.GetValue("sectionAtStart", typeof(_1DCrossSectionGeometricProperties));
     sectionAtEnd   = (_1DCrossSectionGeometricProperties)info.GetValue("sectionAtEnd", typeof(_1DCrossSectionGeometricProperties));
 }