예제 #1
0
        /// <summary>
        /// Calculates the geometric properties for the current finite element.
        /// </summary>
        /// <param name="coords"></param>
        /// <returns>Tuple containing the geometric properties and the elastic
        /// and shear moduli of the element: *(area, qx, qy, ixx, iyy, ixy, e, g)</returns>
        public (double area, double qx, double qy, double ixx, double iyy, double ixy) geometric_properties(double[,] coords)
        {
            // initialise geometric properties
            var area = 0.0;
            var qx   = 0.0;
            var qy   = 0.0;
            var ixx  = 0.0;
            var iyy  = 0.0;
            var ixy  = 0.0;

            //Gauss points for 6 point Gaussian integration
            var gps = ShapeFunctionHelper.gauss_points(6);

            double[,] B;
            double[] N;
            double   j;

            for (int i = 0; i < gps.RowCount(); i++)
            {
                var gp = gps.Row(i);

                ShapeFunctionHelper.shape_function(coords, gp, out N, out B, out j);
                area += gp[0] * j;

                var x = N.Dot(coords.Row(1));
                var y = N.Dot(coords.Row(0));
                qx  += gp[0] * x * j;
                qy  += gp[0] * y * j;
                ixx += gp[0] * x * x * j;
                iyy += gp[0] * y * y * j;
                ixy += gp[0] * x * y * j;
            }

            return(area, qx, qy, ixx, iyy, ixy);
        }
예제 #2
0
        /// <summary>
        /// Calculates total force resisted by the element when subjected to a
        /// stress equal to the yield strength. Also returns the modulus weighted
        /// area and first moments of area, and determines whether or not the
        /// element is above or below the line defined by the unit vector *u* and
        /// point* p*.
        /// </summary>
        /// <param name="mat"></param>
        /// <param name="coords"></param>
        /// <param name="u">Unit vector in the direction of the line</param>
        /// <param name="p">Point on the line</param>
        /// <returns></returns>
        public (double f_el, double ea_el, double qx_el, double qy_el, bool is_above) plastic_properties(SectionMaterial mat,
                                                                                                         double[,] coords, double[] u, double[] p)
        {
            //# initialise geometric properties
            var e     = mat.elastic_modulus;
            var area  = 0.0;
            var qx    = 0.0;
            var qy    = 0.0;
            var force = 0.0;

            var gps = ShapeFunctionHelper.gauss_points(3);

            double[] N;
            double   j;

            double[,] B;
            for (int i = 0; i < gps.RowCount(); i++)
            {
                var gp = gps.Row(i);

                ShapeFunctionHelper.shape_function(coords, gp, out N, out B, out j);
                area += gp[0] * j;

                var x = N.Dot(coords.Row(1));
                var y = N.Dot(coords.Row(0));
                qx    += gp[0] * x * j;
                qy    += gp[0] * y * j;
                force += gp[0] * j * mat.yield_strength;
            }

            //# calculate element centroid
            var cx = qy / area;
            var cy = qx / area;

            //# determine if the element is above the line p + u
            bool is_above = point_above_line(u, p[0], p[1], cx, cy);

            return(force, area *e, qx *e, qy *e, is_above);
        }