Пример #1
0
        /// <summary>
        /// Transforms the defined stress tensor from global system to local system.
        /// </summary>
        /// <param name="tensor">The tensor.</param>
        /// <returns>tensor in local coordination system</returns>
        public GeneralStressTensor TransformGlobalToLocal(GeneralStressTensor tensor)
        {
            var buf = new GeneralStressTensor(
                TransformGlobalToLocal(tensor.MembraneTensor),
                TransformGlobalToLocal(tensor.BendingTensor));

            return(buf);
        }
        /// <summary>
        /// Gets the internal stress at defined <see cref="isoLocation"/>.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="loadCase">the load case </param>
        /// <param name="isoLocation"></param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// for more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public CauchyStressTensor GetLocalInternalStress(LoadCase loadCase, double[] isoLocation)
        {
            var helpers = GetHelpers();

            var gst = new GeneralStressTensor();
            var tr  = this.GetTransformationManager();

            var ld = this.Nodes.Select(i => tr.TransformGlobalToLocal(i.GetNodalDisplacement(loadCase))).ToArray();

            for (var i = 0; i < helpers.Count(); i++)
            {
                var st = helpers[i].GetLocalInternalStressAt(this, ld, isoLocation);
                gst += st;
            }

            var buf = new CauchyStressTensor();

            buf += gst.MembraneTensor;

            {
                //step2: update Cauchy based on bending,
                //bending tensor also affects the Cauchy tensor regarding how much distance between desired location and center of plate.

                //old code: buf.UpdateTotalStress(_section.GetThicknessAt(new double[] { localX, localY }) * localZ, probeLocation);

                var lambda = 0.0;

                if (isoLocation.Length == 3)
                {
                    lambda = isoLocation[2];
                }
                if (lambda > 1.0 || lambda < -1.0)
                {
                    throw new Exception("lambda must be between -1 and +1")
                          {
                          };
                }
                var thickness = Section.GetThicknessAt(isoLocation);

                var z = thickness * lambda;//distance from plate center, measure in [m]
                if (lambda > 0)
                {
                    //top -> add bending stress
                    buf += gst.BendingTensor.ConvertBendingStressToCauchyTensor(z);
                }
                else
                {
                    //bottom -> subtract bending stress
                    buf -= gst.BendingTensor.ConvertBendingStressToCauchyTensor(z);
                }
            }
            return(buf);
        }
Пример #3
0
        public GeneralStressTensor GetLocalInternalForce(Element targetElement, LoadCase loadCase, params double[] isoCoords)
        {
            //step 1 : get transformation matrix
            //step 2 : convert globals points to locals
            //step 3 : convert global displacements to locals
            //step 4 : calculate B matrix and D matrix
            //step 5 : M=D*B*U
            //Note : Steps changed...
            var lds = new Displacement[targetElement.Nodes.Length];
            var tr  = targetElement.GetTransformationManager();

            for (var i = 0; i < targetElement.Nodes.Length; i++)
            {
                var globalD = targetElement.Nodes[i].GetNodalDisplacement(loadCase);
                var local   = tr.TransformGlobalToLocal(globalD);
                lds[i] = local;
            }

            var b = GetBMatrixAt(targetElement, isoCoords);

            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = lds[0];
            var u2l = lds[1];
            var u3l = lds[2];

            var uDkt =
                targetElement.MatrixPool.Allocate(new[]
                                                  { u1l.DZ, u1l.RX, u1l.RY, /**/ u2l.DZ, u2l.RX, u2l.RY, /**/ u3l.DZ, u3l.RX, u3l.RY });


            var mDkt = d * b * uDkt; //eq. 32, batoz article

            //var buf = new PlateBendingStressTensor();

            //buf.Mx = mDkt[0, 0];
            //buf.My = mDkt[1, 0];
            //buf.Mxy = mDkt[2, 0];

            //return buf;

            var bTensor = new BendingStressTensor();

            //var buf = new List<Tuple<DoF, double>>();

            bTensor.M11 = mDkt[0, 0];
            bTensor.M22 = mDkt[1, 0];
            bTensor.M21 = bTensor.M12 = mDkt[2, 0];

            var buf = new GeneralStressTensor(bTensor);

            return(buf);
        }
        /// <inheritdoc/>
        public IEnumerable <Tuple <DoF, double> > GetLocalInternalForceAt(Element targetElement,
                                                                          Displacement[] globalDisplacements, params double[] isoCoords)
        {
            //step 1 : get transformation matrix
            //step 2 : convert globals points to locals
            //step 3 : convert global displacements to locals
            //step 4 : calculate B matrix and D matrix
            //step 5 : M=D*B*U
            //Note : Steps changed...

            var tr = targetElement.GetTransformationManager();

            var locals = tr.TransformGlobalToLocal(globalDisplacements);

            var b = GetBMatrixAt(targetElement, isoCoords);

            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = locals[0];
            var u2l = locals[1];
            var u3l = locals[2];

            var uDkt =
                targetElement.MatrixPool.Allocate(new[]
                                                  { u1l.DZ, u1l.RX, u1l.RY, /**/ u2l.DZ, u2l.RX, u2l.RY, /**/ u3l.DZ, u3l.RX, u3l.RY });


            var mDkt = d * b * uDkt; //eq. 32, batoz article

            //var buf = new PlateBendingStressTensor();

            //buf.Mx = mDkt[0, 0];
            //buf.My = mDkt[1, 0];
            //buf.Mxy = mDkt[2, 0];

            //return buf;

            var bTensor = new BendingStressTensor();

            //var buf = new List<Tuple<DoF, double>>();

            bTensor.M11 = mDkt[0, 0];
            bTensor.M22 = mDkt[1, 0];
            bTensor.M21 = bTensor.M12 = mDkt[2, 0];

            var buf = new GeneralStressTensor(bTensor);

            throw new NotImplementedException();
        }
        /// <summary>
        /// Gets the stresses for a single element
        /// </summary>
        /// <param name="targetElement"></param>
        /// <param name="loadCase"></param>
        /// <param name="isoCoords"></param>
        /// <returns></returns>
        public GeneralStressTensor GetLocalInternalForce(Element targetElement, LoadCase loadCase, params double[] isoCoords)
        {
            //step 1 : get transformation matrix
            //step 2 : convert globals points to locals
            //step 3 : convert global displacements to locals
            //step 4 : calculate B matrix and D matrix
            //step 5 : M=D*B*U
            //Note : Steps changed...
            var lds = new Displacement[targetElement.Nodes.Length];
            var tr  = targetElement.GetTransformationManager();

            for (var i = 0; i < targetElement.Nodes.Length; i++)
            {
                var globalD = targetElement.Nodes[i].GetNodalDisplacement(loadCase);
                var local   = tr.TransformGlobalToLocal(globalD);
                lds[i] = local;
            }

            // var locals = tr.TransformGlobalToLocal(globalDisplacements);

            var b = GetBMatrixAt(targetElement, isoCoords);
            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = lds[0];
            var u2l = lds[1];
            var u3l = lds[2];

            var uDkt = targetElement.MatrixPool.Allocate(6, 1);

            // TODO: MAT - set values directly
            uDkt.SetColumn(1, new double[] { u1l.DX, u1l.DY, /**/ u2l.DX, u2l.DY, /**/ u3l.DX, u3l.DY });

            var mDkt = d * b * uDkt; //eq. 32, batoz article


            var bTensor = new CauchyStressTensor();

            bTensor.S11 = mDkt[0, 0];
            bTensor.S22 = mDkt[1, 0];
            bTensor.S12 = bTensor.S21 = mDkt[2, 0];

            var buf = new GeneralStressTensor(bTensor);

            return(buf);

            throw new NotImplementedException();
        }
Пример #6
0
        public GeneralStressTensor GetLocalStressAt(Element targetElement, Displacement[] localDisplacements, params double[] isoCoords)
        {
            //step 1 : get transformation matrix
            //step 2 : convert globals points to locals
            //step 3 : convert global displacements to locals
            //step 4 : calculate B matrix and D matrix
            //step 5 : M=D*B*U
            //Note : Steps changed...

            var pt = new IsoPoint(isoCoords);

            var tr = targetElement.GetTransformationManager();

            var locals = localDisplacements;// tr.TransformGlobalToLocal(globalDisplacements);

            var b = GetBMatrixAt(targetElement, isoCoords);

            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = locals[0];
            var u2l = locals[1];
            var u3l = locals[2];

            var uDkt =
                targetElement.MatrixPool.Allocate(new[]
                                                  { u1l.DZ, u1l.RX, u1l.RY, /**/ u2l.DZ, u2l.RX, u2l.RY, /**/ u3l.DZ, u3l.RX, u3l.RY });


            var mDkt = d * b * uDkt; //eq. 32, batoz article

            var bTensor = new BendingStressTensor();

            bTensor.M11 = mDkt[0, 0];
            bTensor.M22 = mDkt[1, 0];
            bTensor.M21 = bTensor.M12 = mDkt[2, 0];

            var buf = new GeneralStressTensor(bTensor);


            return(buf);
        }
Пример #7
0
        public GeneralStressTensor GetLocalInternalStressAt(Element targetElement, Displacement[] localDisplacements, params double[] isoCoords)
        {
            var lds = localDisplacements;// new Displacement[targetElement.Nodes.Length];

            /*var tr = targetElement.GetTransformationManager();
             *
             * for (var i = 0; i < targetElement.Nodes.Length; i++)
             * {
             *  var globalD = targetElement.Nodes[i].GetNodalDisplacement(cmb);
             *  var local = tr.TransformGlobalToLocal(globalD);
             *  lds[i] = local;
             * }
             */
            var b = GetBMatrixAt(targetElement, isoCoords);

            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = lds[0];
            var u2l = lds[1];
            var u3l = lds[2];

            var uDkt =
                targetElement.MatrixPool.Allocate(new[]
                                                  { u1l.DZ, u1l.RX, u1l.RY, /**/ u2l.DZ, u2l.RX, u2l.RY, /**/ u3l.DZ, u3l.RX, u3l.RY });


            var mDkt = d * b * uDkt; //eq. 32, batoz article


            var bTensor = new BendingStressTensor();

            bTensor.M11 = mDkt[0, 0];
            bTensor.M22 = mDkt[1, 0];
            bTensor.M21 = bTensor.M12 = mDkt[2, 0];

            var buf = new GeneralStressTensor(bTensor);

            return(buf);
        }
        /// <summary>
        /// Gets the internal stress at defined <see cref="isoLocation"/>.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="loadCase">the load case </param>
        /// <param name="isoLocation"></param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// for more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public CauchyStressTensor GetLocalInternalStress(LoadCase loadCase, params double[] isoLocation)
        {
            var helpers = GetHelpers();

            var gst = new GeneralStressTensor();
            var tr  = this.GetTransformationManager();

            var ld = this.Nodes.Select(i => tr.TransformGlobalToLocal(i.GetNodalDisplacement(loadCase))).ToArray();

            for (var i = 0; i < helpers.Count(); i++)
            {
                var st = helpers[i].GetLocalInternalStressAt(this, ld, isoLocation);
                gst += st;
            }

            var buf = new CauchyStressTensor();

            buf += gst.MembraneTensor;

            if (isoLocation.Length == 3)// local Z and bending tensor does affect on cauchy tensor, only on center of plate where lambda=0 bending tensor have no effect on cauchy
            {
                //step2: update Cauchy based on bending: bending tensor also affects the Cauchy tensor regarding how much distance between desired location and center of plate.
                //old code: buf.UpdateTotalStress(_section.GetThicknessAt(new double[] { localX, localY }) * localZ, probeLocation);

                var lambda = 0.0;

                if (isoLocation.Length == 3)
                {
                    lambda = isoLocation[2];
                }

                if (lambda > 1.0 || lambda < -1.0)
                {
                    throw new Exception("lambda must be between -1 and +1")
                          {
                          }
                }
                ;

                var thickness = Section.GetThicknessAt(isoLocation);

                var z = thickness * lambda;//distance from plate center, measure in [m]

                buf -= BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, lambda);

                /*epsi1on: no need to subtract, only need to add because negativeness of lambda taken into account in ConvertBendingStressToCauchyTensor
                 *
                 * if (lambda > 0)
                 * {
                 *  //top -> add bending stress
                 *  buf += gst.BendingTensor.ConvertBendingStressToCauchyTensor(thickness, lambda);
                 * }
                 * else
                 * {
                 *  //bottom -> subtract bending stress
                 *  buf -= gst.BendingTensor.ConvertBendingStressToCauchyTensor(thickness, lambda);
                 * }
                 */
            }
            return(buf);
        }

        #endregion
    }
        /// <summary>
        /// Gets the internal stress at defined location.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="isoLocation">The location for the stress probe in iso coordinates. Order: x,y,z. Maximum bending stress at the shell thickness (z=1.0). Must be withing 0 and 1.</param>
        /// <param name="combination">The load combination.</param>
        /// <param name="probeLocation">The probe location for the stress.</param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// For more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public CauchyStressTensor GetInternalStress(double[] isoLocation, LoadCase cse, SectionPoints probeLocation)
        {
            //added by rubsy92
            if (isoLocation[2] < 0 || isoLocation[2] > 1.0)
            {
                throw new Exception("z must be between 0 and 1. 0 is the centre of the plate and 1 is on the plate surface. Use the section points to get the top/bottom.")
                      {
                      };
            }

            var helpers = GetHelpers();

            var gst = new GeneralStressTensor();
            var tr  = this.GetTransformationManager();

            var ld = this.Nodes.Select(i => tr.TransformGlobalToLocal(i.GetNodalDisplacement(cse))).ToArray();

            for (var i = 0; i < helpers.Count(); i++)
            {
                var st = helpers[i].GetLocalInternalStressAt(this, ld, isoLocation);
                gst += st;
            }

            var buf = new CauchyStressTensor();

            buf += gst.MembraneTensor;


            {
                var lambda = 0.0;
                switch (probeLocation)
                {
                case SectionPoints.Envelope:
                {
                    var thickness = Section.GetThicknessAt(isoLocation);
                    //top
                    var bufTop = new CauchyStressTensor();
                    bufTop += gst.MembraneTensor;
                    bufTop += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, 1.0);

                    //bottom
                    var bufBottom = new CauchyStressTensor();
                    bufBottom += gst.MembraneTensor;
                    bufBottom += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, -1.0);

                    if (Math.Abs(CauchyStressTensor.GetVonMisesStress(bufTop)) > Math.Abs(CauchyStressTensor.GetVonMisesStress(bufBottom)))
                    {
                        buf = bufTop;
                    }
                    else
                    {
                        buf = bufBottom;
                    }
                    break;
                }

                case SectionPoints.Top:
                {
                    lambda = 1.0;
                    var thickness = Section.GetThicknessAt(isoLocation);
                    buf += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, lambda);
                    break;
                }

                case SectionPoints.Bottom:
                {
                    lambda = -1.0;
                    var thickness = Section.GetThicknessAt(isoLocation);
                    buf += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, lambda);
                    break;
                }

                default:
                    break;
                }
            }
            return(buf);
        }
Пример #10
0
        /// <summary>
        /// Gets the internal stress at defined location.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="isoLocation">The location for the stress probe in iso coordinates. Order: x,y,z. Maximum bending stress at the shell thickness (z=1.0). Must be withing 0 and 1.</param>
        /// <param name="combination">The load combination.</param>
        /// <param name="probeLocation">The probe location for the stress.</param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// for more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public CauchyStressTensor GetInternalStress(double[] isoLocation, LoadCombination combination, SectionPoints probeLocation)
        {
            var helpers = GetHelpers();

            var gst = new GeneralStressTensor();
            var tr  = this.GetTransformationManager();

            var ld = this.Nodes.Select(i => tr.TransformGlobalToLocal(i.GetNodalDisplacement(combination))).ToArray();

            for (var i = 0; i < helpers.Count(); i++)
            {
                var st = helpers[i].GetLocalInternalStressAt(this, ld, isoLocation);
                gst += st;
            }

            var buf = new CauchyStressTensor();

            buf += gst.MembraneTensor;
            {
                var lambda = 0.0;
                switch (probeLocation)
                {
                case SectionPoints.Envelope:
                {
                    var thickness = Section.GetThicknessAt(isoLocation);
                    //top
                    var bufTop = new CauchyStressTensor();
                    bufTop += gst.MembraneTensor;
                    bufTop += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, 1.0);

                    //bottom
                    var bufBottom = new CauchyStressTensor();
                    bufBottom += gst.MembraneTensor;
                    bufBottom += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, -1.0);

                    if (Math.Abs(CauchyStressTensor.GetVonMisesStress(bufTop)) > Math.Abs(CauchyStressTensor.GetVonMisesStress(bufBottom)))
                    {
                        buf = bufTop;
                    }
                    else
                    {
                        buf = bufBottom;
                    }
                    break;
                }

                case SectionPoints.Top:
                {
                    lambda = 1.0;
                    var thickness = Section.GetThicknessAt(isoLocation);
                    buf += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, lambda);
                    break;
                }

                case SectionPoints.Bottom:
                {
                    lambda = -1.0;
                    var thickness = Section.GetThicknessAt(isoLocation);
                    buf += BendingStressTensor.ConvertBendingStressToCauchyTensor(gst.BendingTensor, thickness, lambda);
                    break;
                }

                default:
                    break;
                }
            }
            return(buf);
        }